Package com.strobel.assembler.ir
Class Instruction
- java.lang.Object
-
- com.strobel.assembler.ir.Instruction
-
- All Implemented Interfaces:
java.lang.Comparable<Instruction>
public final class Instruction extends java.lang.Object implements java.lang.Comparable<Instruction>
User: Mike Strobel Date: 1/6/13 Time: 1:31 AM
-
-
Field Summary
Fields Modifier and Type Field Description private Label_labelprivate Instruction_nextprivate int_offsetprivate OpCode_opCodeprivate java.lang.Object_operandprivate Instruction_previousprivate static intU1_MAX_VALUEprivate static intU1_MIN_VALUEprivate static intU2_MAX_VALUEprivate static intU2_MIN_VALUE
-
Constructor Summary
Constructors Constructor Description Instruction(int offset, OpCode opCode)Instruction(OpCode opCode)Instruction(OpCode opCode, java.lang.Object operand)Instruction(OpCode opCode, java.lang.Object... operands)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(InstructionVisitor visitor)private static booleancheckOperand(OperandType operandType, int value)private static booleancheckOperand(OperandType operandType, DynamicCallSite callSite)private static booleancheckOperand(OperandType operandType, FieldReference field)private static booleancheckOperand(OperandType operandType, MethodReference method)private static booleancheckOperand(OperandType operandType, TypeReference type)Instructionclone()intcompareTo(Instruction o)static Instructioncreate(OpCode opCode)static Instructioncreate(OpCode opCode, double value)static Instructioncreate(OpCode opCode, float value)static Instructioncreate(OpCode opCode, int value)static Instructioncreate(OpCode opCode, long value)static Instructioncreate(OpCode opCode, short value)static Instructioncreate(OpCode opCode, Instruction target)static Instructioncreate(OpCode opCode, DynamicCallSite callSite)static Instructioncreate(OpCode opCode, FieldReference field)static Instructioncreate(OpCode opCode, MethodReference method)static Instructioncreate(OpCode opCode, SwitchInfo switchInfo)static Instructioncreate(OpCode opCode, TypeReference type)static Instructioncreate(OpCode opCode, TypeReference type, int operand)static Instructioncreate(OpCode opCode, VariableReference variable)static Instructioncreate(OpCode opCode, VariableReference variable, int operand)intgetEndOffset()LabelgetLabel()InstructiongetNext()intgetOffset()OpCodegetOpCode()<T> TgetOperand(int index)intgetOperandCount()InstructiongetPrevious()intgetSize()booleanhasLabel()booleanhasOffset()booleanhasOperand()voidsetLabel(Label label)voidsetNext(Instruction next)voidsetOffset(int offset)voidsetOpCode(OpCode opCode)voidsetOperand(java.lang.Object operand)voidsetPrevious(Instruction previous)java.lang.StringtoString()
-
-
-
Field Detail
-
_offset
private int _offset
-
_opCode
private OpCode _opCode
-
_operand
private java.lang.Object _operand
-
_label
private Label _label
-
_previous
private Instruction _previous
-
_next
private Instruction _next
-
U1_MIN_VALUE
private static final int U1_MIN_VALUE
- See Also:
- Constant Field Values
-
U1_MAX_VALUE
private static final int U1_MAX_VALUE
- See Also:
- Constant Field Values
-
U2_MIN_VALUE
private static final int U2_MIN_VALUE
- See Also:
- Constant Field Values
-
U2_MAX_VALUE
private static final int U2_MAX_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
hasOffset
public boolean hasOffset()
-
hasOperand
public boolean hasOperand()
-
getOffset
public int getOffset()
-
setOffset
public void setOffset(int offset)
-
getEndOffset
public int getEndOffset()
-
getOpCode
public OpCode getOpCode()
-
setOpCode
public void setOpCode(OpCode opCode)
-
getOperandCount
public int getOperandCount()
-
getOperand
public <T> T getOperand(int index)
-
setOperand
public void setOperand(java.lang.Object operand)
-
hasLabel
public boolean hasLabel()
-
getLabel
public Label getLabel()
-
setLabel
public void setLabel(Label label)
-
getPrevious
public Instruction getPrevious()
-
setPrevious
public void setPrevious(Instruction previous)
-
getNext
public Instruction getNext()
-
setNext
public void setNext(Instruction next)
-
clone
public Instruction clone()
- Overrides:
clonein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSize
public int getSize()
-
create
public static Instruction create(OpCode opCode)
-
create
public static Instruction create(OpCode opCode, Instruction target)
-
create
public static Instruction create(OpCode opCode, SwitchInfo switchInfo)
-
create
public static Instruction create(OpCode opCode, int value)
-
create
public static Instruction create(OpCode opCode, short value)
-
create
public static Instruction create(OpCode opCode, float value)
-
create
public static Instruction create(OpCode opCode, double value)
-
create
public static Instruction create(OpCode opCode, long value)
-
create
public static Instruction create(OpCode opCode, VariableReference variable)
-
create
public static Instruction create(OpCode opCode, VariableReference variable, int operand)
-
create
public static Instruction create(OpCode opCode, TypeReference type)
-
create
public static Instruction create(OpCode opCode, TypeReference type, int operand)
-
create
public static Instruction create(OpCode opCode, MethodReference method)
-
create
public static Instruction create(OpCode opCode, DynamicCallSite callSite)
-
create
public static Instruction create(OpCode opCode, FieldReference field)
-
checkOperand
private static boolean checkOperand(OperandType operandType, int value)
-
checkOperand
private static boolean checkOperand(OperandType operandType, TypeReference type)
-
checkOperand
private static boolean checkOperand(OperandType operandType, DynamicCallSite callSite)
-
checkOperand
private static boolean checkOperand(OperandType operandType, MethodReference method)
-
checkOperand
private static boolean checkOperand(OperandType operandType, FieldReference field)
-
accept
public void accept(InstructionVisitor visitor)
-
compareTo
public final int compareTo(Instruction o)
- Specified by:
compareToin interfacejava.lang.Comparable<Instruction>
-
-