|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface StackframeLayoutConstants
---------------------------------------------------------------------- Stackframe layout conventions - Intel version. ----------------------------------------------------------------------- A stack is an array of "slots", declared formally as integers, each slot containing either a primitive (byte, int, float, etc), an object pointer, a machine code pointer (a return address pointer), or a pointer to another slot in the same stack (a frame pointer). The interpretation of a slot's contents depends on the current value of IP, the machine instruction address register. Each machine code generator provides maps, for use by the garbage collector, that tell how to interpret the stack slots at "safe points" in the program's execution.
Here's a picture of what a stack might look like in memory.
Note: this (array) object is drawn upside down compared to other objects because the hardware stack grows from high memory to low memory, but array objects are layed out from low memory to high (header first).
hi-memory +---------------+ ... | IP=0 | . +---------------+ . +-> | FP=0 | <-- "end of vm stack" sentinel . | +---------------+ . caller's frame | | cmid=0 | <-- "invisible method" id . | +---------------+ ---. | | parameter0 | \ | . | +---------------+ \ parameter area | . | | parameter1 | / (== caller's operand stack area) | . --- | +---------------+ / |... | | | saved IP | <-- return address (in caller) | | \ +---------------+ | header FP-> | saved FP | <-- this frame's caller's frame | | +---------------+ | | | cmid | <-- this frame's compiledmethod id | | +---------------+ | | | saved GPRs | \ | | +---------------+ \ nonvolatile register save area | | | saved FPRS | / | frame | +---------------+ | | | local0 | \ | body +---------------+ \_local variables area | | | local1 | / | | +---------------+ / | | | operand0 | \ | | +---------------+ \_operand stack area | | SP-> | operand1 | / | | +---------------+ / | | | ... | | --- +===============+ --- | ... | +---------------+ stackLimit-> | ... | \ +---------------+ \_guard region for detecting & processing stack overflow | ... | / +---------------+ / |(object header)| low-memory +---------------+The opt compiler uses a different stackframe layout
hi-memory +---------------+ ... | IP=0 | . +---------------+ . +-> | FP=0 | <-- "end of vm stack" sentinel . | +---------------+ . caller's frame | | cmid=-1 | <-- "invisible method" id . | +---------------+ ---. | | parameter0 | \ | . | +---------------+ \ parameter area | . | | parameter1 | / (== caller's operand stack area) | . --- | +---------------+ / |... | | | saved IP | <-- return address (in caller) | | \ +---------------+ | header FP-> | saved FP | <-- this frame's caller's frame | | +---------------+ | | | cmid | <-- this frame's compiledmethod id | --- +---------------+ | | | | | | | Spill Area | <-- spills and other method-specific | | | ... | compiler-managed storage | | +---------------+ | | | Saved FP | only SaveVolatile Frames | | | State | | | +---------------+ | | | VolGPR[0] | | | | ... | only SaveVolatile Frames | | | VolGPR[n] | | | +---------------+ | body | NVolGPR[k] | <-- info.getUnsignedNonVolatileOffset() | frame | | ... | k == info.getFirstNonVolatileGPR() | | | NVolGPR[n] | | | +---------------+ | | | NVolFPR[k] | | | | ... | k == info.getFirstNonVolatileFPR() | | | NVolFPR[n] | | | +---------------+ | | | parameter0 | \ | | +---------------+ \_parameters to callee frame | | SP-> | parameter1 | / | | +---------------+ / | | | ... | | --- +===============+ --- | ... | +---------------+ stackLimit-> | ... | \ +---------------+ \_guard region for detecting & processing stack overflow | ... | / +---------------+ / |(object header)| low-memory +---------------+
Field Summary | |
---|---|
static int |
BYTES_IN_STACKSLOT
|
static int |
FPU_STATE_SIZE
space to save entire FPU state. |
static int |
INVISIBLE_METHOD_ID
marker for "assembler" frames that have no associated RVMMethod |
static int |
LOG_BYTES_IN_STACKSLOT
|
static int |
STACK_SIZE_BOOT
total stack space to allocate for boot thread (includes guard region) |
static int |
STACK_SIZE_COLLECTOR
total stack space to allocate for collector thread (includes guard region) |
static int |
STACK_SIZE_DLOPEN
max space needed for dlopen sys call |
static int |
STACK_SIZE_GCDISABLED
max space needed while running with gc disabled |
static int |
STACK_SIZE_GROW
how much to grow stack when overflow detected |
static int |
STACK_SIZE_GUARD
max space needed for stack overflow trap processing |
static int |
STACK_SIZE_JNINATIVE_GROW
|
static int |
STACK_SIZE_MAX
upper limit on stack size (includes guard region) |
static int |
STACK_SIZE_NORMAL
initial stack space to allocate for normal thread (includes guard region) |
static int |
STACK_SIZE_SYSCALL
max space needed for any native code called by vm |
static int |
STACKFRAME_ALIGNMENT
|
static int |
STACKFRAME_BODY_OFFSET
offset of work area from FP |
static int |
STACKFRAME_FRAME_POINTER_OFFSET
base of this frame |
static int |
STACKFRAME_HEADER_SIZE
size of frame header, in bytes |
static int |
STACKFRAME_METHOD_ID_OFFSET
offset of method id from FP |
static int |
STACKFRAME_RETURN_ADDRESS_OFFSET
offset of caller's return address from FP |
static Address |
STACKFRAME_SENTINEL_FP
fp value indicating end of stack walkback |
static int |
XMM_STATE_SIZE
Currently only use the low 8 bytes, only use 4 SSE2 params |
Field Detail |
---|
static final int LOG_BYTES_IN_STACKSLOT
static final int BYTES_IN_STACKSLOT
static final int STACKFRAME_RETURN_ADDRESS_OFFSET
static final int STACKFRAME_FRAME_POINTER_OFFSET
static final int STACKFRAME_METHOD_ID_OFFSET
static final int STACKFRAME_BODY_OFFSET
static final int STACKFRAME_HEADER_SIZE
static final int FPU_STATE_SIZE
static final int XMM_STATE_SIZE
static final Address STACKFRAME_SENTINEL_FP
static final int INVISIBLE_METHOD_ID
static final int STACKFRAME_ALIGNMENT
static final int STACK_SIZE_GROW
static final int STACK_SIZE_GUARD
static final int STACK_SIZE_SYSCALL
static final int STACK_SIZE_DLOPEN
static final int STACK_SIZE_GCDISABLED
static final int STACK_SIZE_NORMAL
static final int STACK_SIZE_BOOT
static final int STACK_SIZE_COLLECTOR
static final int STACK_SIZE_MAX
static final int STACK_SIZE_JNINATIVE_GROW
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |