|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.baseline.BuildReferenceMaps
final class BuildReferenceMaps
This class builds the reference and non-reference maps for a given method. The maps are recorded with ReferenceMaps. This class works with the baseline compiler, calculating the maps for local variables (including parameters), and the java operand stack. Given the basic blocks mapped out by BuildBB determine for each GC point (call sites and new's, etc) what the stack and variable maps are. Note that this class deals with reference maps (the term "stack maps" was not used as it is too ambiguous - does "stack" refer to the java operand stack or a C-like stack?; when processing java bytecodes it seemed best to use "stack" for java operand stack.)
Nested Class Summary | |
---|---|
private static class |
BuildReferenceMaps.PrimitiveSize
|
Field Summary | |
---|---|
(package private) int |
JSRSubNext
|
(package private) static byte |
NON_REFERENCE
The entry in the reference map contains a value that is not a reference. |
(package private) static byte |
NOT_SET
The entry in the reference map is not set in a JSR body. |
(package private) static byte |
REFERENCE
The entry in the reference map contains a value that is a reference. |
(package private) static byte |
RETURN_ADDRESS
The entry in the reference map contains a JSR return address. |
(package private) static byte |
SET_TO_NONREFERENCE
The entry in the reference map is set to a value that is not a reference within a JSR body. |
(package private) static byte |
SET_TO_REFERENCE
The entry in the reference map is set to a value that is a reference within a JSR body. |
(package private) int |
workStkTop
|
Fields inherited from interface org.jikesrvm.compilers.baseline.BBConstants |
---|
ADDRESS_TYPE, CONDITIONAL_, CONDITIONALTARGET, DOUBLE_TYPE, DUMMYBLOCK, EXCEPTIONHANDLER, EXITBLOCK, FALLTHRU_, FALLTHRUTARGET, FLOAT_TYPE, HASHANDLER_, INJSR_, INT_TYPE, JSRENTRY, LENGTH_MASK, LONG_TYPE, LONGHALF_TYPE, METHODENTRY, NOTBLOCK, STARTBLOCK, TARGET_, TRYHANDLERSTART, TRYSTART_, UNCONDITIONALTARGET, VOID_TYPE |
Constructor Summary | |
---|---|
BuildReferenceMaps()
|
Method Summary | |
---|---|
private short[] |
addToWorkStk(short blockNum,
short[] workStk)
|
private short[] |
addUniqueToWorkStk(short blockNum,
short[] workStk)
|
void |
buildReferenceMaps(NormalMethod method,
int[] stackHeights,
byte[] localTypes,
ReferenceMaps referenceMaps,
BuildBB buildBB)
After the analysis of the blocks of a method, examine the byte codes again, to determine the reference maps for the gc points. |
private short[] |
computeJSRNextMaps(short nextBBNum,
int maplength,
int JSRSubIndex,
boolean JSRisinJSRSub,
byte[][] bbMaps,
int[] blockStkTop,
JSRSubroutineInfo[] JSRSubs,
int currBBStkEmpty,
short[] workStk)
|
private short[] |
processBranchBB(short brBBNum,
int currBBStkTop,
byte[] currBBMap,
int currBBStkEmpty,
boolean inJSRSub,
byte[][] bbMaps,
int[] blockStkTop,
PendingRETInfo currPendingRET,
PendingRETInfo[] bbPendingRETs,
short[] workStk)
|
private int |
processInvoke(MethodReference target,
int byteindex,
int currBBStkTop,
byte[] currBBMap,
boolean isStatic,
boolean inJSRSub,
ReferenceMaps referenceMaps,
PendingRETInfo currPendingRET,
boolean blockSeen,
int currBBStkEmpty)
|
private short[] |
processJSR(int JSRBBNum,
int JSRSubStartIndex,
short brBBNum,
short nextBBNum,
byte[][] bbMaps,
int currBBStkTop,
byte[] currBBMap,
int currBBStkEmpty,
int[] blockStkTop,
PendingRETInfo[] bbPendingRETs,
PendingRETInfo currPendingRET,
JSRSubroutineInfo[] JSRSubs,
short[] workStk)
|
private void |
setHandlersMapsNonRef(int localVariable,
BuildReferenceMaps.PrimitiveSize wordCount,
int[] reachableHandlerBBNums,
int reachableHandlerCount,
boolean inJSRSub,
byte[][] bbMaps)
For each of the reachable handlers (catch blocks) from the try block, track that the local variable given by the index with 1 or 2 words, has been set to a non reference value (eg int, float, etc) |
private void |
setHandlersMapsRef(int localVariable,
int[] reachableHandlerBBNums,
int reachableHandlerCount,
byte[][] bbMaps)
For each of the reachable handlers (catch blocks) from the try block, track that the local variable given by the index, has been set to a reference value. |
private void |
setHandlersMapsReturnAddress(int localVariable,
int[] reachableHandlerBBNums,
int reachableHandlerCount,
byte[][] bbMaps)
For each of the reachable handlers (catch blocks) from the try block, track that the local variable given by the index, has been set to a return address value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final byte NON_REFERENCE
static final byte REFERENCE
static final byte RETURN_ADDRESS
static final byte NOT_SET
static final byte SET_TO_REFERENCE
static final byte SET_TO_NONREFERENCE
int workStkTop
int JSRSubNext
Constructor Detail |
---|
BuildReferenceMaps()
Method Detail |
---|
public void buildReferenceMaps(NormalMethod method, int[] stackHeights, byte[] localTypes, ReferenceMaps referenceMaps, BuildBB buildBB)
private short[] addToWorkStk(short blockNum, short[] workStk)
private short[] addUniqueToWorkStk(short blockNum, short[] workStk)
private short[] processBranchBB(short brBBNum, int currBBStkTop, byte[] currBBMap, int currBBStkEmpty, boolean inJSRSub, byte[][] bbMaps, int[] blockStkTop, PendingRETInfo currPendingRET, PendingRETInfo[] bbPendingRETs, short[] workStk)
private int processInvoke(MethodReference target, int byteindex, int currBBStkTop, byte[] currBBMap, boolean isStatic, boolean inJSRSub, ReferenceMaps referenceMaps, PendingRETInfo currPendingRET, boolean blockSeen, int currBBStkEmpty)
private short[] processJSR(int JSRBBNum, int JSRSubStartIndex, short brBBNum, short nextBBNum, byte[][] bbMaps, int currBBStkTop, byte[] currBBMap, int currBBStkEmpty, int[] blockStkTop, PendingRETInfo[] bbPendingRETs, PendingRETInfo currPendingRET, JSRSubroutineInfo[] JSRSubs, short[] workStk)
private short[] computeJSRNextMaps(short nextBBNum, int maplength, int JSRSubIndex, boolean JSRisinJSRSub, byte[][] bbMaps, int[] blockStkTop, JSRSubroutineInfo[] JSRSubs, int currBBStkEmpty, short[] workStk)
private void setHandlersMapsNonRef(int localVariable, BuildReferenceMaps.PrimitiveSize wordCount, int[] reachableHandlerBBNums, int reachableHandlerCount, boolean inJSRSub, byte[][] bbMaps)
localVariable
- Variable index in the mapwordCount
- 2 for doubles and longs, 1 otherwisereachableHandlerBBNums
- The array with all the block numbers of
reachable handlersreachableHandlerCount
- 0 through reachableHandlerCount
- 1
will all be valid
array indicesinJSRSub
- TODO Document ME XXXbbMaps
- TODO Document ME XXXprivate void setHandlersMapsRef(int localVariable, int[] reachableHandlerBBNums, int reachableHandlerCount, byte[][] bbMaps)
localVariable
- Variable index in the mapreachableHandlerBBNums
- The array with all the block numbers of
reachable handlersreachableHandlerCount
- 0 through reachableHandlerCount
- 1
will all be valid
array indicesbbMaps
- TODO Document ME XXXprivate void setHandlersMapsReturnAddress(int localVariable, int[] reachableHandlerBBNums, int reachableHandlerCount, byte[][] bbMaps)
localVariable
- variable index in the mapreachableHandlerBBNums
- the array with all the block numbers of
reachable handlersreachableHandlerCount
- 0 through reachableHandlerCount
- 1
will all be valid
array indicesbbMaps
- TODO Document ME XXX
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |