JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.core.translators
Class VMStack

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--java.util.Stack
                          |
                          +--org.objectweb.jac.util.Stack
                                |
                                +--org.objectweb.jac.core.translators.VMStack
All Implemented Interfaces:
Cloneable, Collection, List, RandomAccess, Serializable

public class VMStack
extends Stack

Represents the VM stack

See Also:
Serialized Form

Nested Class Summary
static class VMStack.Argument
           
static class VMStack.DontCare
           
static class VMStack.FieldValue
           
static class VMStack.Instance
           
static class VMStack.LocalVariable
           
static class VMStack.PrimitiveValue
           
static class VMStack.ThisPointer
           
 
Field Summary
static VMStack.DontCare dontCare
           
static int[] PRODUCE_STACK
           
static VMStack.ThisPointer thisPointer
           
 
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
VMStack(ConstantPoolGen cp, Code code, int nbArgs, boolean isStatic)
           
 
Method Summary
 void consume(Instruction i)
          Consume values from the stack for the given instruction
 void execute(Instruction i, InstructionHandle ih)
           
static int getConsumed(Instruction i, ConstantPoolGen cp)
          Returns the number of elements from the stack consumed by an instruction
static int getProduced(Instruction i, ConstantPoolGen cp)
          Returns the number of elements produced on the stack by an instruction
 Object getSubstance(InvokeInstruction invoke)
          Gets the value on which a method is invoked
 Object invokedObject(InvokeInstruction i)
          Returns the stack element corresponding to the object on which the InvokeInstruction is applied.
 void preExecute(InstructionHandle ih)
           
 void produce(Instruction i)
           
 
Methods inherited from class org.objectweb.jac.util.Stack
peek, poke, pop, swap
 
Methods inherited from class java.util.Stack
empty, peek, pop, push, search
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, addElement, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, removeRange, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Field Detail

thisPointer

public static final VMStack.ThisPointer thisPointer

dontCare

public static final VMStack.DontCare dontCare

PRODUCE_STACK

public static final int[] PRODUCE_STACK
Constructor Detail

VMStack

public VMStack(ConstantPoolGen cp,
               Code code,
               int nbArgs,
               boolean isStatic)
Method Detail

preExecute

public void preExecute(InstructionHandle ih)

execute

public void execute(Instruction i,
                    InstructionHandle ih)

invokedObject

public Object invokedObject(InvokeInstruction i)
Returns the stack element corresponding to the object on which the InvokeInstruction is applied.


consume

public void consume(Instruction i)
Consume values from the stack for the given instruction


produce

public void produce(Instruction i)

getConsumed

public static int getConsumed(Instruction i,
                              ConstantPoolGen cp)
Returns the number of elements from the stack consumed by an instruction


getProduced

public static int getProduced(Instruction i,
                              ConstantPoolGen cp)
Returns the number of elements produced on the stack by an instruction


getSubstance

public Object getSubstance(InvokeInstruction invoke)
Gets the value on which a method is invoked

Parameters:
invoke - the invoke instruction

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli