|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.classfile.AbstractInstructionAccessor
org.multijava.util.classfile.Instruction
Root class for instructions. An instruction is defined by its opcode and its arguments.
| Field Summary | |
private int |
address
|
private int |
opcode
|
| Constructor Summary | |
Instruction(int opcode)
Constructs a new instruction |
|
| Method Summary | |
abstract boolean |
canComplete()
Returns true iff control flow can reach the next instruction in textual order after executing this instruction. |
(package private) void |
check(CodeEnv env,
int curStack)
Verifies the enclosed instruction and computes the stack height. |
(package private) void |
computeEndAddress(CodePosition position)
Computes the address of the end of the instruction. |
void |
dump()
|
(package private) int |
getAddress()
Returns the offset in bytes of the instruction from the beginning of the method code (ie classfile). |
(package private) int |
getLocalVar()
Returns the maximum index of local vars used by this instruction. |
int |
getOpcode()
Returns the opcode of the instruction |
int |
getPoppedFromStack()
Returns the size of data pushed on the stack by this instruction |
abstract int |
getPushedOnStack()
Returns the size of data pushed on the stack by this instruction |
abstract byte |
getReturnType()
Returns the type pushed on the stack |
(package private) abstract int |
getSize()
Returns the number of bytes used by the the instruction in the code array. |
abstract int |
getStack()
Returns the amount of stack (positive or negative) used by this instruction. |
boolean |
isLiteral()
Returns true iff this instruction is a literal. |
(package private) abstract void |
resolveConstants(ConstantPool cp)
Inserts or checks location of constant value in constant pool |
(package private) void |
setAddress(int address)
Sets the the offset in bytes of the instruction from the beginning of the method code |
(package private) void |
setOpcode(int opcode)
Returns the opcode of the instruction Needed by PushLiteralInstruction |
(package private) abstract void |
write(ConstantPool cp,
DataOutput out)
Write this class into the the file (out) getting data position from the constant pool |
| Methods inherited from class org.multijava.util.classfile.AbstractInstructionAccessor |
transform |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private int opcode
private int address
| Constructor Detail |
public Instruction(int opcode)
opcode - the opcode of the instruction| Method Detail |
public final int getOpcode()
final void setOpcode(int opcode)
final int getAddress()
final void setAddress(int address)
abstract int getSize()
int getLocalVar()
void check(CodeEnv env,
int curStack)
throws ClassFileFormatException
env - the check environmentcurStack - the stack height at the end
of the execution of the instruction
ClassFileFormatException - a problem was detectedvoid computeEndAddress(CodePosition position)
position - the minimum and maximum address of the
begin of this instruction. This parameter
is changed to the minimum and maximum
address of the end of this instruction.public abstract byte getReturnType()
public abstract int getStack()
public abstract int getPushedOnStack()
public final int getPoppedFromStack()
public boolean isLiteral()
public abstract boolean canComplete()
abstract void resolveConstants(ConstantPool cp)
cp - the constant pool for this class
abstract void write(ConstantPool cp,
DataOutput out)
throws IOException
cp - the constant pool that contain all dataout - the file where to write this object info
IOException - an io problem has occuredpublic void dump()
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||