|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.FCFGBasicBlock
public class FCFGBasicBlock
FCFGBasicBlock
is a basic block structure for the Factored
Control Flow Graph (FCFG) representation. This representation is based on
a factored and implicit representation of exceptions. It is described
in detail in the paper
Efficient and Precise Modeling of Exceptions for the Analysis of Java Programs
by Choi, Grove, Hind and Sarkar.
Each FCFGBasicBlock
corresponds to a list of
consecutive instructions, such that:
FCFGBasicBlock
has a single entry point, a
single normal exit point and possibly many lateral
exits due to exceptions. As all the instructions a
FCFGBasicBlock
are protected by the same set of handlers
(in fact a list because the order the handlers are processed in is
important), these lateral exits can be kept once for the entire basic
block, hence the name factored.
Similar to BasicBlock
s, the only way of producing
FCFGBasicBlock
s is by using
FCFGBasicBlock.Factory
.
Nested Class Summary | |
---|---|
static class |
FCFGBasicBlock.Factory
Factory structure for generating FCFGBasicBlock
views of an HCode . |
Field Summary | |
---|---|
protected Quad |
first
|
protected List |
handler_bb
Successor BBs in the exceptional control flow. |
protected int |
id
|
protected Quad |
last
|
protected Set |
next_bb
Next BBs (according to the normal control flow). |
protected Set |
prev_bb
Previous BBs (according to the normal control flow). |
protected Set |
protected_bb
Predecessor BBs in the exceptional control flow. |
Constructor Summary | |
---|---|
protected |
FCFGBasicBlock(Quad q,
FCFGBasicBlock.Factory f)
Creates a FCFGBasicBlock . |
Method Summary | |
---|---|
void |
accept(BasicBlockInterfVisitor v)
Calls the appropriate visit method from
visitor . |
protected static void |
addExcpEdge(FCFGBasicBlock from,
FCFGBasicBlock to)
|
protected static void |
addNormalEdge(FCFGBasicBlock from,
FCFGBasicBlock to)
|
HCodeElement |
getFirst()
Returns the first instruction of this basic block. |
HCodeElement |
getLast()
Returns the last instruction of this basic block. |
List |
handlerList()
Returns the list of successor BBs in the exceptional control flow. |
Set |
nextSet()
Returns all the successors of the basic block, according to the normal and the exceptional control flow. |
Set |
normalNextSet()
Returns the set of predecessor BBs in the normal control flow. |
Set |
normalPrevSet()
Returns the set of successor BBs in the normal control flow. |
Set |
prevSet()
Returns all the predecessors of the basic block, according to the normal and the exceptional control flow. |
Set |
protectedSet()
Returns the set of predecessor BBs in the exceptional control flow. |
List |
statements()
Returns the list of the statements composing the basic block. |
String |
toString()
Returns a string identifying this
FCFGBasicBlock . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int id
protected Set next_bb
protected Set prev_bb
protected Set protected_bb
protected List handler_bb
protected Quad first
protected Quad last
Constructor Detail |
---|
protected FCFGBasicBlock(Quad q, FCFGBasicBlock.Factory f)
FCFGBasicBlock
. This method is called
only by the FCFGBasicBlock.Factory
.
Method Detail |
---|
public HCodeElement getFirst()
this
basic block.
getFirst
in interface BasicBlockInterf
public HCodeElement getLast()
this
basic block.
getLast
in interface BasicBlockInterf
public Set normalNextSet()
public Set normalPrevSet()
protected static void addNormalEdge(FCFGBasicBlock from, FCFGBasicBlock to)
public Set protectedSet()
HANDLER
instruction, this is the set of basic
blocks whose instructions are protected by that
handler. FOOTER
is the default handler: the
uncaught exceptions are sent to the caller. For any other
basic block, this set is empty.
public List handlerList()
FOOTER
is the default
handler: the uncaught exceptions are sent to the caller.
The order of the handlers in the list is the order in which the
JVM tries to find an appropriate handler.
public Set prevSet()
prevSet
in interface BasicBlockInterf
public Set nextSet()
nextSet
in interface BasicBlockInterf
protected static void addExcpEdge(FCFGBasicBlock from, FCFGBasicBlock to)
public List statements()
BasicBlockInterf
statements
in interface BasicBlockInterf
public void accept(BasicBlockInterfVisitor v)
BasicBlockInterf
visit
method from
visitor
. The concept of
BasicBlockInterfVisitor
is similar to the concept
of QuadVisitor
. Both of them were introduced to
allow pure object oriented programming, that is virtual
methods instead of instanceof
tests.
accept
in interface BasicBlockInterf
public String toString()
this
FCFGBasicBlock
. All the
FCFGBasicBlock
s generated for a given method have
different string representations.
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |