|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.osr.EncodedOSRMap
public final class EncodedOSRMap
EncodedOSRMap provides the similar function as GC map in OptMachineCodeMap.
In OptCompiledMethod, an instance of this class will represent all OSR map info for that method.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.jikesrvm.ia32.RegisterConstants |
---|
RegisterConstants.FloatingPointMachineRegister, RegisterConstants.FPR, RegisterConstants.GPR, RegisterConstants.MachineRegister, RegisterConstants.MM, RegisterConstants.XMM |
Field Summary | |
---|---|
private static EncodedOSRMap |
emptyMap
map used when there are no OSR instructions |
private int |
lastEntry
the last entry index. |
private long[] |
mapEntries
osr info entries |
private int[] |
osrMaps
the OSR map |
Fields inherited from interface org.jikesrvm.compilers.opt.runtimesupport.ia32.OptGCMapIteratorConstants |
---|
FIRST_GCMAP_REG, LAST_GCMAP_REG |
Fields inherited from interface org.jikesrvm.compilers.opt.regalloc.ia32.PhysicalRegisterConstants |
---|
AF, C0, C1, C2, C3, CF, CONDITION_VALUE, DOUBLE_REG, DOUBLE_VALUE, FIRST_DOUBLE, FIRST_INT, FIRST_SPECIAL, FLOAT_VALUE, INT_REG, INT_VALUE, NUM_SPECIALS, NUMBER_TYPE, OF, PF, SF, SPECIAL_REG, ST0, ST1, ZF |
Fields inherited from interface org.jikesrvm.ia32.RegisterConstants |
---|
ALL_FPRS, ALL_GPRS, EAX, EBP, EBX, ECX, EDI, EDX, ESI, ESP, FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7, INSTRUCTION_WIDTH, LG_INSTRUCTION_WIDTH, MM0, MM1, MM10, MM11, MM12, MM13, MM14, MM15, MM2, MM3, MM4, MM5, MM6, MM7, MM8, MM9, NATIVE_NONVOLATILE_FPRS, NATIVE_NONVOLATILE_GPRS, NATIVE_PARAMETER_FPRS, NATIVE_PARAMETER_GPRS, NATIVE_VOLATILE_FPRS, NATIVE_VOLATILE_GPRS, NONVOLATILE_FPRS, NONVOLATILE_GPRS, NUM_FPRS, NUM_GPRS, NUM_NONVOLATILE_FPRS, NUM_NONVOLATILE_GPRS, NUM_PARAMETER_FPRS, NUM_PARAMETER_GPRS, NUM_RETURN_FPRS, NUM_RETURN_GPRS, NUM_VOLATILE_FPRS, NUM_VOLATILE_GPRS, PARAMETER_FPRS, PARAMETER_GPRS, R0, R1, R10, R11, R12, R13, R14, R15, R2, R3, R4, R5, R6, R7, R8, R9, RETURN_FPRS, RETURN_GPRS, STACK_POINTER, THREAD_REGISTER, VOLATILE_FPRS, VOLATILE_GPRS, XMM0, XMM1, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, XMM8, XMM9 |
Fields inherited from interface org.jikesrvm.osr.OSRConstants |
---|
ACONST, BCI_MASK, BCI_SHIFT, CLEANREFS, DOUBLE, FLOAT, GETREFAT, HIGH_64BIT, ICONST, IEI_MASK, IEI_SHIFT, INT, INVALID_BCI, INVALID_IEI, KIND_MASK, KIND_SHIFT, LCONST, LOCAL, LONG, NEXT_BIT, NO_OSR_ENTRY, NUM_MASK, NUM_SHIFT, OFFSET_MASK, OFFSET_SHIFT, OSRI_MASK, OSRI_SHIFT, PHYREG, PSEUDO_CheckCast, PSEUDO_InvokeCompiledMethod, PSEUDO_InvokeStatic, PSEUDO_LoadDoubleConst, PSEUDO_LoadFloatConst, PSEUDO_LoadIntConst, PSEUDO_LoadLongConst, PSEUDO_LoadRetAddrConst, PSEUDO_LoadWordConst, PSEUDO_ParamInitEnd, REF, RET_ADDR, ReturnAddressTypeCode, SPILL, STACK, TCODE_MASK, TCODE_SHIFT, VTYPE_MASK, VTYPE_SHIFT, WORD, WordTypeCode |
Constructor Summary | |
---|---|
private |
EncodedOSRMap()
Constructor to build empty map |
private |
EncodedOSRMap(VariableMap varMap)
Constructor that builds EncodedOSRMap from variable map |
Method Summary | |
---|---|
private void |
_generateMapForOneMethodVariable(ArrayList<Integer> tempOsrMaps,
int regMapIndex,
MethodVariables mVar,
boolean lastMid)
Generate value in the Osr map |
private int |
findOSREntry(Offset mcOffset)
Do a binary search, find the entry for the machine code offset. |
private int |
generateOsrMaps(ArrayList<Integer> tempOsrMaps,
LinkedList<MethodVariables> mVarList)
Generate value in the Osr map, return the index of the first integer in the map. |
private int |
getBCIndex(int entry)
|
int |
getBytecodeIndexForMCOffset(Offset mcOffset)
Get bytecode index for a given instruction offset in bytes. |
private int |
getIEIndex(int entry)
|
int |
getInlineEncodingForMCOffset(Offset mcOffset)
|
int[] |
getMCIndexes()
|
private int |
getMCOffset(int entry)
|
private int |
getOSRMapIndex(int entry)
|
OSRMapIterator |
getOsrMapIteratorForMCOffset(Offset mcOffset)
given a MC offset, return an iterator over the elements of this map. |
private static int |
getRegBitPosition(int regnum)
get register bit position |
int |
getRegisterMapForMCOffset(Offset mcOffset)
get register's reference map for the machine instruction offset |
boolean |
hasOSRMap(Offset mcOffset)
Does the OSR map exist for a machine instruction offset |
static EncodedOSRMap |
makeMap(VariableMap varMap)
Encode the given variable map returning the canonical empty map if the map is empty |
void |
printMap()
print the encoded map for debugging. |
private void |
processTuple(ArrayList<Integer> tempOsrMaps,
LocalRegPair tuple,
boolean isLast)
Process on 32-bit tuple. |
static boolean |
registerIsSet(int map,
int regnum)
|
private void |
setBCIndex(int entry,
int index)
|
private void |
setIEIndex(int entry,
int index)
|
private void |
setMCOffset(int entry,
int offset)
|
private void |
setOSRMapIndex(int entry,
int index)
|
private static int |
setRegister(int map,
int regnum)
mark a register as reference type |
private void |
translateMap(ArrayList<Integer> tempOsrMaps,
LinkedList<VariableMapElement> osrlist)
Translates a list of OSR_MapElement to encoding, we can not trust the osrlist is in the increasing order of machine code offset. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final long[] mapEntries
private final int lastEntry
private final int[] osrMaps
private static final EncodedOSRMap emptyMap
Constructor Detail |
---|
private EncodedOSRMap()
private EncodedOSRMap(VariableMap varMap)
Method Detail |
---|
public static boolean registerIsSet(int map, int regnum)
private static int setRegister(int map, int regnum)
private static int getRegBitPosition(int regnum)
public static EncodedOSRMap makeMap(VariableMap varMap)
private void translateMap(ArrayList<Integer> tempOsrMaps, LinkedList<VariableMapElement> osrlist)
private int generateOsrMaps(ArrayList<Integer> tempOsrMaps, LinkedList<MethodVariables> mVarList)
An OSR Map has following structure:
| regmap || mid, mpc, (n1, n2) ... || || mid, mpc, (n1, n2) ... ||Regmap indicates the value of which register is a reference, the execution state extractor can convert the value to an object to avoid confusing GC. The MSB of regmap indicates next mid is valid.
The MSB of mid indicates if the next mid item will be available.
The MSB of mpc indicates if the next is a valid pair
private void _generateMapForOneMethodVariable(ArrayList<Integer> tempOsrMaps, int regMapIndex, MethodVariables mVar, boolean lastMid)
tempOsrMaps
- the maps under constructionregMapIndex
- used to patch the register mapmVar
- the method variableslastMid
- private void processTuple(ArrayList<Integer> tempOsrMaps, LocalRegPair tuple, boolean isLast)
tuple, maps the local to register, spill isLast, indicates to set NEXT_BIT
public boolean hasOSRMap(Offset mcOffset)
public int getBytecodeIndexForMCOffset(Offset mcOffset)
public int getInlineEncodingForMCOffset(Offset mcOffset)
public int getRegisterMapForMCOffset(Offset mcOffset)
public OSRMapIterator getOsrMapIteratorForMCOffset(Offset mcOffset)
private int findOSREntry(Offset mcOffset)
private int getMCOffset(int entry)
private int getOSRMapIndex(int entry)
private int getBCIndex(int entry)
private int getIEIndex(int entry)
private void setMCOffset(int entry, int offset)
private void setOSRMapIndex(int entry, int index)
private void setBCIndex(int entry, int index)
private void setIEIndex(int entry, int index)
public void printMap()
public int[] getMCIndexes()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |