Java Doc for FlowGraph.java in  » Database-DBMS » db4o-6.4 » EDU » purdue » cs » bloat » cfg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db4o 6.4 » EDU.purdue.cs.bloat.cfg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   EDU.purdue.cs.bloat.util.Graph
      EDU.purdue.cs.bloat.cfg.FlowGraph

FlowGraph
public class FlowGraph extends Graph (Code)
FlowGraph constructs and represents a Control Flow Graph (CFG) used for analyzing a method. It consists of the basic blocks of a method.


See Also:   MethodEditor
See Also:   Block


Inner Class :class LoopNode extends GraphNode

Field Summary
public static  booleanDB_GRAPHS
    
public static  booleanDEBUG
    
final public static  intPEEL_ALL_LOOPS
    
public static  intPEEL_LOOPS_LEVEL
    
final public static  intPEEL_NO_LOOPS
    
public static  booleanPRINT_GRAPH
    
 ListcatchBlocks
    
 intdomEdgeModCount
    
 intfile
    
 Maphandlers
    
 BlockiniBlock
    
 intloopEdgeModCount
    
 GraphloopTree
    
 intmaxLoopDepth
    
 MethodEditormethod
    
 intnext
    
 BlocksnkBlock
    
 BlocksrcBlock
    
 Mapsubroutines
    
 Listtrace
    

Constructor Summary
public  FlowGraph(MethodEditor method)
     Constructor.

Method Summary
public  voidaddEdge(GraphNode src, GraphNode dst)
     Adds an edge between two nodes in this graph.
public  intblockType(Block block)
     Returns the type of a given block.
public  ListcatchBlocks()
     Returns theBlocks in this CFG that begin exception handlers.
public  voidcommit()
     Commit changes back to the method editor.
public  CollectiondomChildren(Block block)
     Returns the blocks that a given block dominates.
public  CollectiondomFrontier(Block block)
     Returns the dominance frontier of a given block.
public  BlockdomParent(Block block)
     Returns the Block that dominates a given block.
public  Collectionhandlers()
     Returns all of the Handler objects in this CFG.
public  MaphandlersMap()
     Returns A Map mapping the first block in an exception handler to its Handler object.
public  Blockinit()
     Returns the initialization block.
public  voidinitialize()
     Sets up the control flow graph.
public  CollectioniteratedDomFrontier(Collection blocks)
     Returns the iterated dominance frontiers for several basic blocks.
public  CollectioniteratedPdomFrontier(Collection blocks)
     Returns the iterated postdominance frontier for several basic blocks.
public  SubroutinelabelSub(Label label)
     Returns the Subroutine whose entry block is labeled by a given Label.
public  intloopDepth(Block block)
     Returns the depth of the loop in which a block is contained.
public  BlockloopHeader(Block block)
     Returns the loop header of the loop containing a given block.
public  intloopLevel(Block block)
     Returns the level of the loop containing a given block.
public  GraphloopTree()
     Returns the loop tree for the method modeled by this flow graph.
public  intmaxLoopDepth()
     Returns the maximum loop depth (also the maximum loop height) in the control flow graph.
public  MethodEditormethod()
     Returns the method editor for the method modeled by this graph.
public  BlocknewBlock()
     Returns a new Block with the next available Label.
 BlocknewBlock(Label label)
     Creates a new Block starting with the specified Label.
public  CollectionpdomChildren(Block block)
     Returns the postdominator children of a given block.
public  CollectionpdomFrontier(Block block)
     Returns the postdominance frontier of a given block.
public  BlockpdomParent(Block block)
     Returns the postdominator parent of a given block.
public  ListpostOrder()
     Returns the blocks in the flow graph sorted in post-order.
public  ListpreOrder()
     Returns the blocks in the flow graph sorted in pre-order.
public  voidprint(PrintStream out)
    
public  voidprint(PrintWriter out)
     Prints the graph.
public  voidprint()
    
public  voidprintGraph()
    
public  voidprintGraph(PrintStream out)
     Creates a graphical description of the CFG in the dot language.
public  voidprintGraph(PrintWriter out)
    
public  voidprintGraph(PrintWriter out, String name)
    
public  voidremoveEdge(GraphNode v, GraphNode w)
     Removes an edge from the graph and performs the necessary cleanup.
public  voidremoveNode(Object key)
     Removes a node (a Block) from the graph.
public  voidremoveSub(Subroutine sub)
     Removes a subroutine from this method.
public  CollectionreverseRoots()
    
public  Collectionroots()
     A Collection containing the root(s) of this FlowGraph.
 voidsetSubEntry(Subroutine sub, Block entry)
     Set the entry in the mapping between subroutine entry Blocks and the Subroutines that they begin.
public  Blocksink()
     Returns the sink block.
public  Blocksource()
     Returns the "Enter" block of this CFG.
public  Collectionsubroutines()
     Returns all of the Subroutines in the method modeled by this FlowGraph.
public  StringtoString()
     Returns a brief textual description of this FlowGraph, namely the name of the method it represents.
public  Listtrace()
     Returns the basic blocks contained in this CFG in trace order.
public  voidvisit(TreeVisitor visitor)
    
public  voidvisitChildren(TreeVisitor visitor)
     Visit each node (block) in this CFG in pre-order.

Field Detail
DB_GRAPHS
public static boolean DB_GRAPHS(Code)



DEBUG
public static boolean DEBUG(Code)



PEEL_ALL_LOOPS
final public static int PEEL_ALL_LOOPS(Code)



PEEL_LOOPS_LEVEL
public static int PEEL_LOOPS_LEVEL(Code)



PEEL_NO_LOOPS
final public static int PEEL_NO_LOOPS(Code)



PRINT_GRAPH
public static boolean PRINT_GRAPH(Code)



catchBlocks
List catchBlocks(Code)



domEdgeModCount
int domEdgeModCount(Code)



file
int file(Code)



handlers
Map handlers(Code)



iniBlock
Block iniBlock(Code)



loopEdgeModCount
int loopEdgeModCount(Code)



loopTree
Graph loopTree(Code)



maxLoopDepth
int maxLoopDepth(Code)



method
MethodEditor method(Code)



next
int next(Code)



snkBlock
Block snkBlock(Code)



srcBlock
Block srcBlock(Code)



subroutines
Map subroutines(Code)



trace
List trace(Code)




Constructor Detail
FlowGraph
public FlowGraph(MethodEditor method)(Code)
Constructor.
Parameters:
  method - The method to create the CFG for.




Method Detail
addEdge
public void addEdge(GraphNode src, GraphNode dst)(Code)
Adds an edge between two nodes in this graph.
Parameters:
  src - Node at which the edge originates.
Parameters:
  dst - Node at which the edge terminates.



blockType
public int blockType(Block block)(Code)
Returns the type of a given block. A block's type is one of Block.NON_HEADER, Block.IRREDUCIBLE, or Block.REDUCIBLE.



catchBlocks
public List catchBlocks()(Code)
Returns theBlocks in this CFG that begin exception handlers.



commit
public void commit()(Code)
Commit changes back to the method editor.



domChildren
public Collection domChildren(Block block)(Code)
Returns the blocks that a given block dominates.



domFrontier
public Collection domFrontier(Block block)(Code)
Returns the dominance frontier of a given block.
See Also:   Block.domFrontier



domParent
public Block domParent(Block block)(Code)
Returns the Block that dominates a given block.



handlers
public Collection handlers()(Code)
Returns all of the Handler objects in this CFG.



handlersMap
public Map handlersMap()(Code)
Returns A Map mapping the first block in an exception handler to its Handler object.
See Also:   Handler



init
public Block init()(Code)
Returns the initialization block.



initialize
public void initialize()(Code)
Sets up the control flow graph. Computes the dominators and the dominance frontier, cleans up the tree, works with the loops, inserts stores to aid copy and constant propagation as well as code generation.



iteratedDomFrontier
public Collection iteratedDomFrontier(Collection blocks)(Code)
Returns the iterated dominance frontiers for several basic blocks.
See Also:   Block.domFrontier



iteratedPdomFrontier
public Collection iteratedPdomFrontier(Collection blocks)(Code)
Returns the iterated postdominance frontier for several basic blocks.
See Also:   Block.pdomFrontier



labelSub
public Subroutine labelSub(Label label)(Code)
Returns the Subroutine whose entry block is labeled by a given Label.



loopDepth
public int loopDepth(Block block)(Code)
Returns the depth of the loop in which a block is contained. The block must be contained in a loop. The procedure has depth 0. A loop (while, for, etc.) at the procedure level has depth 1. Depth increases as loops are nested.
Parameters:
  block - A block whose depth we are interested in.
See Also:   FlowGraph.loopLevel



loopHeader
public Block loopHeader(Block block)(Code)
Returns the loop header of the loop containing a given block. The loop header is the block that dominates all of the blocks in the loop.



loopLevel
public int loopLevel(Block block)(Code)
Returns the level of the loop containing a given block. The innermost loops have level 0. The level increases as you go outward to higher loop nestings. For any given loop, the level is the maximum possible.

 procedure()
 {
 // Depth 0, Level 2 (max possible)
 while()
 {
 // Depth 1, Level 1
 while()
 {
 // Depth 2, Level 0
 }
 }
 while()
 {
 // Depth 1, Level 0
 }
 }
 

Parameters:
  block - A block whose loop level we want to know. This block must becontained in a loop.



loopTree
public Graph loopTree()(Code)
Returns the loop tree for the method modeled by this flow graph. The loop tree represents the nesting of the loops in a method. The procedure is at the root of the loop tree. Nested loops are represented by a parent and child relationship.



maxLoopDepth
public int maxLoopDepth()(Code)
Returns the maximum loop depth (also the maximum loop height) in the control flow graph.



method
public MethodEditor method()(Code)
Returns the method editor for the method modeled by this graph.



newBlock
public Block newBlock()(Code)
Returns a new Block with the next available Label.



newBlock
Block newBlock(Label label)(Code)
Creates a new Block starting with the specified Label. The Block is added to this FlowGraph using its label as its key.
Parameters:
  label - The new Block's Label



pdomChildren
public Collection pdomChildren(Block block)(Code)
Returns the postdominator children of a given block.
See Also:   Block.pdomChildren



pdomFrontier
public Collection pdomFrontier(Block block)(Code)
Returns the postdominance frontier of a given block.
See Also:   Block.pdomFrontier



pdomParent
public Block pdomParent(Block block)(Code)
Returns the postdominator parent of a given block.
See Also:   Block.pdomParent



postOrder
public List postOrder()(Code)
Returns the blocks in the flow graph sorted in post-order.



preOrder
public List preOrder()(Code)
Returns the blocks in the flow graph sorted in pre-order.



print
public void print(PrintStream out)(Code)



print
public void print(PrintWriter out)(Code)
Prints the graph.
Parameters:
  out - The writer to which to print.



print
public void print()(Code)



printGraph
public void printGraph()(Code)



printGraph
public void printGraph(PrintStream out)(Code)
Creates a graphical description of the CFG in the dot language. The name of the generated file is the name of the method modeled by this CFG followed by a number and the ".dot" postfix. For more information about dot and tools that use it see:

http://www.research.att.com/sw/tools/graphviz/




printGraph
public void printGraph(PrintWriter out)(Code)



printGraph
public void printGraph(PrintWriter out, String name)(Code)



removeEdge
public void removeEdge(GraphNode v, GraphNode w)(Code)
Removes an edge from the graph and performs the necessary cleanup.
Parameters:
  v - Node at which edge to be removed originates.
Parameters:
  w - Node at which edge to be removed terminates.



removeNode
public void removeNode(Object key)(Code)
Removes a node (a Block) from the graph.
Parameters:
  key - Block to remove



removeSub
public void removeSub(Subroutine sub)(Code)
Removes a subroutine from this method.
Parameters:
  sub - The subroutine to remove.



reverseRoots
public Collection reverseRoots()(Code)
A Collection containing only the sink block.
See Also:   FlowGraph.roots



roots
public Collection roots()(Code)
A Collection containing the root(s) of this FlowGraph. In thiscase there is only one root, so the Collection only contains thesource block.



setSubEntry
void setSubEntry(Subroutine sub, Block entry)(Code)
Set the entry in the mapping between subroutine entry Blocks and the Subroutines that they begin. It also sets the Subroutine's entry block.
Parameters:
  sub - The subroutine whose entry block is being set.
Parameters:
  entry - The subroutine's entry Block.
See Also:   Subroutine.setEntry



sink
public Block sink()(Code)
Returns the sink block. That is, the block through which all paths exit.



source
public Block source()(Code)
Returns the "Enter" block of this CFG. That is, the block through which all paths enter.



subroutines
public Collection subroutines()(Code)
Returns all of the Subroutines in the method modeled by this FlowGraph.



toString
public String toString()(Code)
Returns a brief textual description of this FlowGraph, namely the name of the method it represents.



trace
public List trace()(Code)
Returns the basic blocks contained in this CFG in trace order. Trace order implies that basic blocks that end with a conditional jump are followed by their false branch and, where possible, that blocks that end in an unconditional jump are followed by the block that is the target of the unconditional branch.

The trace does not contain the source and the sink blocks. The basic Blocks in this CFG.




visit
public void visit(TreeVisitor visitor)(Code)



visitChildren
public void visitChildren(TreeVisitor visitor)(Code)
Visit each node (block) in this CFG in pre-order.



Fields inherited from EDU.purdue.cs.bloat.util.Graph
protected int edgeModCount(Code)(Java Doc)
protected int nodeModCount(Code)(Java Doc)
protected int removingEdge(Code)(Java Doc)
protected int removingNode(Code)(Java Doc)
protected int revRootEdgeModCount(Code)(Java Doc)
protected int rootEdgeModCount(Code)(Java Doc)

Methods inherited from EDU.purdue.cs.bloat.util.Graph
public void addEdge(GraphNode v, GraphNode w)(Code)(Java Doc)
public void addNode(Object key, GraphNode node)(Code)(Java Doc)
public GraphNode getNode(Object key)(Code)(Java Doc)
public boolean hasEdge(GraphNode v, GraphNode w)(Code)(Java Doc)
public boolean hasNode(GraphNode v)(Code)(Java Doc)
public boolean isAncestorToDescendent(GraphNode v, GraphNode w)(Code)(Java Doc)
public Set keySet()(Code)(Java Doc)
public Collection nodes()(Code)(Java Doc)
public List postOrder()(Code)(Java Doc)
public int postOrderIndex(GraphNode node)(Code)(Java Doc)
public List preOrder()(Code)(Java Doc)
public int preOrderIndex(GraphNode node)(Code)(Java Doc)
public Collection preds(GraphNode v)(Code)(Java Doc)
public void removeEdge(GraphNode v, GraphNode w)(Code)(Java Doc)
public void removeNode(Object key)(Code)(Java Doc)
public void removeUnreachable()(Code)(Java Doc)
public Collection reverseRoots()(Code)(Java Doc)
public Collection roots()(Code)(Java Doc)
public int size()(Code)(Java Doc)
public Collection succs(GraphNode v)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.