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
_label
private Instruction
_next
private int
_offset
private OpCode
_opCode
private java.lang.Object
_operand
private Instruction
_previous
private static int
U1_MAX_VALUE
private static int
U1_MIN_VALUE
private static int
U2_MAX_VALUE
private static int
U2_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 void
accept(InstructionVisitor visitor)
private static boolean
checkOperand(OperandType operandType, int value)
private static boolean
checkOperand(OperandType operandType, DynamicCallSite callSite)
private static boolean
checkOperand(OperandType operandType, FieldReference field)
private static boolean
checkOperand(OperandType operandType, MethodReference method)
private static boolean
checkOperand(OperandType operandType, TypeReference type)
Instruction
clone()
int
compareTo(Instruction o)
static Instruction
create(OpCode opCode)
static Instruction
create(OpCode opCode, double value)
static Instruction
create(OpCode opCode, float value)
static Instruction
create(OpCode opCode, int value)
static Instruction
create(OpCode opCode, long value)
static Instruction
create(OpCode opCode, short value)
static Instruction
create(OpCode opCode, Instruction target)
static Instruction
create(OpCode opCode, DynamicCallSite callSite)
static Instruction
create(OpCode opCode, FieldReference field)
static Instruction
create(OpCode opCode, MethodReference method)
static Instruction
create(OpCode opCode, SwitchInfo switchInfo)
static Instruction
create(OpCode opCode, TypeReference type)
static Instruction
create(OpCode opCode, TypeReference type, int operand)
static Instruction
create(OpCode opCode, VariableReference variable)
static Instruction
create(OpCode opCode, VariableReference variable, int operand)
int
getEndOffset()
Label
getLabel()
Instruction
getNext()
int
getOffset()
OpCode
getOpCode()
<T> T
getOperand(int index)
int
getOperandCount()
Instruction
getPrevious()
int
getSize()
boolean
hasLabel()
boolean
hasOffset()
boolean
hasOperand()
void
setLabel(Label label)
void
setNext(Instruction next)
void
setOffset(int offset)
void
setOpCode(OpCode opCode)
void
setOperand(java.lang.Object operand)
void
setPrevious(Instruction previous)
java.lang.String
toString()
-
-
-
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:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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:
compareTo
in interfacejava.lang.Comparable<Instruction>
-
-