SandMark version 3.0


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.


Field Summary
 
Fields inherited from class sandmark.util.controlflowgraph.ControlFlowSynthesizer
rng
 
Constructor Summary
SimpleGotoSynthesizer()
           
 
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 sandmark.util.controlflowgraph.VoidMethodSynthesizer
makeMethod
 
Methods inherited from class sandmark.util.controlflowgraph.ControlFlowSynthesizer
makeNOPs, randomIn, setSeed, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGotoSynthesizer

public SimpleGotoSynthesizer()
Method Detail

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

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003