|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.runtimesupport.OptMachineCodeMap
public final class OptMachineCodeMap
A class that encapsulates mapping information about generated machine code. Since there will be an instance of this class with every OptCompiledMethod, we attempt to pack the data into a reasonably small number of bits.
The supported functions are:
Note: This file contains two types of methods
Field Summary | |
---|---|
private static int |
BCI_MASK
|
private static int |
BCI_SHIFT
|
private static int |
BIG_BCI_IDX_ADJ
|
private static int |
BIG_BCI_MASK
|
private static int |
BIG_BCI_SHIFT
|
private static int |
BIG_CALL_IDX_ADJ
|
private static int |
BIG_CALL_MASK
|
private static int |
BIG_CALL_SHIFT
|
private static int |
BIG_GCI_IDX_ADJ
|
private static int |
BIG_GCI_MASK
|
private static int |
BIG_GCI_SHIFT
|
private static int |
BIG_IEI_IDX_ADJ
|
private static int |
BIG_IEI_MASK
|
private static int |
BIG_IEI_SHIFT
|
private static int |
BIG_INVALID_BCI
|
private static int |
BIG_INVALID_GCI
|
private static int |
BIG_INVALID_IEI
|
private static int |
BIG_OFFSET_IDX_ADJ
|
private static int |
BIG_OFFSET_MASK
|
private static int |
BIG_OFFSET_SHIFT
|
private static int |
CALL_MASK
|
private static int |
CALL_SHIFT
|
private static OptMachineCodeMap |
emptyMachineCodeMap
A machine code map when no information is present |
private static int |
GCI_MASK
|
private static int |
GCI_SHIFT
|
private int[] |
gcMaps
array of GC maps as defined by OptGCMap |
private static int |
HUGE_BCI_IDX_ADJ
|
private static int |
HUGE_BCI_MASK
|
private static int |
HUGE_BCI_SHIFT
|
private static int |
HUGE_CALL_IDX_ADJ
|
private static int |
HUGE_CALL_MASK
|
private static int |
HUGE_CALL_SHIFT
|
private static int |
HUGE_GCI_IDX_ADJ
|
private static int |
HUGE_GCI_MASK
|
private static int |
HUGE_GCI_SHIFT
|
private static int |
HUGE_IEI_IDX_ADJ
|
private static int |
HUGE_IEI_MASK
|
private static int |
HUGE_IEI_SHIFT
|
private static int |
HUGE_INVALID_BCI
|
private static int |
HUGE_INVALID_GCI
|
private static int |
HUGE_INVALID_IEI
|
private static int |
HUGE_OFFSET_IDX_ADJ
|
private static int |
HUGE_OFFSET_MASK
|
private static int |
HUGE_OFFSET_SHIFT
|
private static int |
IEI_MASK
|
private static int |
IEI_SHIFT
|
int[] |
inlineEncoding
encoded data as defined by OptEncodedCallSiteTree. |
private static int |
INVALID_BCI
|
private static int |
INVALID_GCI
|
private static int |
INVALID_IEI
|
private static int |
IS_GUARDED_CALL
|
private static int |
IS_UNGUARDED_CALL
|
private int[] |
MCInformation
Hold entries as defined by the constants above. |
private static int |
OFFSET_MASK
|
private static int |
OFFSET_SHIFT
|
private static int |
SIZEOF_BIG_ENTRY
|
private static int |
SIZEOF_ENTRY
|
private static int |
SIZEOF_HUGE_ENTRY
|
private static int |
START_BITS
|
private static int |
START_OF_BIG_ENTRY
|
private static int |
START_OF_ENTRY
|
private static int |
START_OF_HUGE_ENTRY
|
private static int |
totalMapSize
|
private static int |
totalMCSize
Running totals for the size of machine code and maps |
private static TypeReference |
TYPE
|
Fields inherited from interface org.jikesrvm.Constants |
---|
NOT_REACHED, REFLECTION_FPRS_BITS, REFLECTION_FPRS_MASK, REFLECTION_GPRS_BITS, REFLECTION_GPRS_MASK |
Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants |
---|
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK |
Fields inherited from interface org.jikesrvm.objectmodel.TIBLayoutConstants |
---|
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX |
Fields inherited from interface org.jikesrvm.HeapLayoutConstants |
---|
BAD_MAP_COMPRESSION, BOOT_IMAGE_CODE_END, BOOT_IMAGE_CODE_SIZE, BOOT_IMAGE_CODE_START, BOOT_IMAGE_DATA_END, BOOT_IMAGE_DATA_SIZE, BOOT_IMAGE_DATA_START, BOOT_IMAGE_END, BOOT_IMAGE_RMAP_END, BOOT_IMAGE_RMAP_START, MAX_BOOT_IMAGE_RMAP_SIZE, MAXIMUM_MAPPABLE |
Fields inherited from interface org.jikesrvm.compilers.opt.driver.OptConstants |
---|
EPILOGUE_BCI, EPILOGUE_BLOCK_BCI, EXTANT_ANALYSIS_BCI, INSTRUMENTATION_BCI, MAYBE, METHOD_COUNTER_BCI, NO, OSR_PROLOGUE, PROLOGUE_BCI, PROLOGUE_BLOCK_BCI, RECTIFY_BCI, RUNTIME_SERVICES_BCI, SSA_SYNTH_BCI, SYNCHRONIZED_MONITORENTER_BCI, SYNCHRONIZED_MONITOREXIT_BCI, SYNTH_CATCH_BCI, SYNTH_LOOP_VERSIONING_BCI, UNKNOWN_BCI, YES |
Constructor Summary | |
---|---|
private |
OptMachineCodeMap()
Private constructor for no information. |
private |
OptMachineCodeMap(int[] _MCInformation,
int[] _gcMaps,
int[] _inlineEncoding)
Private constructor, object should be created via create |
Method Summary | |
---|---|
(package private) static OptMachineCodeMap |
create(IR ir,
int machineCodeSize)
Create the map, called during compilation |
void |
dumpMCInformation(boolean DUMP_MAPS)
|
int |
findGCMapIndex(Offset MCOffset)
This method searches for the GC map corresponding to the passed machine code offset. |
private int |
findMCEntry(Offset MCOffset)
Do a binary search of the machine code maps to find the index in MCInformation where the entry for the argument machine code offset starts. |
int |
gcMapInformation(int index)
Returns the GC map information for the GC map information entry passed |
private static OptMachineCodeMap |
generateMCInformation(GCIRMap irMap,
boolean DUMP_MAPS)
This method walks the IR map, and for each entry it creates the machine code mapping information for the entry. |
private int |
getBytecodeIndex(int entry)
Returns the Bytecode index for the entry passed |
int |
getBytecodeIndexForMCOffset(Offset MCOffset)
Get the bytecode index for a machine instruction offset. |
private int |
getCallInfo(int entry)
Returns the call info for the entry passed. |
private int |
getGCMapIndex(int entry)
Returns the GC map index for the entry passed |
int |
getInlineEncodingForMCOffset(Offset MCOffset)
Return the inlining encoding index for the machine instruction offset. |
private int |
getInlineEncodingIndex(int entry)
Returns the inline encoding index for the entry passed. |
private int |
getMCOffset(int entry)
Returns the MCOffset for the entry passed |
NormalMethod |
getMethodForMCOffset(Offset MCOffset)
Get the RVMMethod for a machine instruction offset. |
ArrayList<CallSite> |
getNonInlinedCallSites()
|
boolean |
hasInlinedEdge(RVMMethod caller,
int bcIndex,
RVMMethod callee)
This method searches the machine code maps and determines if the given call edge is definitely inlined into the method. |
private boolean |
isBigEntry(int entry)
Is the entry a big entry? |
private boolean |
isHugeEntry(int entry)
Is the entry a big entry? |
private int |
nextEntry(int entry)
|
int |
nextLocation(int currentIndex)
|
private void |
printMCInformationEntry(int entry,
boolean DUMP_MAPS)
Prints the MCInformation for this entry |
private void |
recordStats(RVMMethod method,
int mapSize,
int machineCodeSize,
boolean DUMP_MAP_SIZES)
Gather cumulative stats about the space consumed by maps. |
boolean |
registerIsSet(int entry,
int registerNumber)
Determines if the register map information for the entry passed is true |
(package private) int |
size()
Total bytes of machine code maps |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int START_OF_ENTRY
private static final int START_OF_BIG_ENTRY
private static final int START_OF_HUGE_ENTRY
private static final int START_BITS
private static final int CALL_MASK
private static final int CALL_SHIFT
private static final int BCI_MASK
private static final int BCI_SHIFT
private static final int IEI_MASK
private static final int IEI_SHIFT
private static final int GCI_MASK
private static final int GCI_SHIFT
private static final int OFFSET_MASK
private static final int OFFSET_SHIFT
private static final int INVALID_GCI
private static final int INVALID_BCI
private static final int INVALID_IEI
private static final int SIZEOF_ENTRY
private static final int BIG_CALL_MASK
private static final int BIG_CALL_SHIFT
private static final int BIG_CALL_IDX_ADJ
private static final int BIG_BCI_MASK
private static final int BIG_BCI_SHIFT
private static final int BIG_BCI_IDX_ADJ
private static final int BIG_IEI_MASK
private static final int BIG_IEI_SHIFT
private static final int BIG_IEI_IDX_ADJ
private static final int BIG_GCI_MASK
private static final int BIG_GCI_SHIFT
private static final int BIG_GCI_IDX_ADJ
private static final int BIG_OFFSET_MASK
private static final int BIG_OFFSET_SHIFT
private static final int BIG_OFFSET_IDX_ADJ
private static final int BIG_INVALID_GCI
private static final int BIG_INVALID_BCI
private static final int BIG_INVALID_IEI
private static final int SIZEOF_BIG_ENTRY
private static final int HUGE_CALL_MASK
private static final int HUGE_CALL_SHIFT
private static final int HUGE_CALL_IDX_ADJ
private static final int HUGE_BCI_MASK
private static final int HUGE_BCI_SHIFT
private static final int HUGE_BCI_IDX_ADJ
private static final int HUGE_IEI_MASK
private static final int HUGE_IEI_SHIFT
private static final int HUGE_IEI_IDX_ADJ
private static final int HUGE_GCI_MASK
private static final int HUGE_GCI_SHIFT
private static final int HUGE_GCI_IDX_ADJ
private static final int HUGE_OFFSET_MASK
private static final int HUGE_OFFSET_SHIFT
private static final int HUGE_OFFSET_IDX_ADJ
private static final int HUGE_INVALID_GCI
private static final int HUGE_INVALID_BCI
private static final int HUGE_INVALID_IEI
private static final int SIZEOF_HUGE_ENTRY
private static final int IS_UNGUARDED_CALL
private static final int IS_GUARDED_CALL
private final int[] MCInformation
private final int[] gcMaps
public final int[] inlineEncoding
private static int totalMCSize
private static int totalMapSize
private static final OptMachineCodeMap emptyMachineCodeMap
private static final TypeReference TYPE
Constructor Detail |
---|
private OptMachineCodeMap(int[] _MCInformation, int[] _gcMaps, int[] _inlineEncoding)
private OptMachineCodeMap()
Method Detail |
---|
static OptMachineCodeMap create(IR ir, int machineCodeSize)
ir
- the ir object for this methodmachineCodeSize
- the number of machine code instructions generated.public int getBytecodeIndexForMCOffset(Offset MCOffset)
MCOffset
- the machine code offset of interest
public NormalMethod getMethodForMCOffset(Offset MCOffset)
MCOffset
- the machine code offset of interest
null
if unknownpublic int getInlineEncodingForMCOffset(Offset MCOffset)
MCOffset
- the machine code offset of interest
public int findGCMapIndex(Offset MCOffset)
MCOffset
- the machine code offset to look for
public ArrayList<CallSite> getNonInlinedCallSites()
public boolean hasInlinedEdge(RVMMethod caller, int bcIndex, RVMMethod callee)
caller
- caller RVMMethodbcIndex
- bytecode index of the caller methodcallee
- callee RVMMethod
true
if the call edge is definitely inlined in this compiled method.public int gcMapInformation(int index)
index
- GCmap entrypublic boolean registerIsSet(int entry, int registerNumber)
entry
- map entryregisterNumber
- the register numberpublic int nextLocation(int currentIndex)
private int findMCEntry(Offset MCOffset)
MCOffset
- the machine code offset of interestprivate int nextEntry(int entry)
private static OptMachineCodeMap generateMCInformation(GCIRMap irMap, boolean DUMP_MAPS)
irMap
- the irmap to translate fromDUMP_MAPS
- dump while we workprivate int getMCOffset(int entry)
entry
- the index of the start of the entry
private int getGCMapIndex(int entry)
entry
- the index of the start of the entry
private int getBytecodeIndex(int entry)
entry
- the index of the start of the entry
private int getInlineEncodingIndex(int entry)
entry
- the index of the start of the entry
private int getCallInfo(int entry)
entry
- the index of the start of the entry
private boolean isBigEntry(int entry)
private boolean isHugeEntry(int entry)
public void dumpMCInformation(boolean DUMP_MAPS)
private void printMCInformationEntry(int entry, boolean DUMP_MAPS)
entry
- the entry to printprivate void recordStats(RVMMethod method, int mapSize, int machineCodeSize, boolean DUMP_MAP_SIZES)
method
- mapSize
- machineCodeSize
- DUMP_MAP_SIZES
- int size()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |