org.objectweb.jac.core.translators
Class VMStack

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended byjava.util.Stack
                  extended byorg.objectweb.jac.util.Stack
                      extended byorg.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
          An argument
static class VMStack.CollectionValue
          An item of a collection
static class VMStack.DontCare
          Unknown value
static class VMStack.FieldValue
          The value of a field
static class VMStack.Instance
          Instance of a class
static class VMStack.IteratorValue
          An iterator on a collection
static class VMStack.PrimitiveValue
          A primitive value
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, safeTop, swap, top
 
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