Public Methods | |
Instruction (short tag, short length) | |
int | consumeStack () |
int | consumeStack (ConstantPoolGen cpg) |
Instruction | copy () |
void | dump (DataOutputStream out) throws IOException |
boolean | examine (SystemState ss, KernelState ks, ThreadInfo th) |
InstructionHandle | execute (SystemState ss, KernelState ks, ThreadInfo th) |
int | getLength () |
short | getTag () |
boolean | isExecutable (SystemState ss, KernelState ks, ThreadInfo th) |
int | produceStack () |
int | produceStack (ConstantPoolGen cpg) |
String | toString () |
String | toString (ConstantPool cp) |
String | toString (boolean verbose) |
boolean | examine (SystemState ss, KernelState ks, ThreadInfo th) |
InstructionHandle | execute (SystemState ss, KernelState ks, ThreadInfo th) |
boolean | isExecutable (SystemState ss, KernelState ks, ThreadInfo th) |
void | setPeer (de.fub.bytecode.generic.Instruction i) |
Instruction (byte c) | |
Instruction[] | branchpoints (Instruction next) |
abstract int | compile (byte bc[], int index) |
boolean | equals (Instruction i) |
int | hashCode () |
void | markCPRefs (boolean[] refs) |
int | nextOffset (int curr) |
void | offsetToPointer (ByteCode bc) |
abstract int | parse (byte bc[], int index) |
void | redirectCPRefs (short redirect[]) |
String | toString () |
String | toString (cp_info constant_pool[]) |
Instruction (short tag, short length) | |
abstract void | accept (Visitor v) |
int | consumeStack () |
int | consumeStack (ConstantPoolGen cpg) |
Instruction | copy () |
void | dump (DataOutputStream out) throws IOException |
int | getLength () |
short | getTag () |
int | produceStack () |
int | produceStack (ConstantPoolGen cpg) |
String | toString () |
String | toString (ConstantPool cp) |
String | toString (boolean verbose) |
boolean | examine (SystemState ss, KernelState ks, ThreadInfo th) |
abstract Instruction | execute (SystemState ss, KernelState ks, ThreadInfo th) |
Instruction | getNext () |
int | getOffset () |
int | getPosition () |
boolean | isExecutable (SystemState ss, KernelState ks, ThreadInfo th) |
boolean | isObservable () |
void | setObservable () |
String | toString () |
Static Public Methods | |
int | getInt (byte bc[], int index) |
short | getShort (byte bc[], int index) |
int | intToBytes (int s, byte bc[], int index) |
int | shortToBytes (short s, byte bc[], int index) |
final Instruction | readInstruction (ByteSequence bytes) throws IOException |
Instruction | create (InstructionHandle h, int o, MethodInfo m, ConstantPool cp) |
Public Attributes | |
byte | code |
int | label |
String | name |
Instruction | next |
boolean | labelled |
boolean | branches |
boolean | calls |
boolean | returns |
Static Public Attributes | |
final String | argsep = " " |
final String | LOCALPREFIX = "local_" |
Protected Methods | |
void | initFromFile (ByteSequence bytes, boolean wide) throws IOException |
Object | clone () throws CloneNotSupportedException |
void | initFromFile (ByteSequence bytes, boolean wide) throws IOException |
void | init (InstructionHandle h, int o, MethodInfo m, ConstantPool cp) |
abstract void | setPeer (de.fub.bytecode.generic.Instruction i, ConstantPool cp) |
Protected Attributes | |
short | length = 1 |
short | tag = -1 |
int | position |
int | offset |
MethodInfo | mi |
String | asString |
boolean | isObservable |
Private Methods | |
Instruction () | |
void | createPeer () |
void | dispose () |
void | setTag (short tag) |
Instruction () | |
void | dispose () |
void | setTag (short tag) |
Static Private Methods | |
final String | className (short tag) |
final Instruction | readInstruction (ByteSequence bytes) throws IOException |
final String | className (short tag) |
Private Attributes | |
gov nasa arc ase jpf jvm bytecode Instruction | peer |
int | originalIndex |
Static Private Attributes | |
List | Unimplemented = new ArrayList() |
Definition at line 20 of file lib/jpf/de/fub/bytecode/generic/Instruction.java.
|
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise. Definition at line 35 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. |
|
Constructs a new Instruction for this bytecode.
Definition at line 183 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise. Definition at line 24 of file src/de/fub/bytecode/generic/Instruction.java. |
|
|
Returns an array of the instructions to which this instruction might branch (only valid if branches==true; default action is to return null).
Reimplemented in Instruction_Athrow, Instruction_Goto, Instruction_Goto_w, Instruction_intbranch, Instruction_Jsr, Instruction_Jsr_w, Instruction_longbranch, Instruction_Lookupswitch, Instruction_New, and Instruction_Tableswitch. Definition at line 197 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Writes out the sequence of bytecodes represented by this instruction, including any arguments.
Reimplemented in Instruction_byte, Instruction_byteindex, Instruction_bytevar, Instruction_Iinc, Instruction_int, Instruction_intbranch, Instruction_intindex, Instruction_intvar, Instruction_Invokeinterface, Instruction_longbranch, Instruction_Lookupswitch, Instruction_Multianewarray, Instruction_Newarray, Instruction_noargs, and Instruction_Tableswitch. Referenced by ClassFile::unparseMethod().
|
|
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Reimplemented in InvokeInstruction, INVOKEINTERFACE, MULTIANEWARRAY, PUTFIELD, PUTSTATIC, InvokeInstruction, INVOKEINTERFACE, MULTIANEWARRAY, PUTFIELD, and PUTSTATIC. Definition at line 66 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Definition at line 60 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Reimplemented in InvokeInstruction, INVOKEINTERFACE, MULTIANEWARRAY, PUTFIELD, PUTSTATIC, InvokeInstruction, INVOKEINTERFACE, MULTIANEWARRAY, PUTFIELD, and PUTSTATIC. Definition at line 75 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. |
|
Definition at line 69 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by MethodGen::getMaxStack().
|
|
Use with caution, since `BranchInstruction's have a `target' reference which is not copied correctly (only basic types are). This also applies for `Select' instructions with their multiple branch targets.
Definition at line 77 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Use with caution, since `BranchInstruction's have a `target' reference which is not copied correctly (only basic types are). This also applies for `Select' instructions with their multiple branch targets.
Definition at line 86 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by JavaClass::copy().
|
|
Some instructions may be reused, so don't do anything by default. Reimplemented in BranchInstruction, Select, BranchInstruction, and Select. Definition at line 90 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Some instructions may be reused, so don't do anything by default. Reimplemented in BranchInstruction, Select, BranchInstruction, and Select. Definition at line 129 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by InstructionHandle::dispose(), and InstructionHandle::setInstruction().
|
|
Dump instruction as byte code to stream out.
Reimplemented in FieldOrMethod, BIPUSH, BranchInstruction, CPInstruction, GOTO, GOTO_W, IINC, INVOKEINTERFACE, JSR, JSR_W, LDC, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, TABLESWITCH, FieldOrMethod, BIPUSH, BranchInstruction, CPInstruction, GOTO, GOTO_W, IINC, INVOKEINTERFACE, JSR, JSR_W, LDC, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, and TABLESWITCH. Definition at line 95 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Dump instruction as byte code to stream out.
Reimplemented in FieldOrMethod, BIPUSH, BranchInstruction, CPInstruction, GOTO, GOTO_W, IINC, INVOKEINTERFACE, JSR, JSR_W, LDC, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, TABLESWITCH, FieldOrMethod, BIPUSH, BranchInstruction, CPInstruction, GOTO, GOTO_W, IINC, INVOKEINTERFACE, JSR, JSR_W, LDC, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, and TABLESWITCH. Definition at line 136 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by InstructionList::getByteCode().
|
|
For storing in a Hashtable.
Definition at line 216 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Utility routines, used mostly by the parse routines of various Instruction subclasses; this method converts four bytes into an int.
Definition at line 229 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. Referenced by Instruction_Tableswitch::parse(), Instruction_Lookupswitch::parse(), and Instruction_longbranch::parse().
|
|
Definition at line 101 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Definition at line 162 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by InstructionList::setPositions().
|
|
Utility routines, used mostly by the parse routines of various Instruction subclasses; this method converts two bytes into a short.
Definition at line 247 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. Referenced by Instruction_intvar::parse(), Instruction_intindex::parse(), Instruction_intbranch::parse(), and Instruction_int::parse().
|
|
Definition at line 105 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Definition at line 166 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by MethodGen::getMaxStack(), and InstructionList::setPositions().
|
|
For storing in a Hashtable.
Reimplemented in Field. Definition at line 257 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Read needed data (e.g. index) from file.
Reimplemented in BIPUSH, BranchInstruction, CPInstruction, GOTO_W, IINC, INVOKEINTERFACE, JSR_W, LDC, LDC_W, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, TABLESWITCH, BIPUSH, BranchInstruction, CPInstruction, GOTO_W, IINC, INVOKEINTERFACE, JSR_W, LDC, LDC_W, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, and TABLESWITCH. Definition at line 112 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Read needed data (e.g. index) from file. Reimplemented in BIPUSH, BranchInstruction, CPInstruction, GOTO_W, IINC, INVOKEINTERFACE, JSR_W, LDC, LDC_W, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, TABLESWITCH, BIPUSH, BranchInstruction, CPInstruction, GOTO_W, IINC, INVOKEINTERFACE, JSR_W, LDC, LDC_W, LocalVariableInstruction, LOOKUPSWITCH, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, and TABLESWITCH. Definition at line 170 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by readInstruction().
|
|
Utility routines, used mostly by the compile routines of various Instruction subclasses; this method converts an int into four bytes.
Definition at line 269 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. Referenced by Instruction_Tableswitch::compile(), and Instruction_Lookupswitch::compile().
|
|
Marks the appropriate spot if that constant_pool entry is used by this instr. For every constant pool entry used (referenced) by this instruction, the corresponding boolean in the given array is set to true.
Reimplemented in Instruction_byteindex, and Instruction_intindex. Definition at line 282 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Returns the next available offset assuming this instruction begins on the indicated offset; default assumes no arguments.
Reimplemented in Instruction_byte, Instruction_byteindex, Instruction_bytevar, Instruction_Iinc, Instruction_int, Instruction_intbranch, Instruction_intindex, Instruction_intvar, Instruction_Invokeinterface, Instruction_longbranch, Instruction_Lookupswitch, Instruction_Multianewarray, Instruction_Newarray, and Instruction_Tableswitch. Definition at line 289 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. Referenced by ClassFile::parseMethod(), ClassFile::relabel(), and ByteCode::showCode().
|
|
Changes offset values in this instruction to Instruction references; default behaviour is to do nothing.
Reimplemented in Instruction_intbranch, Instruction_longbranch, Instruction_Lookupswitch, and Instruction_Tableswitch. Definition at line 295 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. Referenced by ByteCode::build().
|
|
Assuming the actual bytecode for this instruction has been extracted already, and index is the offset of the next byte, this method parses whatever arguments the instruction requires and return the offset of the next available byte.
Reimplemented in Instruction_byte, Instruction_byteindex, Instruction_bytevar, Instruction_Iinc, Instruction_int, Instruction_intbranch, Instruction_intindex, Instruction_intvar, Instruction_Invokeinterface, Instruction_longbranch, Instruction_Lookupswitch, Instruction_Multianewarray, Instruction_Newarray, Instruction_noargs, and Instruction_Tableswitch. Referenced by ByteCode::disassemble_bytecode().
|
|
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Reimplemented in GETFIELD, GETSTATIC, InvokeInstruction, GETFIELD, GETSTATIC, and InvokeInstruction. Definition at line 124 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Definition at line 118 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Also works for instructions whose stack effect depends on the constant pool entry they reference.
Reimplemented in GETFIELD, GETSTATIC, InvokeInstruction, GETFIELD, GETSTATIC, and InvokeInstruction. Definition at line 191 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. |
|
Definition at line 185 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by MethodGen::getMaxStack().
|
|
Read an instruction from (byte code) input stream and return the appropiate object.
Definition at line 134 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Read an instruction from (byte code) input stream and return the appropiate object.
Definition at line 201 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. |
|
Updates all constant pool references within this instruction to use new indices, based on the given redirection array.
Reimplemented in Instruction_byteindex, and Instruction_intindex. Definition at line 313 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Needed in readInstruction. Definition at line 170 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Needed in readInstruction. Definition at line 244 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by readInstruction().
|
|
Utility routines, used mostly by the compile routines of various Instruction subclasses; this method converts a short into two bytes.
Definition at line 323 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. Referenced by Instruction_longbranch::compile(), Instruction_intvar::compile(), Instruction_intindex::compile(), Instruction_intbranch::compile(), and Instruction_int::compile().
|
|
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"
Reimplemented in BIPUSH, BranchInstruction, CPInstruction, IINC, LocalVariableInstruction, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, BIPUSH, BranchInstruction, CPInstruction, IINC, LocalVariableInstruction, MULTIANEWARRAY, NEWARRAY, RET, Select, and SIPUSH. Definition at line 192 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Reimplemented in CPInstruction, FieldInstruction, InvokeInstruction, INVOKEINTERFACE, MULTIANEWARRAY, CPInstruction, FieldInstruction, InvokeInstruction, INVOKEINTERFACE, and MULTIANEWARRAY. Definition at line 180 of file src/de/fub/bytecode/generic/Instruction.java. |
|
Reimplemented in Field, Method, Field, Method, Field, Field, and Method. Definition at line 174 of file src/de/fub/bytecode/generic/Instruction.java. |
|
For displaying instructions.
Reimplemented in Instruction_byte, Instruction_byteindex, Instruction_bytevar, Instruction_Iinc, Instruction_int, Instruction_intbranch, Instruction_intindex, Instruction_intvar, Instruction_Invokeinterface, Instruction_longbranch, Instruction_Lookupswitch, Instruction_Multianewarray, Instruction_Newarray, and Instruction_Tableswitch. Definition at line 336 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Long output format: <name of opcode> "["<opcode number>"]" "("<length of instruction>")"
Reimplemented in BIPUSH, BranchInstruction, CPInstruction, IINC, LocalVariableInstruction, MULTIANEWARRAY, NEWARRAY, RET, Select, SIPUSH, BIPUSH, BranchInstruction, CPInstruction, IINC, LocalVariableInstruction, MULTIANEWARRAY, NEWARRAY, RET, Select, and SIPUSH. Definition at line 269 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. |
|
Reimplemented in CPInstruction, FieldInstruction, InvokeInstruction, INVOKEINTERFACE, MULTIANEWARRAY, CPInstruction, FieldInstruction, InvokeInstruction, INVOKEINTERFACE, and MULTIANEWARRAY. Definition at line 257 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. |
|
Reimplemented in Field, Method, Field, Method, Field, Field, and Method. Definition at line 251 of file lib/jpf/de/fub/bytecode/generic/Instruction.java. Referenced by ByteCode::showCode(), and InstructionHandle::toString().
|
|
String used to construct names for local variables. Definition at line 153 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
String used to separate arguments in printing. Definition at line 151 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Whether this instruction branches. Definition at line 172 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Whether this instruction is a method invocation. Definition at line 174 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Actual byte code of this instruction. Definition at line 157 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Offset of this instruction from the start of code.
Definition at line 161 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Whether this instruction is the target of a branch. Definition at line 170 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Name of this instruction.
Reimplemented in Method. Definition at line 165 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Reference for chaining. Definition at line 168 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |
|
Whether this instruction is a return. Definition at line 176 of file src/ca/mcgill/sable/soot/coffi/Instruction.java. |