public class ExecutionState extends Object
Modifier and Type | Field and Description |
---|---|
int |
bcIndex
the program pointer (bytecode index)
|
int |
callee_cmid
callee's compiled method id
|
ExecutionState |
callerState
the caller's state if this method is an inlinee
|
int |
cmid
the compiled method id of the activation (a Java method may have multiple
version of compiled method
|
Offset |
fpOffset
the offset of frame pointer of the activation.
|
private short |
maxStackHeight |
NormalMethod |
meth
the method of which the execution state belongs to
|
private int |
objnum |
private Object[] |
objs |
private int |
rid |
RVMThread |
thread
the thread on which the activation is running
|
Offset |
tsFPOffset
the callee (threadSwitch)'s frame pointer of this activation.
|
LinkedList<VariableElement> |
varElms
runtime values of locals and stack expressions at the bytecode index Each
element is an object of VariableElement.
|
Constructor and Description |
---|
ExecutionState(RVMThread whichThread,
Offset framePointerOffset,
int compiledMethodID,
int pc,
Offset tsFPOffset) |
Modifier and Type | Method and Description |
---|---|
void |
add(VariableElement elm) |
void |
addFirst(VariableElement elm) |
private static PseudoBytecode |
adjustStackHeight(PseudoBytecode last,
int height) |
private int |
computeStackHeight(PseudoBytecode head) |
private static byte[] |
generateBinaries(PseudoBytecode bhead,
int bsize)
Generating binary code from pseudo code, the size and the code
list are padded and well calculated.
|
byte[] |
generatePrologue()
Goes through variable elements and produces specialized
prologue using pseudo-bytecode.
|
Offset |
getFPOffset() |
short |
getMaxStackHeight() |
NormalMethod |
getMethod() |
RVMThread |
getThread() |
Offset |
getTSFPOffset() |
private static int |
paddingBytecode(PseudoBytecode head)
Adds padding (NOP) at the beginning of pseudo bytecode
to make the new bytecode size dividable by 4, then no branch
target adjustment is needed in the original code.
|
void |
printState()
print the current state for debugging
|
private PseudoBytecode |
processElement(VariableElement var,
PseudoBytecode tail,
int i) |
void |
setMethod(NormalMethod m) |
String |
toString() |
public ExecutionState callerState
public int callee_cmid
public NormalMethod meth
public int bcIndex
public LinkedList<VariableElement> varElms
public Offset tsFPOffset
public int cmid
private int objnum
private int rid
private short maxStackHeight
public ExecutionState(RVMThread whichThread, Offset framePointerOffset, int compiledMethodID, int pc, Offset tsFPOffset)
public void add(VariableElement elm)
public void addFirst(VariableElement elm)
public Offset getFPOffset()
public void setMethod(NormalMethod m)
public NormalMethod getMethod()
public Offset getTSFPOffset()
public void printState()
public byte[] generatePrologue()
private PseudoBytecode processElement(VariableElement var, PseudoBytecode tail, int i)
public short getMaxStackHeight()
private int computeStackHeight(PseudoBytecode head)
private static PseudoBytecode adjustStackHeight(PseudoBytecode last, int height)
private static int paddingBytecode(PseudoBytecode head)
head
- the first pseudo bytecode (must be NOP)private static byte[] generateBinaries(PseudoBytecode bhead, int bsize)
bhead
- the first pseude bytecode (must be a NOP)bsize
- the size of the bytecode