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
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 Summary
FieldsModifier and TypeFieldDescriptionprivate final InstructionSet.ByteCodeprivate Instructionprivate LinkedList<InstructionSet.Branch> private Instructionprivate intprotected MethodModelprivate Instructionprivate Instructionprivate Instructionprotected intprivate Instructionprivate Instructionprivate LinkedList<InstructionSet.Branch> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstruction(MethodModel _method, InstructionSet.ByteCode _byteCode, int _pc) protectedInstruction(MethodModel _method, InstructionSet.ByteCode _byteCode, ByteReader _byteReader, boolean _wide) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBranchTarget(InstructionSet.Branch _branch) asBranch()intcompareTo(Instruction _other) booleanfinal InstructionSet.ByteCode(package private) abstract StringintgetReal()intintintintintbooleanisAfter(Instruction _other) booleanisAfterOrEqual(Instruction _other) booleanisBefore(Instruction _other) booleanisBeforeOrEqual(Instruction _other) booleanisBranch()booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanvoidremoveBranchTarget(InstructionSet.Branch _branch) booleansameAs(Instruction _other) voidsetChildren(Instruction _firstChild, Instruction _lastChild) voidsetLength(int _length) voidsetNextExpr(Instruction _nextExpr) voidsetNextPC(Instruction _nextByPC) voidsetParentExpr(Instruction _parentExpr) voidsetPrevExpr(Instruction _prevExpr) voidsetPrevPC(Instruction _prevByPC) toString()
-
Field Details
-
method
-
byteCode
-
length
private int length -
pc
protected int pc -
nextPC
-
prevPC
-
nextExpr
-
prevExpr
-
parentExpr
-
forwardConditionalBranchTargets
-
reverseConditionalBranchTargets
-
forwardUnconditionalBranchTargets
-
reverseUnconditionalBranchTargets
-
firstChild
-
lastChild
-
-
Constructor Details
-
Instruction
-
Instruction
protected Instruction(MethodModel _method, InstructionSet.ByteCode _byteCode, ByteReader _byteReader, boolean _wide)
-
-
Method Details
-
getDescription
-
setChildren
-
getPrevExpr
-
getNextExpr
-
setNextPC
-
setPrevPC
-
setPrevExpr
-
setNextExpr
-
toInstruction
-
getLength
public int getLength() -
setLength
public void setLength(int _length) -
getByteCode
-
getThisPC
public int getThisPC() -
getStartPC
public int getStartPC() -
getStackConsumeCount
public int getStackConsumeCount() -
getStackProduceCount
public int getStackProduceCount() -
getStackDelta
public int getStackDelta() -
toString
-
isBranch
public boolean isBranch() -
compareTo
-
isAfter
-
isAfterOrEqual
-
isBefore
-
isBeforeOrEqual
-
getFirstChild
-
getLastChild
-
getStartInstruction
-
getMethod
-
getNextPC
-
getPrevPC
-
setParentExpr
-
getParentExpr
-
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
-
asBranch
-
consumesStack
public boolean consumesStack() -
addBranchTarget
-
removeBranchTarget
-
getForwardUnconditionalBranches
-
getForwardConditionalBranches
-
getReverseUnconditionalBranches
-
getReverseConditionalBranches
-
isForwardBranch
public boolean isForwardBranch() -
sameAs
-