Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

CFG Class Reference

List of all members.

Public Methods

 CFG (method_info m)
boolean jimplify (cp_info constant_pool[], int this_class, JimpleBody listBody)
Instruction reconstructInstructions ()

Private Methods

void adjustExceptionTable ()
void arrangeclonedBBinorder ()
void buildCFG ()
void buildJsrRetPairs ()
Type byteCodeTypeOf (Type type)
BasicBlock cloneJsrTargetBB (BasicBlock lowestBB, BasicBlock highestBB) throws java.lang.CloneNotSupportedException
void confirmRefType (Type actualType)
void confirmType (Type actualType, Type requiredType)
void fixupJsrRets ()
void fixupTargets ()
void generateJimple (Instruction ins, TypeStack typeStack, TypeStack postTypeStack, cp_info constant_pool[], List statements, BasicBlock basicBlock)
void generateJimpleForCPEntry (cp_info constant_pool[], int i, TypeStack typeStack, TypeStack postTypeStack, SootMethod jmethod, List statements)
String getClassName (cp_info[] constant_pool, int index)
BasicBlock getEndOfBBList ()
Type jimpleReturnTypeOfInterfaceMethodRef (SootClassManager cm, cp_info[] constant_pool, int index)
Type jimpleReturnTypeOfMethodRef (SootClassManager cm, cp_info[] constant_pool, int index)
void jimpleTargetFixup ()
Type jimpleTypeOfAtype (int atype)
Type jimpleTypeOfFieldInFieldRef (SootClassManager cm, cp_info[] constant_pool, int index)
void jimplify (cp_info constant_pool[], int this_class)
void JsrEliminate ()
TypeStack popSafe (TypeStack typeStack, Type requiredType)
TypeStack popSafeArrayType (TypeStack typeStack)
TypeStack popSafeRefType (TypeStack typeStack)
void prepareForGC ()
OutFlow processCPEntry (cp_info constant_pool[], int i, TypeStack typeStack, SootMethod jmethod)
OutFlow processFlow (Instruction ins, TypeStack typeStack, cp_info[] constant_pool)
void processTargetFixup (BBQ bbq)
void setHighestBlock (BasicBlock highestBB) throws java.lang.CloneNotSupportedException
TypeStack smartPush (TypeStack typeStack, Type type)
int typeSize (Type type)

Static Private Methods

Instruction buildBasicBlock (Instruction head)

Private Attributes

method_info method
BasicBlock cfg
java util Hashtable h
int bbcount
StmtList stmtList
JimpleBody listBody
Map instructionToFirstStmt
Map instructionToLastStmt
SootMethod jmethod
SootClassManager cm
Map instructionToNext
Instruction firstInstruction
short wide
HashMap JsrToNext = new HashMap()
HashMap RetToJsr = new HashMap()
HashMap RetToJsrBB = new HashMap()
HashMap RetToOrigJsr = new HashMap()
HashMap RetToOrigJsrBB = new HashMap()
HashMap RetToOrigRetBB = new HashMap()
HashMap RetToRetBB = new HashMap()
HashMap RetToJsrSucc = new HashMap()
HashMap RetToOrigJsrSucc = new HashMap()
BasicBlock endofBBList
BasicBlock highestBlock
HashMap clonedstmtsHT = new HashMap()
Map clonedHT = new HashMap()
BasicBlock orighighestBlock
HashMap replacedinstructionHT = new HashMap(6, 0.7f)

Detailed Description

A Control Flow Graph.
Author:
Clark Verbrugge
See also:
BasicBlock , ClassFile::parse

Definition at line 160 of file CFG.java.


Constructor & Destructor Documentation

CFG::CFG method_info   m [inline]
 

Constructs a new control flow graph for the given method.

Parameters:
m   the method in question.
See also:
method_info , ClassFile@parse

Definition at line 241 of file CFG.java.


Member Function Documentation

void CFG::jimpleTargetFixup   [inline, private]
 

After the initial jimple construction, a second pass is made to fix up missing Stmt targets for gotos, if's etc.

Parameters:
c   code attribute of this method.
See also:
CFG::jimplify

Definition at line 2988 of file CFG.java.

Referenced by jimplify().

boolean CFG::jimplify cp_info   constant_pool[],
int   this_class,
JimpleBody   listBody
[inline]
 

Main entry point for converting list of Instructions to Jimple statements; performs flow analysis, constructs Jimple statements, and fixes jumps.

Parameters:
constant_pool   constant pool of ClassFile.
this_class   constant pool index of the CONSTANT_Class_info object for this' class.
Returns:
true if all ok, false if there was an error.
See also:
CFG::jimplify(cp_info[], int, boolean) , Stmt , BasicBlock::jhead

Definition at line 3546 of file CFG.java.

void CFG::jimplify cp_info   constant_pool[],
int   this_class
[inline, private]
 

Main entry point for converting list of Instructions to Jimple statements; performs flow analysis, constructs Jimple statements, and fixes jumps.

Parameters:
constant_pool   constant pool of ClassFile.
this_class   constant pool index of the CONSTANT_Class_info object for this' class.
clearStacks   if true semantic stacks will be deleted after the process is complete.
Returns:
true if all ok, false if there was an error.
See also:
CFG::jimplify(cp_info[], int) , Stmt , BasicBlock::jhead , BasicBlock::sout

Definition at line 3088 of file CFG.java.

Referenced by jimplify().

void CFG::processTargetFixup BBQ   bbq [inline, private]
 

Runs through the given bbq contents performing the target fix-up pass; Requires all reachable blocks to have their done flags set to true, and this resets them all back to false;

Parameters:
bbq   queue of BasicBlocks to process.
See also:
jimpleTargetFixup

Definition at line 4925 of file CFG.java.

Referenced by jimpleTargetFixup().

Instruction CFG::reconstructInstructions   [inline]
 

Reconstructs the instruction stream by appending the Instruction lists associated with each basic block.

Note that this joins up the basic block Instruction lists, and so they will no longer end with null after this.

Returns:
the head of the list of instructions.
See also:
BasicBlock::head , BasicBlock::tail

Definition at line 5021 of file CFG.java.


Member Data Documentation

BasicBlock CFG::cfg [private]
 

Ordered list of BasicBlocks comprising the code of this CFG.

See also:
BasicBlock

Definition at line 169 of file CFG.java.

java util Hashtable CFG::h [private]
 

For associating Instruction leaders with basic blocks.

Definition at line 171 of file CFG.java.

method_info CFG::method [private]
 

Method for which this is a control flow graph.

See also:
method_info

Definition at line 165 of file CFG.java.


The documentation for this class was generated from the following file:
Generated at Thu Feb 7 07:06:01 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001