public class CallingConvention extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CallingConvention.Type
Constants denoting the type of a call for which a calling convention is requested.
|
Modifier and Type | Field and Description |
---|---|
private AllocatableValue[] |
argumentLocations
The ordered locations in which the arguments are placed.
|
private AllocatableValue |
returnLocation |
private int |
stackSize
The amount of stack space (in bytes) required for the stack-based arguments of the call.
|
Constructor and Description |
---|
CallingConvention(int stackSize,
AllocatableValue returnLocation,
AllocatableValue... argumentLocations)
Creates a description of the registers and stack locations used by a call.
|
Modifier and Type | Method and Description |
---|---|
AllocatableValue |
getArgument(int index)
Gets the location for the
index 'th argument. |
int |
getArgumentCount()
Gets the number of locations required for the arguments.
|
AllocatableValue[] |
getArguments()
Gets the locations required for the arguments.
|
AllocatableValue |
getReturn()
Gets the location for the return value or
Value.ILLEGAL if a void call. |
int |
getStackSize()
Gets the amount of stack space (in bytes) required for the stack-based arguments of the call.
|
String |
toString() |
private boolean |
verify() |
private final int stackSize
private final AllocatableValue returnLocation
private final AllocatableValue[] argumentLocations
public CallingConvention(int stackSize, AllocatableValue returnLocation, AllocatableValue... argumentLocations)
stackSize
- amount of stack space (in bytes) required for the stack-based arguments of
the callreturnLocation
- the location for the return value or Value.ILLEGAL
if a void
callargumentLocations
- the ordered locations in which the arguments are placedpublic AllocatableValue getReturn()
Value.ILLEGAL
if a void call.public AllocatableValue getArgument(int index)
index
'th argument.public int getStackSize()
public int getArgumentCount()
public AllocatableValue[] getArguments()
private boolean verify()