final class BuildReferenceMaps extends Object
Modifier and Type | Class and Description |
---|---|
private static class |
BuildReferenceMaps.PrimitiveSize |
Modifier and Type | Field and Description |
---|---|
(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 |
Constructor and Description |
---|
BuildReferenceMaps() |
Modifier and Type | Method and Description |
---|---|
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.
|
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
BuildReferenceMaps()
public void buildReferenceMaps(NormalMethod method, int[] stackHeights, byte[] localTypes, ReferenceMaps referenceMaps, BuildBB buildBB)
method
- the method whose bytecodes are to be examined againstackHeights
- height of the expression stack at each bytecodelocalTypes
- the types that the locals can takereferenceMaps
- the reference map. NB: the map's constructor is still running
while this method is called!buildBB
- the buildBB instance that contains the results from the
previous analysisBaselineCompiler.localTypes
,
TemplateCompilerFramework.stackHeights
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