Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/shark/sharkRuntime.hpp
32285 views
/*1* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.2* Copyright 2008, 2009, 2010 Red Hat, Inc.3* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.4*5* This code is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License version 2 only, as7* published by the Free Software Foundation.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*23*/2425#ifndef SHARE_VM_SHARK_SHARKRUNTIME_HPP26#define SHARE_VM_SHARK_SHARKRUNTIME_HPP2728#include "memory/allocation.hpp"29#include "runtime/thread.hpp"30#include "shark/llvmHeaders.hpp"31#include "shark/llvmValue.hpp"3233class SharkRuntime : public AllStatic {34// VM calls35public:36static int find_exception_handler(JavaThread* thread,37int* indexes,38int num_indexes);3940static void monitorenter(JavaThread* thread, BasicObjectLock* lock);41static void monitorexit(JavaThread* thread, BasicObjectLock* lock);4243static void new_instance(JavaThread* thread, int index);44static void newarray(JavaThread* thread, BasicType type, int size);45static void anewarray(JavaThread* thread, int index, int size);46static void multianewarray(JavaThread* thread,47int index,48int ndims,49int* dims);5051static void register_finalizer(JavaThread* thread, oop object);5253static void throw_ArithmeticException(JavaThread* thread,54const char* file,55int line);56static void throw_ArrayIndexOutOfBoundsException(JavaThread* thread,57const char* file,58int line,59int index);60static void throw_ClassCastException(JavaThread* thread,61const char* file,62int line);63static void throw_NullPointerException(JavaThread* thread,64const char* file,65int line);6667// Helpers for VM calls68private:69static const SharkFrame* last_frame(JavaThread *thread) {70return thread->last_frame().zero_sharkframe();71}72static Method* method(JavaThread *thread) {73return last_frame(thread)->method();74}75static address bcp(JavaThread *thread, int bci) {76return method(thread)->code_base() + bci;77}78static int two_byte_index(JavaThread *thread, int bci) {79return Bytes::get_Java_u2(bcp(thread, bci) + 1);80}81static intptr_t tos_at(JavaThread *thread, int offset) {82return *(thread->zero_stack()->sp() + offset);83}8485// Non-VM calls86public:87static void dump(const char *name, intptr_t value);88static bool is_subtype_of(Klass* check_klass, Klass* object_klass);89static int uncommon_trap(JavaThread* thread, int trap_request);90};9192#endif // SHARE_VM_SHARK_SHARKRUNTIME_HPP939495