frame.hpp revision 2460
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// A frame represents a physical stack frame (an activation). Frames 0N/A// can be C or Java frames, and the Java frames can be interpreted or 0N/A// compiled. In contrast, vframes represent source-level activations, 0N/A// so that one physical frame can correspond to multiple source level 0N/A// frames because of inlining. 0N/A // Instance variables: 0N/A address _pc;
// program counter (the next instruction after the call) 0N/A // pc: Returns the pc at which this frame will continue normally. 0N/A // It must point at the beginning of the next instruction to execute. 0N/A // This returns the pc that if you were in the debugger you'd see. Not 0N/A // the idealized value in the frame object. This undoes the magic conversion 0N/A // that happens for deoptimized frames. In addition it makes the value the 0N/A // hardware would want to see in the native frame. The only user (at this point) 0N/A // is deoptimization. It likely no one else should ever use it. 0N/A // patching operations 0N/A // Every frame needs to return a unique id which distinguishes it from all other frames. 0N/A // For sparc and ia32 use sp. ia64 can have memory frames that are empty so multiple frames 0N/A // will have identical sp values. For ia64 the bsp (fp) value will serve. No real frame 0N/A // should have an id() of NULL so it is a distinguishing value for an unmatchable frame. 0N/A // We also have relationals which allow comparing a frame to anoth frame's id() allow 0N/A // us to distinguish younger (more recent activation) from older (less recent activations) 0N/A // A NULL id is only valid when comparing for equality. 0N/A // Compares for strict equality. Rarely used or needed. 0N/A // It can return a different result than f1.id() == f2.id() 0N/A // tells whether this frame is marked for deoptimization 0N/A // tells whether this frame can be deoptimized 0N/A // returns the frame size in stack slots 0N/A // returns the sending frame 0N/A // for Profiling - acting on another frame. walks sender frames 0N/A // returns the sender, but skips conversion frames 0N/A // returns the the sending Java frame, skipping any intermediate C frames 0N/A // NB: receiver must not be first frame 0N/A // Helper methods for better factored code in frame::sender 0N/A // A low-level interface for vframes: 0N/A // accessors for locals 0N/A // Link (i.e., the pointer to the previous frame) 0N/A // Support for deoptimization 0N/A // The frame's original SP, before any extension by an interpreted callee; 0N/A // used for packing debug info into vframeArray objects and vframeArray lookup. 0N/A // returns the stack pointer of the calling frame 0N/A // Interpreter frames: 0N/A // The _at version returns a pointer because the address is used for GC. 0N/A // byte code index/pointer (use these functions for unchecked frame access only!) 0N/A // byte code pointer 0N/A // Only use this if you know what you are doing. 0N/A // method data pointer 0N/A // Find receiver out of caller's (compiled) argument list 0N/A // Return the monitor owner and BasicLock for compiled synchronized 0N/A // native methods so that biased locking can revoke the receiver's 1926N/A // bias if necessary. This is also used by JVMTI's GetLocalInstance method 1926N/A // (via VM_GetReceiver) to retrieve the receiver from a native wrapper frame. 0N/A // Find receiver for an invoke when arguments are just pushed on stack (i.e., callee stack-frame is 0N/A // expression stack (may go up or down, direction == 1 or -1) 0N/A // The _at version returns a pointer because the address is used for GC. 0N/A // top of expression stack 0N/A // template based interpreter deoptimization support 0N/A // BasicObjectLocks: 0N/A // interpreter_frame_monitor_begin is higher in memory than interpreter_frame_monitor_end 0N/A // Interpreter_frame_monitor_begin points to one element beyond the oldest one, 0N/A // interpreter_frame_monitor_end points to the youngest one, or if there are none, 0N/A // it points to one beyond where the first element will be. 0N/A // interpreter_frame_monitor_size reports the allocation size of a monitor in the interpreter stack. 0N/A // this value is >= BasicObjectLock::size(), and may be rounded up 0N/A // Tells whether the current interpreter_frame frame pointer 0N/A // The receiver used to be a top level frame 0N/A // If the method return type is T_OBJECT or T_ARRAY populates oop_result 0N/A // For other (non-T_VOID) the appropriate field in the jvalue is populated 0N/A // with the result value. 0N/A // Should only be called when at method exit when the method is not 0N/A // exiting due to an exception. 0N/A // Method & constant pool cache 0N/A // tells whether there is another chunk of Delta stack above 0N/A // Given the index of a local, and the number of argument words 0N/A // in this stack frame, tell which word of the stack frame to find 0N/A // the local in. Arguments are stored above the ofp/rpc pair, 0N/A // while other locals are stored below it. 0N/A // Since monitors (BasicLock blocks) are also assigned indexes, 0N/A // but may have different storage requirements, their presence 0N/A // can also affect the calculation of offsets. 0N/A // Given the index of a monitor, etc., tell which word of the 0N/A // stack frame contains the start of the BasicLock block. 0N/A // Note that the local index by convention is the __higher__ 0N/A // of the two indexes allocated to the block. 0N/A // Tell the smallest value that local_offset_for_compiler will attain. 0N/A // This is used to help determine how much stack frame to allocate. 0N/A // Tells if this register must be spilled during a call. 0N/A // On Intel, all registers are smashed by calls. 2433N/A // Add annotated descriptions of memory locations belonging to this frame to values 0N/A // Conversion from an VMReg to physical stack location 0N/A // Iteration of oops 0N/A // Memory management 0N/A // assert(frame::verify_return_pc(return_address), "must be a return pc"); 2433N/A// A simple class to describe a location on the stack 2433N/A// A collection of described stack values that can print a symbolic 2433N/A// description of the stack memory. Interpreter frame values can be 2433N/A// in the caller frames so all the values are collected first and then 2433N/A// sorted before being printed. 2433N/A // Used by frame functions to describe locations. 0N/A// StackFrameStream iterates through the frames of a thread starting from 0N/A// top most frame. It automatically takes care of updating the location of 0N/A// all (callee-saved) registers. Notice: If a thread is stopped at 0N/A// a safepoint, all registers are saved, not only the callee-saved ones. 0N/A// for(StackFrameStream fst(thread); !fst.is_done(); fst.next()) { 1879N/A#
endif // SHARE_VM_RUNTIME_FRAME_HPP