|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.baseline.BuildBB
final class BuildBB
Analyze the byte codes and determine the boundaries of the basic blocks. Used for building the reference maps for a method.
Nested Class Summary | |
---|---|
private static class |
BuildBB.InstructionType
Types of Instructions |
Field Summary | |
---|---|
BasicBlock[] |
basicBlocks
|
BasicBlockFactory |
bbf
basic blocks of the byte code |
(package private) int |
bytelength
|
short[] |
byteToBlockMap
identify which block a byte is part of |
int |
gcPointCount
Number of GC points found |
int |
numJsrs
Number of unique jsr targets processed |
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 | |
---|---|
BuildBB()
|
Method Summary | |
---|---|
private void |
addBasicBlock(BasicBlock newBB)
add a basic block to the list |
void |
determineTheBasicBlocks(NormalMethod method)
Analyze the bytecodes and build the basic blocks with their predecessors. |
private void |
findAndSetJSRCallSite(int pred,
BasicBlock retBB,
int otherRetCount,
boolean[] seenAlready)
scan back from ret instruction to jsr call sites |
private void |
markTryBlocks(ExceptionHandlerMap exceptions)
Mark all the blocks within try range as being Try blocks used for determining the stack maps for Handler blocks Only called when exceptions is not null. |
private void |
processAthrow(ExceptionHandlerMap exceptions,
int athrowIndex)
Check if an athrow is within a try block, if it is, then handlers have this block as their predecessor; which is registered in "processExceptionHandlers" Otherwise, the athrow acts as a branch to the exit and that should be marked here. |
private void |
processBackwardBranch(int index,
int branchtarget)
A backwards branch has been found from the byte code at location "index" to a target location of "branchtarget". |
private void |
processBranchTarget(int index,
int branchtarget)
Processing a branch that appears at location index in the byte code and has a target index of branchtarget in the byte code. |
private void |
processExceptionHandlers(ExceptionHandlerMap exceptions)
For every handler, mark the blocks in its try block as its predecessors. |
private void |
processRetList(int[] retList,
int nextRetList)
process the effect of the ret instructions on the precedance table |
private void |
setupHandlerBBs(ExceptionHandlerMap exceptions)
For every handler, make a block that starts with the handler PC Only called when exceptions is not null. |
private void |
setupJSRCallSite(BasicBlock entryBB,
BasicBlock retBB)
setup jsr call site |
private void |
setupTryStartBBs(ExceptionHandlerMap exceptions)
For every try start, make a block that starts with the Try start, mark it as a try start. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public BasicBlockFactory bbf
public BasicBlock[] basicBlocks
public short[] byteToBlockMap
public int numJsrs
public int gcPointCount
int bytelength
Constructor Detail |
---|
BuildBB()
Method Detail |
---|
public void determineTheBasicBlocks(NormalMethod method)
private void processBranchTarget(int index, int branchtarget)
private void processBackwardBranch(int index, int branchtarget)
private void processRetList(int[] retList, int nextRetList)
private void findAndSetJSRCallSite(int pred, BasicBlock retBB, int otherRetCount, boolean[] seenAlready)
private void setupJSRCallSite(BasicBlock entryBB, BasicBlock retBB)
private void setupHandlerBBs(ExceptionHandlerMap exceptions)
private void setupTryStartBBs(ExceptionHandlerMap exceptions)
private void processExceptionHandlers(ExceptionHandlerMap exceptions)
private void markTryBlocks(ExceptionHandlerMap exceptions)
private void processAthrow(ExceptionHandlerMap exceptions, int athrowIndex)
private void addBasicBlock(BasicBlock newBB)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |