Package com.aparapi.internal.instruction
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.ByteCode
private Instruction
private LinkedList
<InstructionSet.Branch> private Instruction
private int
protected MethodModel
private Instruction
private Instruction
private Instruction
protected int
private Instruction
private Instruction
private LinkedList
<InstructionSet.Branch> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Instruction
(MethodModel _method, InstructionSet.ByteCode _byteCode, int _pc) protected
Instruction
(MethodModel _method, InstructionSet.ByteCode _byteCode, ByteReader _byteReader, boolean _wide) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBranchTarget
(InstructionSet.Branch _branch) asBranch()
int
compareTo
(Instruction _other) boolean
final InstructionSet.ByteCode
(package private) abstract String
int
getReal()
int
int
int
int
int
boolean
isAfter
(Instruction _other) boolean
isAfterOrEqual
(Instruction _other) boolean
isBefore
(Instruction _other) boolean
isBeforeOrEqual
(Instruction _other) boolean
isBranch()
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
removeBranchTarget
(InstructionSet.Branch _branch) boolean
sameAs
(Instruction _other) void
setChildren
(Instruction _firstChild, Instruction _lastChild) void
setLength
(int _length) void
setNextExpr
(Instruction _nextExpr) void
setNextPC
(Instruction _nextByPC) void
setParentExpr
(Instruction _parentExpr) void
setPrevExpr
(Instruction _prevExpr) void
setPrevPC
(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
-