public abstract class FrameMap extends Object
StackSlot is
used to index slots of the frame relative to the stack pointer. The frame size is only fixed
after register allocation when all spill slots have been allocated. Both the outgoing argument
area and the spill area can grow until then. Therefore, outgoing arguments are indexed from the
stack pointer, while spill slots are indexed from the beginning of the frame (and the total frame
size has to be added to get the actual offset from the stack pointer).| Modifier and Type | Class and Description |
|---|---|
static interface |
FrameMap.ReferenceMapBuilderFactory |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
hasOutgoingStackArguments
Determines if this frame has values on the stack for outgoing calls.
|
protected int |
initialSpillSize
Initial size of the area occupied by spill slots and other stack-allocated memory blocks.
|
protected int |
outgoingSize
Size of the area occupied by outgoing overflow arguments.
|
protected int |
spillSize
Size of the area occupied by spill slots and other stack-allocated memory blocks.
|
| Constructor and Description |
|---|
FrameMap(CodeCacheProvider codeCache,
RegisterConfig registerConfig,
FrameMap.ReferenceMapBuilderFactory referenceMapFactory)
Creates a new frame map for the specified method.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
accessesCallerFrame()
Determines if an offset to an incoming stack argument was ever returned by
FrameMap.offsetForStackSlot(StackSlot). |
protected int |
alignFrameSize(int size)
Aligns the given frame size to the stack alignment size and return the aligned size.
|
StackSlot |
allocateSpillSlot(<any> kind)
Reserves a spill slot in the frame of the method being compiled.
|
StackSlot |
allocateStackMemory(int sizeInBytes,
int alignmentInBytes)
Reserves a contiguous and aligned range of memory in the frame of the method being compiled.
|
void |
callsMethod(CallingConvention cc)
Informs the frame map that the compiled code calls a particular method, which may need stack
space for outgoing arguments.
|
abstract int |
currentFrameSize()
Gets the current size of this frame.
|
void |
finish()
Computes the final size of this frame.
|
boolean |
frameNeedsAllocating()
Determines if any space is used in the frame apart from the
return address slot. |
int |
frameSize()
Gets the allocated space in the compiled frame, not including any ABI required storage like
the
return address slot or a saved frame pointer. |
RegisterConfig |
getRegisterConfig() |
TargetDescription |
getTarget() |
ReferenceMapBuilder |
newReferenceMapBuilder() |
int |
offsetForStackSlot(StackSlot slot)
Computes the offset of a stack slot relative to the frame register.
|
int |
outgoingSize() |
void |
reserveOutgoing(int argsSize)
Reserves space for stack-based outgoing arguments.
|
protected int |
returnAddressSize() |
int |
spillSlotSize(<any> kind)
Returns the spill slot size for the given
ValueKind. |
abstract int |
totalFrameSize()
Gets the total frame size of the compiled frame, including any ABI required storage like the
return address slot or a saved frame pointer. |
protected int initialSpillSize
protected int spillSize
protected int outgoingSize
protected boolean hasOutgoingStackArguments
public FrameMap(CodeCacheProvider codeCache,
RegisterConfig registerConfig,
FrameMap.ReferenceMapBuilderFactory referenceMapFactory)
public RegisterConfig getRegisterConfig()
public TargetDescription getTarget()
protected int returnAddressSize()
public boolean accessesCallerFrame()
FrameMap.offsetForStackSlot(StackSlot).public int frameSize()
return address slot or a saved frame pointer.
FrameMap.totalFrameSize() includes all storage that is part of the frame.public int outgoingSize()
public boolean frameNeedsAllocating()
return address slot.public abstract int totalFrameSize()
return address slot or a saved frame pointer.public abstract int currentFrameSize()
FrameMap.frameSize() if FrameMap.finish() were called now.protected int alignFrameSize(int size)
size - the initial frame size to be alignedpublic void finish()
public int offsetForStackSlot(StackSlot slot)
slot - a stack slotpublic void callsMethod(CallingConvention cc)
cc - The calling convention for the called method.public void reserveOutgoing(int argsSize)
argsSize - The amount of space (in bytes) to reserve for stack-based outgoing arguments.public int spillSlotSize(<any> kind)
ValueKind. The default value is the size in
bytes for the target architecture.kind - the ValueKind to be stored in the spill slot.public StackSlot allocateSpillSlot(<any> kind)
kind - The kind of the spill slot to be reserved.public StackSlot allocateStackMemory(int sizeInBytes,
int alignmentInBytes)
sizeInBytes - the number of bytes to reserve. Must be > 0.alignmentInBytes - the required alignment of the memory. Must be > 0, a power of 2, and
not exceed the OS stack frame alignment.public ReferenceMapBuilder newReferenceMapBuilder()