SandMark version 3.0


sandmark.watermark.util
Class BasicBlockMarker

java.lang.Object
  |
  +--sandmark.watermark.util.BasicBlockMarker
Direct Known Subclasses:
StaticWriteParityMarker

public abstract class BasicBlockMarker
extends java.lang.Object

Subclasses of this class are used to encode integral values in basic blocks.

See Also:
BasicBlock

Constructor Summary
BasicBlockMarker()
           
 
Method Summary
(package private)  boolean capacityIsConstant()
          Returns true if this class returns the same capacity for any basic block, including null.
abstract  void embed(BasicBlock b, de.fub.bytecode.generic.ClassGen cg, java.math.BigInteger value)
          Attempts to encode the given value in the given basic block.
 void embed(BasicBlock b, de.fub.bytecode.generic.ClassGen cg, long value)
          Attempts to encode the given value in the given basic block.
abstract  int getCapacity(BasicBlock b)
          Returns the number of bits that can be encoded into the given basic block.
abstract  java.util.Iterator recognize(BasicBlock b)
          Returns an Iterator over all values found to be embedded in the given basic block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicBlockMarker

public BasicBlockMarker()
Method Detail

embed

public abstract void embed(BasicBlock b,
                           de.fub.bytecode.generic.ClassGen cg,
                           java.math.BigInteger value)
Attempts to encode the given value in the given basic block. The basic block is modified in place. If the number of bits in the given value exceeds that of the value returned by getCapacity(), an IllegalArgumentException will be thrown.

Parameters:
b - basic block to encode data in
cg - class the basic block comes from
value - data to encode
Throws:
java.lang.IllegalArgumentException - if value has too many bits
See Also:
getCapacity(sandmark.util.controlflowgraph.BasicBlock)

embed

public final void embed(BasicBlock b,
                        de.fub.bytecode.generic.ClassGen cg,
                        long value)
Attempts to encode the given value in the given basic block. The basic block is modified in place. If the number of bits in the given value exceeds that of the value returned by getCapacity(), an IllegalArgumentException will be thrown.

This method is implemented with a call to embed(BasicBlock, ClassGen, BigInteger).

Parameters:
b - basic block to encode data in
cg - class the basic block comes from
value - data to encode
Throws:
java.lang.IllegalArgumentException - if value has too many bits
See Also:
getCapacity(sandmark.util.controlflowgraph.BasicBlock)

recognize

public abstract java.util.Iterator recognize(BasicBlock b)
Returns an Iterator over all values found to be embedded in the given basic block. Only values embedded using the marking scheme used by this marker will be reported.

Parameters:
b - basic block to search for marks in

getCapacity

public abstract int getCapacity(BasicBlock b)
Returns the number of bits that can be encoded into the given basic block.

Parameters:
b - basic block to report the bit capacity of
See Also:
embed(sandmark.util.controlflowgraph.BasicBlock, de.fub.bytecode.generic.ClassGen, java.math.BigInteger), embed(sandmark.util.controlflowgraph.BasicBlock, de.fub.bytecode.generic.ClassGen, long)

capacityIsConstant

boolean capacityIsConstant()
Returns true if this class returns the same capacity for any basic block, including null.

See Also:
getCapacity(sandmark.util.controlflowgraph.BasicBlock)

SandMark version 3.0

Wed Jan 29 10:30:05 MST 2003