de.rwth.dfa.jvm.samples
Class SSAbstraction

java.lang.Object
  |
  +--de.rwth.dfa.jvm.samples.SSAbstraction
All Implemented Interfaces:
Abstraction

public class SSAbstraction
extends java.lang.Object
implements Abstraction

Implementation of a stack size abstraction. It can be used to determine the number of elements on the operand stack for each instruction of a JVM method.

Version:
$Id: SSAbstraction.java,v 1.3 2002/09/17 06:53:53 mohnen Exp $
Author:
Markus Mohnen

Inner Class Summary
protected  class SSAbstraction.SSFunction
          This class models the functions of this abstraction.
 
Inner classes inherited from class de.rwth.dfa.jvm.Abstraction
Abstraction.Default
 
Field Summary
protected  de.fub.bytecode.generic.ConstantPoolGen cpg
          A constant pool generator for the constant pool of the methods class.
protected  CompleteLattice lattice
          Contains the instance of SSLattice used by this abstraction.
protected  int maxStack
          The maximal number of elements of the operand stack inside the method of this abstraction.
 
Fields inherited from interface de.rwth.dfa.jvm.Abstraction
DIRECTION_BACKWARD, DIRECTION_FORWARD, QUANTIFIER_ALL, QUANTIFIER_EXISTS
 
Constructor Summary
SSAbstraction(int maxStack, de.fub.bytecode.classfile.ConstantPool constantPool)
          Creates a new SSAbstraction instance.
SSAbstraction(int maxStack, de.fub.bytecode.generic.ConstantPoolGen constantPoolGen)
          Creates a new SSAbstraction instance.
 
Method Summary
 Function getAbstract(de.fub.bytecode.generic.InstructionHandle ih)
          Returns a new instance of SSFunction.
 Function getAbstract(InstructionHandleVector ihv)
          Returns the value of the default implementation in Abstraction.Default.
 int getDirection()
          Returns DIRECTION_FORWARD.
 java.lang.Object getInitialValue(de.fub.bytecode.generic.InstructionHandle o, boolean isRoot)
          Determined the initial stack size at an instruction.
 java.lang.Object getInitialValue(InstructionHandleVector ihv, boolean isRoot)
          Returns the value of the default implementation in Abstraction.Default.
 Lattice getLattice()
          Returns this abstractions instance of SSLattice.
 int getQuantifier()
          Returns QUANTIFIER_ALL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lattice

protected CompleteLattice lattice
Contains the instance of SSLattice used by this abstraction.

maxStack

protected int maxStack
The maximal number of elements of the operand stack inside the method of this abstraction.

cpg

protected de.fub.bytecode.generic.ConstantPoolGen cpg
A constant pool generator for the constant pool of the methods class.
Constructor Detail

SSAbstraction

public SSAbstraction(int maxStack,
                     de.fub.bytecode.generic.ConstantPoolGen constantPoolGen)
Creates a new SSAbstraction instance.
Parameters:
maxStack - an int value: The maximal number of elements on the operand stack of the method to consider.
constantPoolGen - a ConstantPoolGen value: The constant pool generator for the method.

SSAbstraction

public SSAbstraction(int maxStack,
                     de.fub.bytecode.classfile.ConstantPool constantPool)
Creates a new SSAbstraction instance.
Parameters:
maxStack - an int value: The maximal number of elements on the operand stack of the method to consider.
constantPool - a ConstantPool value: The constant pool for the method.
Method Detail

getDirection

public int getDirection()
Returns DIRECTION_FORWARD.
Specified by:
getDirection in interface Abstraction
Returns:
an int value

getQuantifier

public int getQuantifier()
Returns QUANTIFIER_ALL
Specified by:
getQuantifier in interface Abstraction
Returns:
an int value

getLattice

public Lattice getLattice()
Returns this abstractions instance of SSLattice.
Specified by:
getLattice in interface Abstraction
Returns:
a Lattice value

getInitialValue

public java.lang.Object getInitialValue(de.fub.bytecode.generic.InstructionHandle o,
                                        boolean isRoot)
Determined the initial stack size at an instruction. Returns 0 for the method entry, 1 for exception handler entries and the top element for all other instructions.
Specified by:
getInitialValue in interface Abstraction
Parameters:
o - an InstructionHandle value
isRoot - a boolean value
Returns:
an Object value

getAbstract

public Function getAbstract(de.fub.bytecode.generic.InstructionHandle ih)
Returns a new instance of SSFunction.
Specified by:
getAbstract in interface Abstraction
Parameters:
ih - an InstructionHandle value
Returns:
a Function value

getInitialValue

public java.lang.Object getInitialValue(InstructionHandleVector ihv,
                                        boolean isRoot)
Returns the value of the default implementation in Abstraction.Default.
Specified by:
getInitialValue in interface Abstraction
Parameters:
ihv - an InstructionHandleVector value
isRoot - a boolean value
Returns:
an Object value

getAbstract

public Function getAbstract(InstructionHandleVector ihv)
Returns the value of the default implementation in Abstraction.Default.
Specified by:
getAbstract in interface Abstraction
Parameters:
ihv - an InstructionHandleVector value
Returns:
a Function value