deoptimization.hpp revision 1206
196N/A * Copyright 1997-2008 Sun Microsystems, Inc. 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. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A // What condition caused the deoptimization? 1206N/A // Next 7 reasons are recorded per bytecode in DataLayout::trap_bits 0N/A // Note: Keep this enum in sync. with _trap_reason_name. 0N/A // Note: Reason_RECORDED_LIMIT should be < 8 to fit into 3 bits of 0N/A // DataLayout::trap_bits. This dependency is enforced indirectly 0N/A // via asserts, to avoid excessive direct header-to-header dependencies. 0N/A // See Deoptimization::trap_state_reason and class DataLayout. 0N/A // What action must be taken by the runtime? 0N/A // Note: Keep this enum in sync. with _trap_action_name. 0N/A Unpack_deopt = 0,
// normal deoptimization, use pc computed in unpack_vframe_on_stack 0N/A // Checks all compiled methods. Invalid methods are deleted and 0N/A // corresponding activations are deoptimized. 0N/A // Deoptimizes a frame lazily. nmethod gets patched deopt happens on return to the frame 0N/A // Does the actual work for deoptimizing a single frame 0N/A // Helper function to revoke biases of all monitors in frame if UseBiasedLocking 0N/A // Helper function to revoke biases of all monitors in frames 0N/A // executing in a particular CodeBlob if UseBiasedLocking is enabled 0N/A // Support for restoring non-escaping objects 0N/A // Interface used for unpacking deoptimized frames 0N/A // UnrollBlock is returned by fetch_unroll_info() to the deoptimization handler (blob). 0N/A // This is only a CheapObj to ease debugging after a deopt failure 0N/A // The following fields are used as temps during the unpacking phase 0N/A // (which is tight on registers, especially on x86). They really ought 0N/A // to be PD variables but that involves moving this class into its own 0N/A // file to use the pd include mechanism. Maybe in a later cleanup ... 0N/A // Returns where a register is located. 0N/A // Returns the total size of frames 0N/A // Accessors used by the code generator for the unpack stub. 0N/A //** Returns an UnrollBlock continuing information 0N/A // how to make room for the resulting interpreter frames. 0N/A // Called by assembly stub after execution has returned to 0N/A // deoptimized frame. 0N/A // @argument thread. Thread where stub_frame resides. 0N/A // @see OptoRuntime::deoptimization_fetch_unroll_info_C 0N/A //** Unpacks vframeArray onto execution stack 0N/A // Called by assembly stub after execution has returned to 0N/A // deoptimized frame and after the stack unrolling. 0N/A // @argument thread. Thread where stub_frame resides. 0N/A // @argument exec_mode. Determines how execution should be continuted in top frame. 0N/A // 0 means continue after current byte code 0N/A // 1 means exception has happened, handle exception 0N/A // 2 means reexecute current bytecode (for uncommon traps). 0N/A // @see OptoRuntime::deoptimization_unpack_frames_C 0N/A // Return BasicType of call return type, if any 0N/A // Cleans up deoptimization bits on thread after unpacking or in the 0N/A // case of an exception. 0N/A // Restores callee saved values from deoptimized frame into oldest interpreter frame 0N/A // so caller of the deoptimized frame will get back the values it expects. 0N/A //** Performs an uncommon trap for compiled code. 0N/A // The top most compiler frame is converted into interpreter frames 0N/A // Helper routine that enters the VM and may block 0N/A //** Deoptimizes the frame identified by id. 0N/A // Only called from VMDeoptimizeFrame 0N/A // @argument thread. Thread where stub_frame resides. 0N/A // @argument id. id of frame that should be deoptimized. 0N/A // How much room to adjust the last frame's SP by, to make space for 0N/A // the callee's interpreter frame (which expects locals to be next to 0N/A // incoming arguments) 0N/A // trap_request codes 0N/A // standard reason for unloaded CP entry 0N/A // standard action for unloaded CP entry 0N/A // The trap_state stored in a MDO is decoded here. 0N/A // It records two items of information. 0N/A // reason: If a deoptimization happened here, what its reason was, 0N/A // or if there were multiple deopts with differing reasons. 0N/A // recompiled: If a deoptimization here triggered a recompilation. 0N/A // Note that not all reasons are recorded per-bci. 0N/A // Format like reason='foo' action='bar' index='123'. 0N/A // This is suitable both for XML and for tty output. 0N/A // JVMTI PopFrame support 0N/A // Preserves incoming arguments to the popped frame when it is 0N/A // returning to a deoptimized caller 0N/A // Update the mdo's count and per-BCI reason bits, returning previous state: 0N/A // class loading support for uncommon trap 0N/A // Note: Histogram array size is 1-2 Kb.