org.compass.core.util.asm
Class Frame

java.lang.Object
  extended by org.compass.core.util.asm.Frame

final class Frame
extends Object

Information about the input and output stack map frames of a basic block.

Author:
Eric Bruneton

Field Summary
(package private) static int ARRAY_OF
          Constant to be added to a type to get a type with one more dimension.
(package private) static int BASE
          Kind of the types that are not relative to an input stack map frame.
(package private) static int BASE_KIND
          Mask to get the kind of base types.
(package private) static int BASE_VALUE
          Mask to get the value of base types.
(package private) static int BOOLEAN
          The BOOLEAN type.
(package private) static int BYTE
          The BYTE type.
(package private) static int CHAR
          The CHAR type.
(package private) static int DIM
          Mask to get the dimension of a frame type.
(package private) static int DOUBLE
          The DOUBLE type.
(package private) static int ELEMENT_OF
          Constant to be added to a type to get a type with one less dimension.
(package private) static int FLOAT
          The FLOAT type.
(package private)  int[] inputLocals
          The input stack map frame locals.
(package private)  int[] inputStack
          The input stack map frame stack.
(package private) static int INTEGER
          The INTEGER type.
(package private) static int KIND
          Mask to get the kind of a frame type.
(package private) static int LONG
          The LONG type.
(package private) static int NULL
          The NULL type.
(package private) static int OBJECT
          Base kind of the base reference types.
(package private)  Label owner
          The label (i.e. basic block) to which these input and output stack map frames correspond.
(package private) static int SHORT
          The SHORT type.
(package private) static int[] SIZE
          The stack size variation corresponding to each JVM instruction.
(package private) static int TOP
          The TOP type.
(package private) static int UNINITIALIZED
          Base kind of the uninitialized base types.
(package private) static int UNINITIALIZED_THIS
          The UNINITIALIZED_THIS type.
(package private) static int VALUE
          Mask to get the value of a frame type.
 
Constructor Summary
Frame()
           
 
Method Summary
(package private)  void execute(int opcode, int arg, ClassWriter cw, Item item)
          Simulates the action of the given instruction on the output stack frame.
(package private)  void initInputFrame(ClassWriter cw, int access, Type[] args, int maxLocals)
          Initializes the input frame of the first basic block from the method descriptor.
(package private)  boolean merge(ClassWriter cw, Frame frame, int edge)
          Merges the input frame of the given basic block with the input and output frames of this basic block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIM

static final int DIM
Mask to get the dimension of a frame type. This dimension is a signed integer between -8 and 7.

See Also:
Constant Field Values

ARRAY_OF

static final int ARRAY_OF
Constant to be added to a type to get a type with one more dimension.

See Also:
Constant Field Values

ELEMENT_OF

static final int ELEMENT_OF
Constant to be added to a type to get a type with one less dimension.

See Also:
Constant Field Values

KIND

static final int KIND
Mask to get the kind of a frame type.

See Also:
BASE, LOCAL, STACK, Constant Field Values

VALUE

static final int VALUE
Mask to get the value of a frame type.

See Also:
Constant Field Values

BASE_KIND

static final int BASE_KIND
Mask to get the kind of base types.

See Also:
Constant Field Values

BASE_VALUE

static final int BASE_VALUE
Mask to get the value of base types.

See Also:
Constant Field Values

BASE

static final int BASE
Kind of the types that are not relative to an input stack map frame.

See Also:
Constant Field Values

OBJECT

static final int OBJECT
Base kind of the base reference types. The BASE_VALUE of such types is an index into the type table.

See Also:
Constant Field Values

UNINITIALIZED

static final int UNINITIALIZED
Base kind of the uninitialized base types. The BASE_VALUE of such types in an index into the type table (the Item at that index contains both an instruction offset and an internal class name).

See Also:
Constant Field Values

TOP

static final int TOP
The TOP type. This is a BASE type.

See Also:
Constant Field Values

BOOLEAN

static final int BOOLEAN
The BOOLEAN type. This is a BASE type mainly used for array types.

See Also:
Constant Field Values

BYTE

static final int BYTE
The BYTE type. This is a BASE type mainly used for array types.

See Also:
Constant Field Values

CHAR

static final int CHAR
The CHAR type. This is a BASE type mainly used for array types.

See Also:
Constant Field Values

SHORT

static final int SHORT
The SHORT type. This is a BASE type mainly used for array types.

See Also:
Constant Field Values

INTEGER

static final int INTEGER
The INTEGER type. This is a BASE type.

See Also:
Constant Field Values

FLOAT

static final int FLOAT
The FLOAT type. This is a BASE type.

See Also:
Constant Field Values

DOUBLE

static final int DOUBLE
The DOUBLE type. This is a BASE type.

See Also:
Constant Field Values

LONG

static final int LONG
The LONG type. This is a BASE type.

See Also:
Constant Field Values

NULL

static final int NULL
The NULL type. This is a BASE type.

See Also:
Constant Field Values

UNINITIALIZED_THIS

static final int UNINITIALIZED_THIS
The UNINITIALIZED_THIS type. This is a BASE type.

See Also:
Constant Field Values

SIZE

static final int[] SIZE
The stack size variation corresponding to each JVM instruction. This stack variation is equal to the size of the values produced by an instruction, minus the size of the values consumed by this instruction.


owner

Label owner
The label (i.e. basic block) to which these input and output stack map frames correspond.


inputLocals

int[] inputLocals
The input stack map frame locals.


inputStack

int[] inputStack
The input stack map frame stack.

Constructor Detail

Frame

Frame()
Method Detail

initInputFrame

void initInputFrame(ClassWriter cw,
                    int access,
                    Type[] args,
                    int maxLocals)
Initializes the input frame of the first basic block from the method descriptor.

Parameters:
cw - the ClassWriter to which this label belongs.
access - the access flags of the method to which this label belongs.
args - the formal parameter types of this method.
maxLocals - the maximum number of local variables of this method.

execute

void execute(int opcode,
             int arg,
             ClassWriter cw,
             Item item)
Simulates the action of the given instruction on the output stack frame.

Parameters:
opcode - the opcode of the instruction.
arg - the operand of the instruction, if any.
cw - the class writer to which this label belongs.
item - the operand of the instructions, if any.

merge

boolean merge(ClassWriter cw,
              Frame frame,
              int edge)
Merges the input frame of the given basic block with the input and output frames of this basic block. Returns true if the input frame of the given label has been changed by this operation.

Parameters:
cw - the ClassWriter to which this label belongs.
frame - the basic block whose input frame must be updated.
edge - the kind of the Edge between this label and 'label'. See Edge.info.
Returns:
true if the input frame of the given label has been changed by this operation.


Copyright (c) 2004-2008 The Compass Project.