interfaceSupport.hpp revision 2796
0N/A/*
2273N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
1472N/A * or visit www.oracle.com if you need additional information or have any
1472N/A * questions.
0N/A *
0N/A */
0N/A
1879N/A#ifndef SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
1879N/A#define SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP
1879N/A
1879N/A#include "memory/gcLocker.hpp"
1879N/A#include "runtime/handles.inline.hpp"
1879N/A#include "runtime/mutexLocker.hpp"
1879N/A#include "runtime/orderAccess.hpp"
1879N/A#include "runtime/os.hpp"
1879N/A#include "runtime/safepoint.hpp"
1879N/A#include "runtime/vmThread.hpp"
1879N/A#include "utilities/globalDefinitions.hpp"
1879N/A#include "utilities/preserveException.hpp"
1879N/A#include "utilities/top.hpp"
1879N/A#ifdef TARGET_OS_FAMILY_linux
1879N/A# include "thread_linux.inline.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_solaris
1879N/A# include "thread_solaris.inline.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_windows
1879N/A# include "thread_windows.inline.hpp"
1879N/A#endif
2796N/A#ifdef TARGET_OS_FAMILY_bsd
2796N/A# include "thread_bsd.inline.hpp"
2796N/A#endif
1879N/A
0N/A// Wrapper for all entry points to the virtual machine.
0N/A// The HandleMarkCleaner is a faster version of HandleMark.
0N/A// It relies on the fact that there is a HandleMark further
0N/A// down the stack (in JavaCalls::call_helper), and just resets
0N/A// to the saved values in that HandleMark.
0N/A
0N/Aclass HandleMarkCleaner: public StackObj {
0N/A private:
0N/A Thread* _thread;
0N/A public:
0N/A HandleMarkCleaner(Thread* thread) {
0N/A _thread = thread;
0N/A _thread->last_handle_mark()->push();
0N/A }
0N/A ~HandleMarkCleaner() {
0N/A _thread->last_handle_mark()->pop_and_restore();
0N/A }
0N/A
0N/A private:
0N/A inline void* operator new(size_t size, void* ptr) {
0N/A return ptr;
0N/A }
0N/A};
0N/A
0N/A// InterfaceSupport provides functionality used by the __LEAF and __ENTRY
0N/A// macros. These macros are used to guard entry points into the VM and
0N/A// perform checks upon leave of the VM.
0N/A
0N/A
0N/Aclass InterfaceSupport: AllStatic {
0N/A# ifdef ASSERT
0N/A public:
0N/A static long _scavenge_alot_counter;
0N/A static long _fullgc_alot_counter;
0N/A static long _number_of_calls;
0N/A static long _fullgc_alot_invocation;
0N/A
0N/A // tracing
0N/A static void trace(const char* result_type, const char* header);
0N/A
0N/A // Helper methods used to implement +ScavengeALot and +FullGCALot
0N/A static void check_gc_alot() { if (ScavengeALot || FullGCALot) gc_alot(); }
0N/A static void gc_alot();
0N/A
0N/A static void walk_stack_from(vframe* start_vf);
0N/A static void walk_stack();
0N/A
0N/A# ifdef ENABLE_ZAP_DEAD_LOCALS
0N/A static void zap_dead_locals_old();
0N/A# endif
0N/A
0N/A static void zombieAll();
2062N/A static void unlinkSymbols();
0N/A static void deoptimizeAll();
0N/A static void stress_derived_pointers();
0N/A static void verify_stack();
0N/A static void verify_last_frame();
0N/A# endif
0N/A
0N/A public:
0N/A // OS dependent stuff
1879N/A#ifdef TARGET_OS_FAMILY_linux
1879N/A# include "interfaceSupport_linux.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_solaris
1879N/A# include "interfaceSupport_solaris.hpp"
1879N/A#endif
1879N/A#ifdef TARGET_OS_FAMILY_windows
1879N/A# include "interfaceSupport_windows.hpp"
1879N/A#endif
2796N/A#ifdef TARGET_OS_FAMILY_bsd
2796N/A# include "interfaceSupport_bsd.hpp"
2796N/A#endif
1879N/A
0N/A};
0N/A
0N/A
0N/A// Basic class for all thread transition classes.
0N/A
0N/Aclass ThreadStateTransition : public StackObj {
0N/A protected:
0N/A JavaThread* _thread;
0N/A public:
0N/A ThreadStateTransition(JavaThread *thread) {
0N/A _thread = thread;
0N/A assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
0N/A }
0N/A
0N/A // Change threadstate in a manner, so safepoint can detect changes.
0N/A // Time-critical: called on exit from every runtime routine
0N/A static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
0N/A assert(from != _thread_in_Java, "use transition_from_java");
0N/A assert(from != _thread_in_native, "use transition_from_native");
0N/A assert((from & 1) == 0 && (to & 1) == 0, "odd numbers are transitions states");
0N/A assert(thread->thread_state() == from, "coming from wrong thread state");
0N/A // Change to transition state (assumes total store ordering! -Urs)
0N/A thread->set_thread_state((JavaThreadState)(from + 1));
0N/A
0N/A // Make sure new state is seen by VM thread
0N/A if (os::is_MP()) {
0N/A if (UseMembar) {
0N/A // Force a fence between the write above and read below
0N/A OrderAccess::fence();
0N/A } else {
0N/A // store to serialize page so VM thread can do pseudo remote membar
0N/A os::write_memory_serialize_page(thread);
0N/A }
0N/A }
0N/A
0N/A if (SafepointSynchronize::do_call_back()) {
0N/A SafepointSynchronize::block(thread);
0N/A }
0N/A thread->set_thread_state(to);
0N/A
0N/A CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
0N/A }
0N/A
0N/A // transition_and_fence must be used on any thread state transition
0N/A // where there might not be a Java call stub on the stack, in
0N/A // particular on Windows where the Structured Exception Handler is
0N/A // set up in the call stub. os::write_memory_serialize_page() can
0N/A // fault and we can't recover from it on Windows without a SEH in
0N/A // place.
0N/A static inline void transition_and_fence(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
0N/A assert(thread->thread_state() == from, "coming from wrong thread state");
0N/A assert((from & 1) == 0 && (to & 1) == 0, "odd numbers are transitions states");
0N/A // Change to transition state (assumes total store ordering! -Urs)
0N/A thread->set_thread_state((JavaThreadState)(from + 1));
0N/A
0N/A // Make sure new state is seen by VM thread
0N/A if (os::is_MP()) {
0N/A if (UseMembar) {
0N/A // Force a fence between the write above and read below
0N/A OrderAccess::fence();
0N/A } else {
0N/A // Must use this rather than serialization page in particular on Windows
0N/A InterfaceSupport::serialize_memory(thread);
0N/A }
0N/A }
0N/A
0N/A if (SafepointSynchronize::do_call_back()) {
0N/A SafepointSynchronize::block(thread);
0N/A }
0N/A thread->set_thread_state(to);
0N/A
0N/A CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
0N/A }
0N/A
0N/A // Same as above, but assumes from = _thread_in_Java. This is simpler, since we
0N/A // never block on entry to the VM. This will break the code, since e.g. preserve arguments
0N/A // have not been setup.
0N/A static inline void transition_from_java(JavaThread *thread, JavaThreadState to) {
0N/A assert(thread->thread_state() == _thread_in_Java, "coming from wrong thread state");
0N/A thread->set_thread_state(to);
0N/A }
0N/A
0N/A static inline void transition_from_native(JavaThread *thread, JavaThreadState to) {
0N/A assert((to & 1) == 0, "odd numbers are transitions states");
0N/A assert(thread->thread_state() == _thread_in_native, "coming from wrong thread state");
0N/A // Change to transition state (assumes total store ordering! -Urs)
0N/A thread->set_thread_state(_thread_in_native_trans);
0N/A
0N/A // Make sure new state is seen by GC thread
0N/A if (os::is_MP()) {
0N/A if (UseMembar) {
0N/A // Force a fence between the write above and read below
0N/A OrderAccess::fence();
0N/A } else {
0N/A // Must use this rather than serialization page in particular on Windows
0N/A InterfaceSupport::serialize_memory(thread);
0N/A }
0N/A }
0N/A
0N/A // We never install asynchronous exceptions when coming (back) in
0N/A // to the runtime from native code because the runtime is not set
0N/A // up to handle exceptions floating around at arbitrary points.
0N/A if (SafepointSynchronize::do_call_back() || thread->is_suspend_after_native()) {
0N/A JavaThread::check_safepoint_and_suspend_for_native_trans(thread);
0N/A
0N/A // Clear unhandled oops anywhere where we could block, even if we don't.
0N/A CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
0N/A }
0N/A
0N/A thread->set_thread_state(to);
0N/A }
0N/A protected:
0N/A void trans(JavaThreadState from, JavaThreadState to) { transition(_thread, from, to); }
0N/A void trans_from_java(JavaThreadState to) { transition_from_java(_thread, to); }
0N/A void trans_from_native(JavaThreadState to) { transition_from_native(_thread, to); }
0N/A void trans_and_fence(JavaThreadState from, JavaThreadState to) { transition_and_fence(_thread, from, to); }
0N/A};
0N/A
0N/A
0N/Aclass ThreadInVMfromJava : public ThreadStateTransition {
0N/A public:
0N/A ThreadInVMfromJava(JavaThread* thread) : ThreadStateTransition(thread) {
0N/A trans_from_java(_thread_in_vm);
0N/A }
0N/A ~ThreadInVMfromJava() {
0N/A trans(_thread_in_vm, _thread_in_Java);
0N/A // Check for pending. async. exceptions or suspends.
0N/A if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition();
0N/A }
0N/A};
0N/A
0N/A
0N/Aclass ThreadInVMfromUnknown {
0N/A private:
0N/A JavaThread* _thread;
0N/A public:
0N/A ThreadInVMfromUnknown() : _thread(NULL) {
0N/A Thread* t = Thread::current();
0N/A if (t->is_Java_thread()) {
0N/A JavaThread* t2 = (JavaThread*) t;
0N/A if (t2->thread_state() == _thread_in_native) {
0N/A _thread = t2;
0N/A ThreadStateTransition::transition_from_native(t2, _thread_in_vm);
0N/A // Used to have a HandleMarkCleaner but that is dangerous as
0N/A // it could free a handle in our (indirect, nested) caller.
0N/A // We expect any handles will be short lived and figure we
0N/A // don't need an actual HandleMark.
0N/A }
0N/A }
0N/A }
0N/A ~ThreadInVMfromUnknown() {
0N/A if (_thread) {
0N/A ThreadStateTransition::transition_and_fence(_thread, _thread_in_vm, _thread_in_native);
0N/A }
0N/A }
0N/A};
0N/A
0N/A
0N/Aclass ThreadInVMfromNative : public ThreadStateTransition {
0N/A public:
0N/A ThreadInVMfromNative(JavaThread* thread) : ThreadStateTransition(thread) {
0N/A trans_from_native(_thread_in_vm);
0N/A }
0N/A ~ThreadInVMfromNative() {
0N/A trans_and_fence(_thread_in_vm, _thread_in_native);
0N/A }
0N/A};
0N/A
0N/A
0N/Aclass ThreadToNativeFromVM : public ThreadStateTransition {
0N/A public:
0N/A ThreadToNativeFromVM(JavaThread *thread) : ThreadStateTransition(thread) {
0N/A // We are leaving the VM at this point and going directly to native code.
0N/A // Block, if we are in the middle of a safepoint synchronization.
0N/A assert(!thread->owns_locks(), "must release all locks when leaving VM");
0N/A thread->frame_anchor()->make_walkable(thread);
0N/A trans_and_fence(_thread_in_vm, _thread_in_native);
0N/A // Check for pending. async. exceptions or suspends.
0N/A if (_thread->has_special_runtime_exit_condition()) _thread->handle_special_runtime_exit_condition(false);
0N/A }
0N/A
0N/A ~ThreadToNativeFromVM() {
0N/A trans_from_native(_thread_in_vm);
0N/A // We don't need to clear_walkable because it will happen automagically when we return to java
0N/A }
0N/A};
0N/A
0N/A
0N/Aclass ThreadBlockInVM : public ThreadStateTransition {
0N/A public:
0N/A ThreadBlockInVM(JavaThread *thread)
0N/A : ThreadStateTransition(thread) {
0N/A // Once we are blocked vm expects stack to be walkable
0N/A thread->frame_anchor()->make_walkable(thread);
0N/A trans_and_fence(_thread_in_vm, _thread_blocked);
0N/A }
0N/A ~ThreadBlockInVM() {
0N/A trans_and_fence(_thread_blocked, _thread_in_vm);
0N/A // We don't need to clear_walkable because it will happen automagically when we return to java
0N/A }
0N/A};
0N/A
0N/A
0N/A// This special transition class is only used to prevent asynchronous exceptions
0N/A// from being installed on vm exit in situations where we can't tolerate them.
0N/A// See bugs: 4324348, 4854693, 4998314, 5040492, 5050705.
0N/Aclass ThreadInVMfromJavaNoAsyncException : public ThreadStateTransition {
0N/A public:
0N/A ThreadInVMfromJavaNoAsyncException(JavaThread* thread) : ThreadStateTransition(thread) {
0N/A trans_from_java(_thread_in_vm);
0N/A }
0N/A ~ThreadInVMfromJavaNoAsyncException() {
0N/A trans(_thread_in_vm, _thread_in_Java);
0N/A // NOTE: We do not check for pending. async. exceptions.
0N/A // If we did and moved the pending async exception over into the
0N/A // pending exception field, we would need to deopt (currently C2
0N/A // only). However, to do so would require that we transition back
0N/A // to the _thread_in_vm state. Instead we postpone the handling of
0N/A // the async exception.
0N/A
0N/A // Check for pending. suspends only.
0N/A if (_thread->has_special_runtime_exit_condition())
0N/A _thread->handle_special_runtime_exit_condition(false);
0N/A }
0N/A};
0N/A
0N/A// Debug class instantiated in JRT_ENTRY and ITR_ENTRY macro.
0N/A// Can be used to verify properties on enter/exit of the VM.
0N/A
0N/A#ifdef ASSERT
0N/Aclass VMEntryWrapper {
0N/A public:
0N/A VMEntryWrapper() {
0N/A if (VerifyLastFrame) {
0N/A InterfaceSupport::verify_last_frame();
0N/A }
0N/A }
0N/A
0N/A ~VMEntryWrapper() {
0N/A InterfaceSupport::check_gc_alot();
0N/A if (WalkStackALot) {
0N/A InterfaceSupport::walk_stack();
0N/A }
0N/A#ifdef ENABLE_ZAP_DEAD_LOCALS
0N/A if (ZapDeadLocalsOld) {
0N/A InterfaceSupport::zap_dead_locals_old();
0N/A }
0N/A#endif
0N/A#ifdef COMPILER2
0N/A // This option is not used by Compiler 1
0N/A if (StressDerivedPointers) {
0N/A InterfaceSupport::stress_derived_pointers();
0N/A }
0N/A#endif
0N/A if (DeoptimizeALot || DeoptimizeRandom) {
0N/A InterfaceSupport::deoptimizeAll();
0N/A }
0N/A if (ZombieALot) {
0N/A InterfaceSupport::zombieAll();
0N/A }
2062N/A if (UnlinkSymbolsALot) {
2062N/A InterfaceSupport::unlinkSymbols();
2062N/A }
0N/A // do verification AFTER potential deoptimization
0N/A if (VerifyStack) {
0N/A InterfaceSupport::verify_stack();
0N/A }
0N/A
0N/A }
0N/A};
0N/A
0N/A
0N/Aclass VMNativeEntryWrapper {
0N/A public:
0N/A VMNativeEntryWrapper() {
0N/A if (GCALotAtAllSafepoints) InterfaceSupport::check_gc_alot();
0N/A }
0N/A
0N/A ~VMNativeEntryWrapper() {
0N/A if (GCALotAtAllSafepoints) InterfaceSupport::check_gc_alot();
0N/A }
0N/A};
0N/A
0N/A#endif
0N/A
0N/A
0N/A// VM-internal runtime interface support
0N/A
0N/A#ifdef ASSERT
0N/A
0N/Aclass RuntimeHistogramElement : public HistogramElement {
0N/A public:
0N/A RuntimeHistogramElement(const char* name);
0N/A};
0N/A
0N/A#define TRACE_CALL(result_type, header) \
0N/A InterfaceSupport::_number_of_calls++; \
0N/A if (TraceRuntimeCalls) \
0N/A InterfaceSupport::trace(#result_type, #header); \
0N/A if (CountRuntimeCalls) { \
0N/A static RuntimeHistogramElement* e = new RuntimeHistogramElement(#header); \
0N/A if (e != NULL) e->increment_count(); \
0N/A }
0N/A#else
0N/A#define TRACE_CALL(result_type, header) \
0N/A /* do nothing */
0N/A#endif
0N/A
0N/A
0N/A// LEAF routines do not lock, GC or throw exceptions
0N/A
0N/A#define __LEAF(result_type, header) \
0N/A TRACE_CALL(result_type, header) \
0N/A debug_only(NoHandleMark __hm;) \
0N/A /* begin of body */
0N/A
0N/A
0N/A// ENTRY routines may lock, GC and throw exceptions
0N/A
0N/A#define __ENTRY(result_type, header, thread) \
0N/A TRACE_CALL(result_type, header) \
0N/A HandleMarkCleaner __hm(thread); \
0N/A Thread* THREAD = thread; \
0N/A /* begin of body */
0N/A
0N/A
0N/A// QUICK_ENTRY routines behave like ENTRY but without a handle mark
0N/A
0N/A#define __QUICK_ENTRY(result_type, header, thread) \
0N/A TRACE_CALL(result_type, header) \
0N/A debug_only(NoHandleMark __hm;) \
0N/A Thread* THREAD = thread; \
0N/A /* begin of body */
0N/A
0N/A
0N/A// Definitions for IRT (Interpreter Runtime)
0N/A// (thread is an argument passed in to all these routines)
0N/A
0N/A#define IRT_ENTRY(result_type, header) \
0N/A result_type header { \
0N/A ThreadInVMfromJava __tiv(thread); \
0N/A __ENTRY(result_type, header, thread) \
0N/A debug_only(VMEntryWrapper __vew;)
0N/A
0N/A
0N/A#define IRT_LEAF(result_type, header) \
0N/A result_type header { \
0N/A __LEAF(result_type, header) \
0N/A debug_only(No_Safepoint_Verifier __nspv(true);)
0N/A
0N/A
0N/A#define IRT_ENTRY_NO_ASYNC(result_type, header) \
0N/A result_type header { \
0N/A ThreadInVMfromJavaNoAsyncException __tiv(thread); \
0N/A __ENTRY(result_type, header, thread) \
0N/A debug_only(VMEntryWrapper __vew;)
0N/A
0N/A// Another special case for nmethod_entry_point so the nmethod that the
0N/A// interpreter is about to branch to doesn't get flushed before as we
0N/A// branch to it's interpreter_entry_point. Skip stress testing here too.
0N/A// Also we don't allow async exceptions because it is just too painful.
0N/A#define IRT_ENTRY_FOR_NMETHOD(result_type, header) \
0N/A result_type header { \
0N/A nmethodLocker _nmlock(nm); \
0N/A ThreadInVMfromJavaNoAsyncException __tiv(thread); \
0N/A __ENTRY(result_type, header, thread)
0N/A
0N/A#define IRT_END }
0N/A
0N/A
0N/A// Definitions for JRT (Java (Compiler/Shared) Runtime)
0N/A
0N/A#define JRT_ENTRY(result_type, header) \
0N/A result_type header { \
0N/A ThreadInVMfromJava __tiv(thread); \
0N/A __ENTRY(result_type, header, thread) \
0N/A debug_only(VMEntryWrapper __vew;)
0N/A
0N/A
0N/A#define JRT_LEAF(result_type, header) \
0N/A result_type header { \
0N/A __LEAF(result_type, header) \
0N/A debug_only(JRT_Leaf_Verifier __jlv;)
0N/A
0N/A
0N/A#define JRT_ENTRY_NO_ASYNC(result_type, header) \
0N/A result_type header { \
0N/A ThreadInVMfromJavaNoAsyncException __tiv(thread); \
0N/A __ENTRY(result_type, header, thread) \
0N/A debug_only(VMEntryWrapper __vew;)
0N/A
0N/A// Same as JRT Entry but allows for return value after the safepoint
0N/A// to get back into Java from the VM
0N/A#define JRT_BLOCK_ENTRY(result_type, header) \
0N/A result_type header { \
0N/A TRACE_CALL(result_type, header) \
0N/A HandleMarkCleaner __hm(thread);
0N/A
0N/A#define JRT_BLOCK \
0N/A { \
0N/A ThreadInVMfromJava __tiv(thread); \
0N/A Thread* THREAD = thread; \
0N/A debug_only(VMEntryWrapper __vew;)
0N/A
0N/A#define JRT_BLOCK_END }
0N/A
0N/A#define JRT_END }
0N/A
0N/A// Definitions for JNI
0N/A
0N/A#define JNI_ENTRY(result_type, header) \
0N/A JNI_ENTRY_NO_PRESERVE(result_type, header) \
0N/A WeakPreserveExceptionMark __wem(thread);
0N/A
0N/A#define JNI_ENTRY_NO_PRESERVE(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
0N/A assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
0N/A ThreadInVMfromNative __tiv(thread); \
0N/A debug_only(VMNativeEntryWrapper __vew;) \
0N/A __ENTRY(result_type, header, thread)
0N/A
0N/A
0N/A// Ensure that the VMNativeEntryWrapper constructor, which can cause
0N/A// a GC, is called outside the NoHandleMark (set via __QUICK_ENTRY).
0N/A#define JNI_QUICK_ENTRY(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
0N/A assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
0N/A ThreadInVMfromNative __tiv(thread); \
0N/A debug_only(VMNativeEntryWrapper __vew;) \
0N/A __QUICK_ENTRY(result_type, header, thread)
0N/A
0N/A
0N/A#define JNI_LEAF(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
0N/A assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
0N/A __LEAF(result_type, header)
0N/A
0N/A
0N/A// Close the routine and the extern "C"
0N/A#define JNI_END } }
0N/A
0N/A
0N/A
0N/A// Definitions for JVM
0N/A
0N/A#define JVM_ENTRY(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
0N/A ThreadInVMfromNative __tiv(thread); \
0N/A debug_only(VMNativeEntryWrapper __vew;) \
0N/A __ENTRY(result_type, header, thread)
0N/A
0N/A
0N/A#define JVM_ENTRY_NO_ENV(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread(); \
0N/A ThreadInVMfromNative __tiv(thread); \
0N/A debug_only(VMNativeEntryWrapper __vew;) \
0N/A __ENTRY(result_type, header, thread)
0N/A
0N/A
0N/A#define JVM_QUICK_ENTRY(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
0N/A ThreadInVMfromNative __tiv(thread); \
0N/A debug_only(VMNativeEntryWrapper __vew;) \
0N/A __QUICK_ENTRY(result_type, header, thread)
0N/A
0N/A
0N/A#define JVM_LEAF(result_type, header) \
0N/Aextern "C" { \
0N/A result_type JNICALL header { \
0N/A VM_Exit::block_if_vm_exited(); \
0N/A __LEAF(result_type, header)
0N/A
0N/A
0N/A#define JVM_END } }
1879N/A
1879N/A#endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP