| java.lang.Object EDU.purdue.cs.bloat.editor.Instruction
Method Summary | |
public int | category() Returns the category of this instruction. | public boolean | isConditionalJump() Check if the instruction is a conditional jump. | public boolean | isGoto() Check if the instruction is a goto. | public boolean | isInc() Check if the instruction is an increment. | public boolean | isInvoke() Returns true if this instruction invokes a method. | public boolean | isJsr() Check if the instruction is a jsr. | public boolean | isJump() Check if the instruction is a jump. | public boolean | isLoad() Check if the instruction is a load. | public boolean | isRet() Check if the instruction is a subroutine return instruction. | public boolean | isReturn() Returns true if the instruction returns from a method. | public boolean | isStore() Check if the instruction is a store. | public boolean | isSwitch() Check if the instruction is a switch. | public boolean | isThrow() Check if the instruction is an exception throw instruction. | public int | opcodeClass() Get the opcode class of the instruction. | public Object | operand() Get the operand of the instruction. | public int | origOpcode() Returns the original (non-mapped) opcode used to create this Instruction. | public void | setOpcodeClass(int opcode) Set the opcode class of the instruction. | public void | setOperand(Object operand) Set the operand of the instruction. | public void | setUseSlow(boolean useSlow) Sets a flag that determines whether or not the "slow" version of the
instruction should be generated. | protected static int | toInt(byte b1, byte b2, byte b3, byte b4) Utility function to join 4 bytes into an signed int.
Parameters: b1 - The upper byte. Parameters: b2 - The next-to-upper byte. Parameters: b3 - The next-to-lower byte. Parameters: b4 - The lower byte. | protected static short | toShort(byte b1, byte b2) Utility function to join 2 bytes into an signed short.
Parameters: b1 - The upper byte. Parameters: b2 - The lower byte. | public String | toString() Convert the instruction to a string. | protected static int | toUByte(byte b) Utility function to convert a byte into an unsigned byte.
Parameters: b - The byte. | protected static int | toUShort(byte b1, byte b2) Utility function to join 2 bytes into an unsigned short.
Parameters: b1 - The upper byte. Parameters: b2 - The lower byte. | public boolean | useSlow() Returns whether or not the "slow" version of this instruction is
generated. | public void | visit(InstructionVisitor visitor) Big switch statement to call the appropriate method of an instruction
visitor. |
Instruction | public Instruction(int opcode)(Code) | | Constructor.
Parameters: opcode - The opcode class of the instruction. |
Instruction | public Instruction(int opcode, Object operand)(Code) | | Constructor.
Parameters: opcode - The opcode class of the instruction. Parameters: operand - The operand of the instruction, or null. |
Instruction | public Instruction(byte[] code, int index, int[] targets, int[] lookups, LocalVariable[] locals, ConstantPool constants)(Code) | | Constructor.
Parameters: code - The raw byte code array of the method. Parameters: index - This index into the byte array of the instruction. Parameters: targets - Indices of the branch targets of the instruction. Parameters: lookups - Values of the switch lookups of the instruction. Parameters: locals - The local variables defined at this index. Parameters: constants - The constant pool for the class. |
category | public int category()(Code) | | Returns the category of this instruction. An instruction's category is
basically the width of the value the instruction places on the stack.
Types long and double are Category 2. All other
types are Category 1.
|
isConditionalJump | public boolean isConditionalJump()(Code) | | Check if the instruction is a conditional jump.
true if the instruction is a conditional jump, false if not. |
isGoto | public boolean isGoto()(Code) | | Check if the instruction is a goto.
true if the instruction is a goto, false if not. |
isInc | public boolean isInc()(Code) | | Check if the instruction is an increment.
true if the instruction is an increment, false if not. |
isInvoke | public boolean isInvoke()(Code) | | Returns true if this instruction invokes a method.
|
isJsr | public boolean isJsr()(Code) | | Check if the instruction is a jsr.
true if the instruction is a jsr, false if not. |
isJump | public boolean isJump()(Code) | | Check if the instruction is a jump.
true if the instruction is a jump, false if not. |
isLoad | public boolean isLoad()(Code) | | Check if the instruction is a load.
true if the instruction is a load, false if not. |
isRet | public boolean isRet()(Code) | | Check if the instruction is a subroutine return instruction.
true if the instruction is a ret, false if not. |
isReturn | public boolean isReturn()(Code) | | Returns true if the instruction returns from a method.
|
isStore | public boolean isStore()(Code) | | Check if the instruction is a store.
true if the instruction is a store, false if not. |
isSwitch | public boolean isSwitch()(Code) | | Check if the instruction is a switch.
true if the instruction is a switch, false if not. |
isThrow | public boolean isThrow()(Code) | | Check if the instruction is an exception throw instruction.
true if the instruction is a throw, false if not. |
opcodeClass | public int opcodeClass()(Code) | | Get the opcode class of the instruction.
The opcode class of the instruction. |
operand | public Object operand()(Code) | | Get the operand of the instruction.
The operand of the instruction. |
origOpcode | public int origOpcode()(Code) | | Returns the original (non-mapped) opcode used to create this Instruction.
|
setOpcodeClass | public void setOpcodeClass(int opcode)(Code) | | Set the opcode class of the instruction.
Parameters: opcode - The opcode class of the instruction. |
setOperand | public void setOperand(Object operand)(Code) | | Set the operand of the instruction.
Parameters: operand - The operand of the instruction. |
setUseSlow | public void setUseSlow(boolean useSlow)(Code) | | Sets a flag that determines whether or not the "slow" version of the
instruction should be generated. For example, if useSlow is true, "iload
2" is generated instead of "iload_2".
|
toInt | protected static int toInt(byte b1, byte b2, byte b3, byte b4)(Code) | | Utility function to join 4 bytes into an signed int.
Parameters: b1 - The upper byte. Parameters: b2 - The next-to-upper byte. Parameters: b3 - The next-to-lower byte. Parameters: b4 - The lower byte. The signed int. |
toShort | protected static short toShort(byte b1, byte b2)(Code) | | Utility function to join 2 bytes into an signed short.
Parameters: b1 - The upper byte. Parameters: b2 - The lower byte. The signed short. |
toString | public String toString()(Code) | | Convert the instruction to a string.
A string representation of the instruction. |
toUByte | protected static int toUByte(byte b)(Code) | | Utility function to convert a byte into an unsigned byte.
Parameters: b - The byte. The unsigned byte. |
toUShort | protected static int toUShort(byte b1, byte b2)(Code) | | Utility function to join 2 bytes into an unsigned short.
Parameters: b1 - The upper byte. Parameters: b2 - The lower byte. The unsigned short. |
useSlow | public boolean useSlow()(Code) | | Returns whether or not the "slow" version of this instruction is
generated.
|
visit | public void visit(InstructionVisitor visitor)(Code) | | Big switch statement to call the appropriate method of an instruction
visitor.
Parameters: visitor - The instruction visitor. |
|
|