Class ExecutionVisitor

  • All Implemented Interfaces:
    Visitor

    public class ExecutionVisitor
    extends EmptyVisitor
    implements Visitor
    This Visitor class may be used for a type-based Java Virtual Machine simulation. It does not check for correct types on the OperandStack or in the LocalVariables; nor does it check their sizes are sufficiently big. Thus, to use this Visitor for bytecode verifying, you have to make sure externally that the type constraints of the Java Virtual Machine instructions are satisfied. An InstConstraintVisitor may be used for this. Anyway, this Visitor does not mandate it. For example, when you visitIADD(IADD o), then there are two stack slots popped and one stack slot containing a Type.INT is pushed (where you could also pop only one slot if you know there are two Type.INT on top of the stack). Monitor-specific behaviour is not simulated.

    Conventions: Type.VOID will never be pushed onto the stack. Type.DOUBLE and Type.LONG that would normally take up two stack slots (like Double_HIGH and Double_LOW) are represented by a simple single Type.DOUBLE or Type.LONG object on the stack here. If a two-slot type is stored into a local variable, the next variable is given the type Type.UNKNOWN.
    Version:
    $Id: ExecutionVisitor.java 386056 2006-03-15 11:31:56Z tcurdt $
    Author:
    Enver Haase
    See Also:
    visitDSTORE(DSTORE o), InstConstraintVisitor