Class Instruction

java.lang.Object
com.aparapi.internal.instruction.Instruction
Direct Known Subclasses:
InstructionSet.ArrayAccess, InstructionSet.Branch, InstructionSet.BytecodeEncodedConstant, InstructionSet.CloneInstruction, InstructionSet.CompositeInstruction, InstructionSet.DUP, InstructionSet.FieldArrayElementAssign, InstructionSet.FieldArrayElementIncrement, InstructionSet.I_ACONST_NULL, InstructionSet.I_ARRAYLENGTH, InstructionSet.I_ATHROW, InstructionSet.I_DCMPG, InstructionSet.I_DCMPL, InstructionSet.I_END, InstructionSet.I_MONITORENTER, InstructionSet.I_MONITOREXIT, InstructionSet.I_NEWARRAY, InstructionSet.I_NOP, InstructionSet.I_POP, InstructionSet.I_POP2, InstructionSet.I_SWAP, InstructionSet.I_WIDE, InstructionSet.ImmediateConstant, InstructionSet.IncrementInstruction, InstructionSet.Index, InstructionSet.InlineAssignInstruction, InstructionSet.MultiAssignInstruction, InstructionSet.OperatorInstruction, InstructionSet.Return

public abstract class Instruction extends Object
Initially represents a single Java bytecode instruction. Instructions for each bytecode are created when the bytecode is first scanned. Each Instruction will contain a pc (program counter) offset from the beginning of the sequence of bytecode and the length will be determined by the information gleaned from InstructionSet.BYTECODE.
  • Field Details

  • Constructor Details

  • Method Details

    • getDescription

      abstract String getDescription()
    • setChildren

      public void setChildren(Instruction _firstChild, Instruction _lastChild)
    • getPrevExpr

      public Instruction getPrevExpr()
    • getNextExpr

      public Instruction getNextExpr()
    • setNextPC

      public void setNextPC(Instruction _nextByPC)
    • setPrevPC

      public void setPrevPC(Instruction _prevByPC)
    • setPrevExpr

      public void setPrevExpr(Instruction _prevExpr)
    • setNextExpr

      public void setNextExpr(Instruction _nextExpr)
    • toInstruction

      public Instruction toInstruction()
    • getLength

      public int getLength()
    • setLength

      public void setLength(int _length)
    • getByteCode

      public final InstructionSet.ByteCode getByteCode()
    • getThisPC

      public int getThisPC()
    • getStartPC

      public int getStartPC()
    • getStackConsumeCount

      public int getStackConsumeCount()
    • getStackProduceCount

      public int getStackProduceCount()
    • getStackDelta

      public int getStackDelta()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isBranch

      public boolean isBranch()
    • compareTo

      public int compareTo(Instruction _other)
    • isAfter

      public boolean isAfter(Instruction _other)
    • isAfterOrEqual

      public boolean isAfterOrEqual(Instruction _other)
    • isBefore

      public boolean isBefore(Instruction _other)
    • isBeforeOrEqual

      public boolean isBeforeOrEqual(Instruction _other)
    • getFirstChild

      public Instruction getFirstChild()
    • getLastChild

      public Instruction getLastChild()
    • getStartInstruction

      public Instruction getStartInstruction()
    • getMethod

      public MethodModel getMethod()
    • getNextPC

      public Instruction getNextPC()
    • getPrevPC

      public Instruction getPrevPC()
    • setParentExpr

      public void setParentExpr(Instruction _parentExpr)
    • getParentExpr

      public Instruction getParentExpr()
    • getRootExpr

      public Instruction getRootExpr()
    • isReverseConditionalBranchTarget

      public boolean isReverseConditionalBranchTarget()
    • isForwardConditionalBranchTarget

      public boolean isForwardConditionalBranchTarget()
    • isReverseUnconditionalBranchTarget

      public boolean isReverseUnconditionalBranchTarget()
    • isForwardUnconditionalBranchTarget

      public boolean isForwardUnconditionalBranchTarget()
    • isReverseBranchTarget

      public boolean isReverseBranchTarget()
    • isConditionalBranchTarget

      public boolean isConditionalBranchTarget()
    • isUnconditionalBranchTarget

      public boolean isUnconditionalBranchTarget()
    • isForwardBranchTarget

      public boolean isForwardBranchTarget()
    • isBranchTarget

      public boolean isBranchTarget()
    • producesStack

      public boolean producesStack()
    • getReal

      public Instruction getReal()
    • asBranch

      public InstructionSet.Branch asBranch()
    • consumesStack

      public boolean consumesStack()
    • addBranchTarget

      public void addBranchTarget(InstructionSet.Branch _branch)
    • removeBranchTarget

      public void removeBranchTarget(InstructionSet.Branch _branch)
    • getForwardUnconditionalBranches

      public LinkedList<InstructionSet.Branch> getForwardUnconditionalBranches()
    • getForwardConditionalBranches

      public LinkedList<InstructionSet.ConditionalBranch> getForwardConditionalBranches()
    • getReverseUnconditionalBranches

      public LinkedList<InstructionSet.Branch> getReverseUnconditionalBranches()
    • getReverseConditionalBranches

      public LinkedList<InstructionSet.ConditionalBranch> getReverseConditionalBranches()
    • isForwardBranch

      public boolean isForwardBranch()
    • sameAs

      public boolean sameAs(Instruction _other)