Package jminusminus
Class NBasicBlock
java.lang.Object
jminusminus.NBasicBlock
Representation of a block within a control flow graph.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionbooleanIs this block active?intNumber of backward branches to this block.The control flow graph (cfg) that this block belongs to.The dominator of this block.intNumber of forward branches to this block.List of high-level (HIR) instructions in this block.intUnique identifier of ths block.booleanIs this block a loop head?booleanIs this block a loop tail?List of low-level (LIR) instructions in this block.All virtual registers locally defined within this block.All virtual registers live in the block.All virtual registers live outside the block.All virtual registers used before definition within this block.int[]The state array for this block that maps local variable index to the HIR instruction that last affected it.intDepth of a loop.intIndex of a loop.List of predecessor blocks.intRef count of this block.List of successor blocks.List of tuples in this block.booleanHas this block been visited?
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanequals(NBasicBlock other) Returns true if this block and other have the same id, and false otherwise.intReturns the instruction identifier for the first LIR instruction, or -1.getInstruction(int id) Returns the LIR instruction with the given id, or null.intReturns the instruction identifier for the last LIR instruction, or -1.id()Returns a string identifier of this block.booleanidIsFree(int id) Returns true if there is no LIR instruction with the given id, and false otherwise.voidinsertLIRInst(NLIRInstruction inst) Inserts the given LIR instruction at the appropriate place in this block's lir array based on its id -- preserving order by id.toString()Returns a string representation of this block.voidWrites the HIR instructions in this block to standard output.voidWrites the LIR instructions in this block to standard output.voidWrites the tuples in this block to standard output.
- 
Field Details- 
cfgThe control flow graph (cfg) that this block belongs to.
- 
idpublic int idUnique identifier of ths block.
- 
tuplesList of tuples in this block.
- 
predecessorsList of predecessor blocks.
- 
successorsList of successor blocks.
- 
hirList of high-level (HIR) instructions in this block.
- 
lirList of low-level (LIR) instructions in this block.
- 
localspublic int[] localsThe state array for this block that maps local variable index to the HIR instruction that last affected it.
- 
visitedpublic boolean visitedHas this block been visited?
- 
activepublic boolean activeIs this block active?
- 
isLoopHeadpublic boolean isLoopHeadIs this block a loop head?
- 
isLoopTailpublic boolean isLoopTailIs this block a loop tail?
- 
loopIndexpublic int loopIndexIndex of a loop.
- 
loopDepthpublic int loopDepthDepth of a loop.
- 
fwdBranchespublic int fwdBranchesNumber of forward branches to this block.
- 
bwdBranchespublic int bwdBranchesNumber of backward branches to this block.
- 
refpublic int refRef count of this block.
- 
domThe dominator of this block.
- 
liveDefAll virtual registers locally defined within this block.
- 
liveUseAll virtual registers used before definition within this block.
- 
liveInAll virtual registers live in the block.
- 
liveOutAll virtual registers live outside the block.
 
- 
- 
Constructor Details- 
NBasicBlockConstructs a basic block.- Parameters:
- cfg- the cfg containing this block.
- id- id of the block.
 
 
- 
- 
Method Details- 
idReturns a string identifier of this block.- Returns:
- a string identifier of this block.
 
- 
equalsReturns true if this block and other have the same id, and false otherwise.- Parameters:
- other- the other block.
- Returns:
- true if this block and other have the same id, and false otherwise.
 
- 
toStringReturns a string representation of this block.
- 
writeTuplesToStdOutWrites the tuples in this block to standard output.- Parameters:
- p- for pretty printing with indentation.
 
- 
writeHirToStdOutWrites the HIR instructions in this block to standard output.- Parameters:
- p- for pretty printing with indentation.
 
- 
writeLirToStdOutWrites the LIR instructions in this block to standard output.- Parameters:
- p- for pretty printing with indentation.
 
- 
getFirstLIRInstIdpublic int getFirstLIRInstId()Returns the instruction identifier for the first LIR instruction, or -1.- Returns:
- the instruction identifier for the first LIR instruction, or -1.
 
- 
getLastLIRInstIdpublic int getLastLIRInstId()Returns the instruction identifier for the last LIR instruction, or -1.- Returns:
- the instruction identifier for the last LIR instruction, or -1.
 
- 
getInstructionReturns the LIR instruction with the given id, or null.- Parameters:
- id- the id to look for.
- Returns:
- the LIR instruction with the given id, or null.
 
- 
idIsFreepublic boolean idIsFree(int id) Returns true if there is no LIR instruction with the given id, and false otherwise.- Parameters:
- id- the id to check for.
- Returns:
- true if there is no LIR instruction with the given id, and false otherwise.
 
- 
insertLIRInstInserts the given LIR instruction at the appropriate place in this block's lir array based on its id -- preserving order by id.- Parameters:
- inst- the LIR instruction to be inserted.
 
 
-