sandmark.util.controlflowgraph
Class SimpleGotoSynthesizer
java.lang.Object
|
+--sandmark.util.controlflowgraph.ControlFlowSynthesizer
|
+--sandmark.util.controlflowgraph.VoidMethodSynthesizer
|
+--sandmark.util.controlflowgraph.SimpleGotoSynthesizer
- public class SimpleGotoSynthesizer
- extends VoidMethodSynthesizer
A simple code generator using conditional and unconditional branches.
Each graph node yields a NOP instruction followed by zero or more
conditional branches and then an unconditional branch. This is a
little too naive because sandmark.util.controlflowgraph.MethodCFG
counts a series of gotos as multiple basic blocks. A leaf node
of the graph produces a RETURN.
Method Summary |
MethodCFG |
generate(Graph graph,
de.fub.bytecode.generic.ConstantPoolGen cpg)
Generates a void no-argument method corresponding to the given graph.
|
static void |
main(java.lang.String[] args)
Test driver. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleGotoSynthesizer
public SimpleGotoSynthesizer()
generate
public MethodCFG generate(Graph graph,
de.fub.bytecode.generic.ConstantPoolGen cpg)
- Generates a void no-argument method corresponding to the given graph.
All graphs are acceptable; no IllegalArgumentException is thrown.
- Specified by:
generate
in class ControlFlowSynthesizer
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Test driver.
java.lang.Exception