| java.lang.Object org.quilt.cl.GraphTransformer
GraphTransformer | public class GraphTransformer (Code) | | Build the control flow graph for a method, apply an arbitrary
number of GraphXformers to it, and then collapse the graph
back to an instruction list. Exception handlers are collected
from the control flow graph and made available to callers.
XXX Debug statements should be removed when code is definitely
stable. XXX
author: Jim Dixon |
Constructor Summary | |
public | GraphTransformer(List gxf) Creates method control flow graphs, applies application-
specific transforms, and then collapses the graph to produce
a new instruction list.
Parameters: gxf - List of application-specific graph transformers. |
Method Summary | |
final protected BytecodeCollector | collapseGraph(ControlFlowGraph graph) Collapse a method control flow graph, writing bytecode back
into the MethodGen data structures. | public CodeExceptionGen[] | getExceptionHandlers() Returns array of exception handlers, empty if the instruction
list was null or there were no exception handlers. | final public static boolean | hasInbound(InstructionHandle ih) Whether this instruction is target of branch instruction or
starts catch block.
Parameters: ih - Handle on instruction. | final protected ControlFlowGraph | makeGraph(ClassGen clazz, MethodGen method) Build the graph for the method.
Parameters: clazz - Class being transformed in bcel ClassGen. | public InstructionList | xform(ClassGen clazz, MethodGen method) Build a control flow graph for a method's instruction list,
apply any transformers to it, and collapse the graph into
a new instruction list.
Parameters: clazz - Class being transformed. Parameters: method - The method being transformed. |
GraphTransformer | public GraphTransformer(List gxf)(Code) | | Creates method control flow graphs, applies application-
specific transforms, and then collapses the graph to produce
a new instruction list.
Parameters: gxf - List of application-specific graph transformers. author: Jim Dixon |
getExceptionHandlers | public CodeExceptionGen[] getExceptionHandlers()(Code) | | Returns array of exception handlers, empty if the instruction
list was null or there were no exception handlers.
Array of CodeExceptionGen. |
hasInbound | final public static boolean hasInbound(InstructionHandle ih)(Code) | | Whether this instruction is target of branch instruction or
starts catch block.
Parameters: ih - Handle on instruction. True if targeted by branch or CodeExceptionGen. |
makeGraph | final protected ControlFlowGraph makeGraph(ClassGen clazz, MethodGen method)(Code) | | Build the graph for the method.
Parameters: clazz - Class being transformed in bcel ClassGen. Parameters: m - BCEL representation of method we are working on. |
xform | public InstructionList xform(ClassGen clazz, MethodGen method)(Code) | | Build a control flow graph for a method's instruction list,
apply any transformers to it, and collapse the graph into
a new instruction list.
Parameters: clazz - Class being transformed. Parameters: method - The method being transformed. The transformed instruction list. |
|
|