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 * 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 * 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 * 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. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 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. 2883N/A// InterfaceSupport provides functionality used by the VM_LEAF_BASE and 2883N/A// VM_ENTRY_BASE macros. These macros are used to guard entry points into 2883N/A// the VM and perform checks upon leave of the VM. 0N/A // Helper methods used to implement +ScavengeALot and +FullGCALot 0N/A // OS dependent stuff 0N/A// Basic class for all thread transition classes. 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 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 // Make sure new state is seen by VM thread 0N/A // Force a fence between the write above and read below 0N/A // store to serialize page so VM thread can do pseudo remote membar 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 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 // Make sure new state is seen by VM thread 0N/A // Force a fence between the write above and read below 0N/A // Must use this rather than serialization page in particular on Windows 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 assert((
to &
1) == 0,
"odd numbers are transitions states");
0N/A // Change to transition state (assumes total store ordering! -Urs) 0N/A // Make sure new state is seen by GC thread 0N/A // Force a fence between the write above and read below 0N/A // Must use this rather than serialization page in particular on Windows 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 // Clear unhandled oops anywhere where we could block, even if we don't. 0N/A // Check for pending. async. exceptions or suspends. 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 // 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 // Check for pending. async. exceptions or suspends. 0N/A // We don't need to clear_walkable because it will happen automagically when we return to java 0N/A // Once we are blocked vm expects stack to be walkable 0N/A // We don't need to clear_walkable because it will happen automagically when we return to java 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/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 // Check for pending. suspends only. 0N/A// Debug class instantiated in JRT_ENTRY and ITR_ENTRY macro. 0N/A // This option is not used by Compiler 1 0N/A // do verification AFTER potential deoptimization 0N/A// VM-internal runtime interface support 0N/A// LEAF routines do not lock, GC or throw exceptions 0N/A// ENTRY routines may lock, GC and throw exceptions 0N/A// QUICK_ENTRY routines behave like ENTRY but without a handle mark 0N/A// Definitions for IRT (Interpreter Runtime) 0N/A// (thread is an argument passed in to all these routines) 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// Same as JRT Entry but allows for return value after the safepoint 0N/A// to get back into Java from the VM 0N/A// Definitions for JNI 0N/A// Ensure that the VMNativeEntryWrapper constructor, which can cause 2883N/A// a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE). 0N/A// Close the routine and the extern "C" 0N/A// Definitions for JVM 1879N/A#
endif // SHARE_VM_RUNTIME_INTERFACESUPPORT_HPP