SandMark version 3.0


sandmark.util.opaquepredicatelib
Class OpaqueUtil

java.lang.Object
  |
  +--sandmark.util.opaquepredicatelib.OpaqueUtil

public class OpaqueUtil
extends java.lang.Object

This class encapsulates all the support modules for the various opaque libraries


Field Summary
(package private) static java.util.Random rand
           
 
Constructor Summary
(package private) OpaqueUtil()
          Constructor
 
Method Summary
 int[] createLocalVars(de.fub.bytecode.generic.ConstantPoolGen cpg, de.fub.bytecode.generic.MethodGen mg, de.fub.bytecode.generic.InstructionList instrList, int numlocals, de.fub.bytecode.generic.BasicType localtype)
          this function creates and initializes 'numLocals' local variables ( of type 'localtype') in the method 'mg' and returns the indices of the local variables created; returns null incase of any error while creating/initializing
 BasicBlock getBasicBlock(MethodCFG mcfg, de.fub.bytecode.generic.InstructionHandle refHandle)
          this function returns the basicblock in which the instructions with handle 'refHandle' lies ; returns null if the instrHandle is not found in the method 'mcfg'
 de.fub.bytecode.generic.InstructionHandle getLocalInitHandle(de.fub.bytecode.generic.MethodGen mg, int localIndex)
          this function returns the instructionHandle of the instruction which first initializes the localVariable with index 'localIndex'; returs null if no such instruction is found
 de.fub.bytecode.generic.Type getLocalVarType(de.fub.bytecode.generic.MethodGen mg, int localIndex)
          this function returns the type of localVariable(with index 'localIndex') in the method mg; returns 'null' if the variable with such 'localIndex' is not present
 int getRandomValue(int bound)
           
 int getRandomValue(int low, int high)
          returns a random value within specified boundary; taking values from low to high
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rand

static java.util.Random rand
Constructor Detail

OpaqueUtil

OpaqueUtil()
Constructor

Method Detail

getRandomValue

public int getRandomValue(int bound)

getRandomValue

public int getRandomValue(int low,
                          int high)
returns a random value within specified boundary; taking values from low to high


getLocalVarType

public de.fub.bytecode.generic.Type getLocalVarType(de.fub.bytecode.generic.MethodGen mg,
                                                    int localIndex)
this function returns the type of localVariable(with index 'localIndex') in the method mg; returns 'null' if the variable with such 'localIndex' is not present


getBasicBlock

public BasicBlock getBasicBlock(MethodCFG mcfg,
                                de.fub.bytecode.generic.InstructionHandle refHandle)
this function returns the basicblock in which the instructions with handle 'refHandle' lies ; returns null if the instrHandle is not found in the method 'mcfg'


getLocalInitHandle

public de.fub.bytecode.generic.InstructionHandle getLocalInitHandle(de.fub.bytecode.generic.MethodGen mg,
                                                                    int localIndex)
this function returns the instructionHandle of the instruction which first initializes the localVariable with index 'localIndex'; returs null if no such instruction is found


createLocalVars

public int[] createLocalVars(de.fub.bytecode.generic.ConstantPoolGen cpg,
                             de.fub.bytecode.generic.MethodGen mg,
                             de.fub.bytecode.generic.InstructionList instrList,
                             int numlocals,
                             de.fub.bytecode.generic.BasicType localtype)
this function creates and initializes 'numLocals' local variables ( of type 'localtype') in the method 'mg' and returns the indices of the local variables created; returns null incase of any error while creating/initializing


SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003