Package org.jruby.ir.representations
Class CFG
java.lang.Object
org.jruby.ir.representations.CFG
Represents the base build of a CFG. All information here is accessed via
delegation from the CFG itself so this is meant as an internal
organizational structure for a build.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
addEdge
(BasicBlock source, BasicBlock destination, CFG.EdgeType type) void
boolean
org.jruby.dirgra.DirectedGraph
<BasicBlock, CFG.EdgeType> Build the Control Flow GraphClone this CFG and return a new one.void
void
fixupEdges
(BasicBlock bb) getBBForLabel
(Label label) Iterable
<org.jruby.dirgra.Edge<BasicBlock, CFG.EdgeType>> getIncomingEdges
(BasicBlock block) getIncomingSourceOfType
(BasicBlock block, CFG.EdgeType type) getIncomingSources
(BasicBlock block) int
int
getOutgoingDestinationOfType
(BasicBlock block, CFG.EdgeType type) getOutgoingDestinationsNotOfType
(BasicBlock block, CFG.EdgeType type) getOutgoingDestinationsOfType
(BasicBlock block, CFG.EdgeType type) Collection
<org.jruby.dirgra.Edge<BasicBlock, CFG.EdgeType>> getOutgoingEdges
(BasicBlock block) getRescuerBBFor
(BasicBlock block) getScope()
int
void
optimize()
int
void
void
void
removeEdge
(BasicBlock a, BasicBlock b) void
setRescuerBB
(BasicBlock block, BasicBlock rescuerBlock) int
size()
How many BasicBlocks are there in this CFG?
-
Constructor Details
-
CFG
-
-
Method Details
-
getNextBBID
public int getNextBBID() -
getManager
-
getMaxNodeID
public int getMaxNodeID() -
bbIsProtected
-
getBBForLabel
-
getEntryBB
-
getExitBB
-
getGlobalEnsureBB
-
postOrderList
-
getPostOrderTraverser
-
getReversePostOrderTraverser
-
getScope
-
size
public int size()How many BasicBlocks are there in this CFG? -
getBasicBlocks
-
getSortedBasicBlocks
-
addEdge
-
inDegree
-
outDegree
-
getIncomingSources
-
getIncomingEdges
-
getIncomingSourceOfType
-
getOutgoingDestinationOfType
-
getOutgoingDestinations
-
getOutgoingDestinationsOfType
-
getOutgoingDestinationsNotOfType
-
getOutgoingEdges
public Collection<org.jruby.dirgra.Edge<BasicBlock,CFG.EdgeType>> getOutgoingEdges(BasicBlock block) -
getRescuerBBFor
-
addGlobalEnsureBB
-
setRescuerBB
-
build
Build the Control Flow Graph -
fixupEdges
-
addBasicBlock
-
removeAllOutgoingEdgesForBB
-
removeBB
-
collapseStraightLineBBs
public void collapseStraightLineBBs() -
optimize
public void optimize() -
toStringGraph
-
toStringInstrs
-
removeEdge
-
clone
Clone this CFG and return a new one.- Parameters:
info
- context object to perform the cloneclonedScope
- already cloned IRScope which this new CFG will belong to- Returns:
- a newly cloned CFG
-