|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.BasicBlock<HCE>
public class BasicBlock<HCE extends HCodeElement>
BasicBlock collects a sequence of operations. It is designed to abstract away specific operation and allow the compiler to focus on control flow at a higher level. (It also allows for some analysis within the block to operate more efficiently by taking advantage of the fact that the elements of a BasicBlock have a total ordering of execution).
Most BasicBlocks are a part of a larger piece of code, and thus a collection of BasicBlocks form a Control Flow Graph (where the nodes of the graph are the blocks and the directed edges of the graph indicate when one block is succeeded by another block).
Make sure to look at BasicBlock.Factory
, since it
acts as the central core for creating and keeping track of the
BasicBlock
s for a given HCode
.
NOTE: right now BasicBlock
only guarantees
that it preserves the Maximal Basic Block property (where each
block is the longest sequence of instructions such that only the
first instruction may have more than one entry and only the last
instruction may have more than one exit) if the graph of operations
is not modified while the basic block is in use. For that matter,
some methods of BasicBlock may implicitly rely on the intermediate
representation not changing while the blocks are in use. However,
most but not all Intermediate Representations in the Flex
Compiler are immutable. Therefore compilation passes modifying the
intermediate representation must reconstruct the BasicBlocks for
that intermediate representation if they wish to perform a second
analysis pass.
Nested Class Summary | |
---|---|
static class |
BasicBlock.Factory<HCE extends HCodeElement>
Factory structure for generating BasicBlock views of an HCode . |
Constructor Summary | |
---|---|
protected |
BasicBlock(HCE h,
BasicBlock.Factory f)
Constructs a new BasicBlock with h as its first
element. |
Method Summary | |
---|---|
void |
accept(BasicBlockInterfVisitor v)
Accept a visitor. |
String |
dumpElems()
Returns a String composed of the statements comprising this . |
HCE |
getFirst()
Deprecated. Use the standard List view provided by statements() instead |
HCE |
getLast()
Deprecated. Use the standard List view provided by statements() instead |
Enumeration<BasicBlock<HCE>> |
next()
Deprecated. Use nextSet() instead |
int |
nextLength()
Deprecated. Use nextSet() instead |
Set<BasicBlock<HCE>> |
nextSet()
Returns all the successors of this . |
Enumeration<BasicBlock<HCE>> |
prev()
Deprecated. Use prevSet() instead |
int |
prevLength()
Deprecated. Use prevSet() instead |
Set<BasicBlock<HCE>> |
prevSet()
Returns all the predecessors of this . |
List<HCE> |
statements()
Returns an unmodifiable List for the
HCodeElement s within this . |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected BasicBlock(HCE h, BasicBlock.Factory f)
h
as its first
element. Meant to be used only during construction.
Method Detail |
---|
public HCE getFirst()
HCodeElement
in the sequence.
getFirst
in interface BasicBlockInterf<HCE extends HCodeElement,BasicBlock<HCE extends HCodeElement>>
statements()
public HCE getLast()
HCodeElement
in the sequence.
getLast
in interface BasicBlockInterf<HCE extends HCodeElement,BasicBlock<HCE extends HCodeElement>>
statements()
public int prevLength()
this
.
prevSet()
public int nextLength()
this
.
nextSet()
public Enumeration<BasicBlock<HCE>> prev()
this
.
prevSet()
public Enumeration<BasicBlock<HCE>> next()
this
.
prevSet()
public Set<BasicBlock<HCE>> prevSet()
this
.
Set
of
BasicBlock
s which precede
this
.
prevSet
in interface BasicBlockInterf<HCE extends HCodeElement,BasicBlock<HCE extends HCodeElement>>
public Set<BasicBlock<HCE>> nextSet()
this
.
Set
of
BasicBlock
s which succeed
this
.
nextSet
in interface BasicBlockInterf<HCE extends HCodeElement,BasicBlock<HCE extends HCodeElement>>
public List<HCE> statements()
List
for the
HCodeElement
s within this
.
List
of
HCodeElement
s ordered according to the order
mandated by the CFGrapher
used in the call to
computeBasicBlocks
that generated
this
.
statements
in interface BasicBlockInterf<HCE extends HCodeElement,BasicBlock<HCE extends HCodeElement>>
public void accept(BasicBlockInterfVisitor v)
accept
in interface BasicBlockInterf<HCE extends HCodeElement,BasicBlock<HCE extends HCodeElement>>
public String toString()
toString
in class Object
public String dumpElems()
this
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |