frame_x86.hpp revision 1204
0N/A * Copyright 1997-2007 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// A frame represents a physical stack frame (an activation). Frames can be 0N/A// C or Java frames, and the Java frames can be interpreted or compiled. 0N/A// In contrast, vframes represent source-level activations, so that one physical frame 0N/A// can correspond to multiple source level frames because of inlining. 0N/A// A frame is comprised of {pc, fp, sp} 0N/A// ------------------------------ Asm interpreter ---------------------------------------- 0N/A// Layout of asm interpreter frame: 0N/A// [expression stack ] * <- sp 0N/A// ... | monitor block size 0N/A// [monitor block size ] 0N/A// [pointer to locals ] = locals() locals_offset 0N/A// [constant pool cache ] = cache() cache_offset 0N/A// [methodData ] = mdp() mdx_offset 0N/A// [methodOop ] = method() method_offset 0N/A// [last sp ] = last_sp() last_sp_offset 0N/A// [old stack pointer ] (sender_sp) sender_sp_offset 0N/A// [old frame pointer ] <- fp = link() 0N/A// [oop temp ] (only for native calls) 0N/A// [locals and parameters ] 0N/A// ------------------------------ Asm interpreter ---------------------------------------- 0N/A// ------------------------------ C++ interpreter ---------------------------------------- 0N/A// Layout of C++ interpreter frame: (While executing in BytecodeInterpreter::run) 0N/A// [local variables ] BytecodeInterpreter::run local variables 0N/A// ... BytecodeInterpreter::run local variables 0N/A// [local variables ] BytecodeInterpreter::run local variables 0N/A// [old frame pointer ] fp [ BytecodeInterpreter::run's ebp/rbp ] 0N/A// [return pc ] (return to frame manager) 0N/A// [interpreter_state* ] (arg to BytecodeInterpreter::run) -------------- 0N/A// [expression stack ] <- last_Java_sp | 0N/A// ... | monitor block size | 0N/A// [monitors ] / <- interpreter_state.monitor_base | 0N/A// [struct interpretState ] <-----------------------------------------| 0N/A// [return pc ] (return to callee of frame manager [1] 0N/A// [locals and parameters ] 0N/A// [1] When the c++ interpreter calls a new method it returns to the frame 0N/A// manager which allocates a new frame on the stack. In that case there 0N/A// is no real callee of this newly allocated frame. The frame manager is 0N/A// aware of the additional frame(s) and will pop them as nested calls 0N/A// complete. Howevers tTo make it look good in the debugger the frame 0N/A// manager actually installs a dummy pc pointing to RecursiveInterpreterActivation 0N/A// with a fake interpreter_state* parameter to make it easy to debug 0N/A// Note that contrary to the layout for the assembly interpreter the 0N/A// expression stack allocated for the C++ interpreter is full sized. 0N/A// However this is not as bad as it seems as the interpreter frame_manager 0N/A// will truncate the unused space on succesive method calls. 0N/A// ------------------------------ C++ interpreter ---------------------------------------- 0N/A // non-interpreter frames 0N/A // Interpreter frames 0N/A // outgoing sp before a call to an invoked method 0N/A // an additional field beyond _sp and _pc: 0N/A // The interpreter and adapters will extend the frame of the caller. 0N/A // Since oopMaps are based on the sp of the caller before extension 0N/A // we need to know that value. However in order to compute the address 0N/A // of the return address we need the real "raw" sp. Since sparc already 0N/A // uses sp() to mean "raw" sp and unextended_sp() to mean the caller's 0N/A // original sp we use that convention. 1204N/A // Used in frame::sender_for_{interpreter,compiled}_frame 0N/A // accessors for the instance variables 0N/A // return address of param, zero origin index. 0N/A // expression stack tos if we are nested in a java call 0N/A // deoptimization support