fr.umlv.corosol.component
Interface JStackFrame

All Superinterfaces:
JAllocatable, JObject

public interface JStackFrame
extends JObject, JAllocatable

A JStackFrame object represents a stack frame, stored by a thread Java Stack. A stack frame is used to store data and partial results, as well as to perform dynamic linking , return values for methods, and dispatch exceptions. A new frame is created each time a method is invoked. A frame is destroyed when its method invocation completes, whether that completion is normal or abrupt (it throws an uncaught exception). Frames are allocated from the Java virtual machine stack of the thread creating the frame. Each frame has its own array of local variables, its own operand stack, and a reference to the runtime constant pool of the class of the current method.

Author:
Christophe Deleray

Method Summary
 int getCurrentSize()
          Returns the current size of this frame.
 int getMaxLocals()
          Returns the maximum capacity of the local variable array of this frame.
 int getMaxStack()
          Returns the maximum capacity of the operand stack of this frame.
 double loadDouble(int index)
          Returns the double value stored at the specified position into the local variable array of this frame.
 float loadFloat(int index)
          Returns the float value stored at the specified position into the local variable array of this frame.
 int loadInt(int index)
          Returns the int value stored at the specified position into the local variable array of this frame.
 long loadLong(int index)
          Returns the long value stored at the specified position into the local variable array of this frame.
 JHeapObject loadReference(int index)
          Returns the object whose the reference is stored at the specified position into the local variable array of this frame.
 JHeapObject peekCallerObject(JClassMethod method)
          Peeks, inside the operand stack, the reference of the caller object of the specified method.
 double popDouble()
          Removes the double value at the top of the operand stack of this frame.
 float popFloat()
          Removes the float value at the top of the operand stack of this frame.
 int popInt()
          Removes the int value at the top of the operand stack of this frame.
 long popLong()
          Removes the long value at the top of the operand stack of this frame.
 JHeapObject popReference()
          Removes the reference of an object at the top of the operand stack of this frame.
 void pushDouble(double value)
          Pushes an double value onto the top of the operand stack of this stack frame.
 void pushFloat(float value)
          Pushes an float value onto the top of the operand stack of this stack frame.
 void pushInt(int value)
          Pushes an int value onto the top of the operand stack of this stack frame.
 void pushLong(long value)
          Pushes an long value onto the top of the operand stack of this stack frame.
 void pushReference(JHeapObject object)
          Pushes the reference of the specified object onto the top of the operand stack of this stack frame.
 void storeDouble(double value, int index)
          Stores an double value at the specified index into the local variable array of this frame.
 void storeFloat(float value, int index)
          Stores an float value at the specified index into the local variable array of this frame.
 void storeInt(int value, int index)
          Stores an int value at the specified index into the local variable array of this frame.
 void storeLong(long value, int index)
          Stores an long value at the specified index into the local variable array of this frame.
 void storeReference(JHeapObject object, int index)
          Stores the reference of the specified object at the specified index into the local variable array of this frame.
 
Methods inherited from interface fr.umlv.corosol.component.JAllocatable
getPosition, getSize, setPosition
 

Method Detail

pushInt

void pushInt(int value)
Pushes an int value onto the top of the operand stack of this stack frame.

Parameters:
value - the int value to be pushed onto the operand stack

pushFloat

void pushFloat(float value)
Pushes an float value onto the top of the operand stack of this stack frame.

Parameters:
value - the float value to be pushed onto the operand stack

pushLong

void pushLong(long value)
Pushes an long value onto the top of the operand stack of this stack frame.

Parameters:
value - the long value to be pushed onto the operand stack

pushDouble

void pushDouble(double value)
Pushes an double value onto the top of the operand stack of this stack frame.

Parameters:
value - the double value to be pushed onto the operand stack

pushReference

void pushReference(JHeapObject object)
Pushes the reference of the specified object onto the top of the operand stack of this stack frame.

Parameters:
object - an object

popInt

int popInt()
Removes the int value at the top of the operand stack of this frame.

Returns:
the int value at the top of the operand stack

popFloat

float popFloat()
Removes the float value at the top of the operand stack of this frame.

Returns:
the float value at the top of the operand stack

popLong

long popLong()
Removes the long value at the top of the operand stack of this frame.

Returns:
the long value at the top of the operand stack

popDouble

double popDouble()
Removes the double value at the top of the operand stack of this frame.

Returns:
the double value at the top of the operand stack

popReference

JHeapObject popReference()
Removes the reference of an object at the top of the operand stack of this frame.

Returns:
the object whose the reference is located at the top of the operand stack

peekCallerObject

JHeapObject peekCallerObject(JClassMethod method)
Peeks, inside the operand stack, the reference of the caller object of the specified method. If the method is static the method returns null;

Parameters:
method - a method
Returns:
the reference of the caller object of the method or null if the method is static

storeInt

void storeInt(int value,
              int index)
Stores an int value at the specified index into the local variable array of this frame.

Parameters:
value - the int value to be stored
index - an index into the local variables array

storeFloat

void storeFloat(float value,
                int index)
Stores an float value at the specified index into the local variable array of this frame.

Parameters:
value - the float value to be stored
index - an index into the local variables array

storeLong

void storeLong(long value,
               int index)
Stores an long value at the specified index into the local variable array of this frame.

Parameters:
value - the long value to be stored
index - an index into the local variables array

storeDouble

void storeDouble(double value,
                 int index)
Stores an double value at the specified index into the local variable array of this frame.

Parameters:
value - the double value to be stored
index - an index into the local variables array

storeReference

void storeReference(JHeapObject object,
                    int index)
Stores the reference of the specified object at the specified index into the local variable array of this frame.

Parameters:
object - an object whose the reference will be stored
index - an index into the local variables array

loadInt

int loadInt(int index)
Returns the int value stored at the specified position into the local variable array of this frame.

Parameters:
index - an index into the local variable array
Returns:
the int value stored at the specified position

loadFloat

float loadFloat(int index)
Returns the float value stored at the specified position into the local variable array of this frame.

Parameters:
index - an index into the local variable array
Returns:
the float value stored at the specified position

loadLong

long loadLong(int index)
Returns the long value stored at the specified position into the local variable array of this frame.

Parameters:
index - an index into the local variable array
Returns:
the long value stored at the specified position

loadDouble

double loadDouble(int index)
Returns the double value stored at the specified position into the local variable array of this frame.

Parameters:
index - an index into the local variable array
Returns:
the double value stored at the specified position

loadReference

JHeapObject loadReference(int index)
Returns the object whose the reference is stored at the specified position into the local variable array of this frame.

Parameters:
index - an index into the local variable array
Returns:
the object whose reference is stored at the specified position

getCurrentSize

int getCurrentSize()
Returns the current size of this frame. The returned value is calculated as the addition of the local variable array size and the current size of the operand stack.

Returns:
the current size of this frame

getMaxLocals

int getMaxLocals()
Returns the maximum capacity of the local variable array of this frame.

Returns:
the maximum capacity of the local variable array of this frame

getMaxStack

int getMaxStack()
Returns the maximum capacity of the operand stack of this frame.

Returns:
the maximum capacity of the operand stack of this frame