|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--at.dms.classfile.AbstractInstructionAccessor | +--at.dms.classfile.Instruction
Root class for instructions. An instruction is defined by its opcode and its arguments.
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,
java.io.DataOutput out)
Write this class into the the file (out) getting data position from the constant pool. |
Methods inherited from class at.dms.classfile.AbstractInstructionAccessor |
transform |
Methods inherited from class java.lang.Object |
|
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 instructionClassFileFormatException
- 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 classabstract void write(ConstantPool cp, java.io.DataOutput out) throws java.io.IOException
cp
- The constant pool that contain all data.out
- The file where to write this object info.java.io.IOException
- An io problem has occuredpublic void dump()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |