Modifier and Type | Class and Description |
---|---|
private static class |
BuildBB.InstructionType
Types of Instructions
|
Modifier and Type | Field and Description |
---|---|
(package private) BasicBlock[] |
basicBlocks |
(package private) BasicBlockFactory |
bbf
basic blocks of the byte code
|
(package private) int |
bytelength |
(package private) short[] |
byteToBlockMap
identify which block a byte is part of
|
(package private) int |
gcPointCount
Number of GC points found
|
(package private) int |
numJsrs
Number of unique jsr targets processed
|
Constructor and Description |
---|
BuildBB(NormalMethod method)
Analyzes the bytecodes and builds the basic blocks with their predecessors.
|
Modifier and Type | Method and Description |
---|---|
private void |
addBasicBlock(BasicBlock newBB)
Adds a basic block.
|
private void |
findAndSetJSRCallSite(int pred,
BasicBlock retBB,
int otherRetCount,
boolean[] seenAlready)
Scans 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)
Does the setup for a 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.
|
final BasicBlockFactory bbf
BasicBlock[] basicBlocks
short[] byteToBlockMap
int numJsrs
int gcPointCount
int bytelength
BuildBB(NormalMethod method)
method
- the method whose bytecodes will be analyzedprivate void processBranchTarget(int index, int branchtarget)
index
- the byte index of the branch instructionbranchtarget
- the target byte indexprivate void processBackwardBranch(int index, int branchtarget)
index
- the byte index of the branch instructionbranchtarget
- the target byte indexprivate void processRetList(int[] retList, int nextRetList)
retList
- a list of basic blocks with return instructions. Each block
is represented by its basic block number.nextRetList
- maximum index in the listprivate void findAndSetJSRCallSite(int pred, BasicBlock retBB, int otherRetCount, boolean[] seenAlready)
pred
- the basic block number of the predecessor blockretBB
- the basic block that contains the returnotherRetCount
- the number of other returns (i.e. non-matching)
returns that were found on the pathseenAlready
- list of blocks that have already been seenprivate void setupJSRCallSite(BasicBlock entryBB, BasicBlock retBB)
entryBB
- a basic block with a jsr entryretBB
- a basic block with a matching returnprivate void setupHandlerBBs(ExceptionHandlerMap exceptions)
exceptions
- exception handler informationprivate void setupTryStartBBs(ExceptionHandlerMap exceptions)
exceptions
- exception handler informationprivate void processExceptionHandlers(ExceptionHandlerMap exceptions)
exceptions
- exception handler informationprivate void markTryBlocks(ExceptionHandlerMap exceptions)
exceptions
- exception handler informationprivate void processAthrow(ExceptionHandlerMap exceptions, int athrowIndex)
exceptions
- exception handler informationathrowIndex
- byte index of the athrowprivate void addBasicBlock(BasicBlock newBB)
newBB
- the block to add