SandMark version 3.0


sandmark.util.controlflowgraph
Class IntFuncSynthesizer

java.lang.Object
  |
  +--sandmark.util.controlflowgraph.ControlFlowSynthesizer
        |
        +--sandmark.util.controlflowgraph.IntFuncSynthesizer
Direct Known Subclasses:
PositiveIntSynthesizer

public abstract class IntFuncSynthesizer
extends ControlFlowSynthesizer

An IntFuncSynthesizer generates code having a control structure that matches a supplied graph. The generated code is a static int(int) method -- an integer function of one argument.


Field Summary
 
Fields inherited from class sandmark.util.controlflowgraph.ControlFlowSynthesizer
rng
 
Constructor Summary
IntFuncSynthesizer()
           
 
Method Summary
(package private)  void genLoad(CodeContext cx, int n)
          Generates either ILOAD_n or ILOAD n.
(package private)  void genPush(CodeContext cx, int v)
          Generates ICONST, BIPUSH, or SIPUSH to load a small constant value.
(package private)  void genStore(CodeContext cx, int n)
          Generates either ISTORE_n or ISTORE n.
(package private)  de.fub.bytecode.generic.MethodGen makeFunc(de.fub.bytecode.generic.InstructionList inslist, de.fub.bytecode.generic.ConstantPoolGen cpg)
          Creates a MethodGen for a public static int(int) method with a random name.
 
Methods inherited from class sandmark.util.controlflowgraph.ControlFlowSynthesizer
generate, makeNOPs, randomIn, setSeed, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntFuncSynthesizer

public IntFuncSynthesizer()
Method Detail

makeFunc

de.fub.bytecode.generic.MethodGen makeFunc(de.fub.bytecode.generic.InstructionList inslist,
                                           de.fub.bytecode.generic.ConstantPoolGen cpg)
Creates a MethodGen for a public static int(int) method with a random name.


genLoad

void genLoad(CodeContext cx,
             int n)
Generates either ILOAD_n or ILOAD n. If both are possible, chooses the longer form with probability VERBOSE_CHANCE.


genStore

void genStore(CodeContext cx,
              int n)
Generates either ISTORE_n or ISTORE n. If both are possible, chooses the longer form with probability VERBOSE_CHANCE.


genPush

void genPush(CodeContext cx,
             int v)
Generates ICONST, BIPUSH, or SIPUSH to load a small constant value.


SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003