|
||||||||||
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 | +--at.dms.classfile.JumpInstruction
Representation of a JVM-bytecode Jump instruction.
Constructor Summary | |
JumpInstruction(int opcode,
InstructionAccessor target)
Constructs a new instruction that takes a label as argument. |
|
JumpInstruction(int opcode,
InstructionAccessor target,
java.lang.String debugIdent)
Constructs a new instruction that takes a label as argument. |
Method Summary | |
boolean |
canComplete()
Returns true iff control flow can reach the next instruction in textual order. |
(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()
Debugging method. |
int |
getPushedOnStack()
Returns the size of data pushed on the stack by this instruction |
byte |
getReturnType()
Returns the type pushed on the stack |
(package private) int |
getSize()
Returns the number of bytes used by the the instruction in the code array. |
int |
getStack()
Return the amount of stack (positive or negative) used by this instruction. |
InstructionAccessor |
getTarget()
Return the target of this instruction |
(package private) void |
resolveConstants(ConstantPool cp)
Insert or check location of constant value on constant pool |
void |
setTarget(InstructionAccessor target)
Sets the target for this instruction |
void |
transformAccessors(AccessorTransformer transformer)
Transforms targets (deferences to actual instructions). |
(package private) void |
write(ConstantPool cp,
java.io.DataOutput out)
Write this instruction into a file |
Methods inherited from class at.dms.classfile.Instruction |
getAddress, getLocalVar, getOpcode, getPoppedFromStack, isLiteral, setAddress, setOpcode |
Methods inherited from class at.dms.classfile.AbstractInstructionAccessor |
transform |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public JumpInstruction(int opcode, InstructionAccessor target)
opcode
- The opcode of the instruction.target
- The referenced instruction.public JumpInstruction(int opcode, InstructionAccessor target, java.lang.String debugIdent)
opcode
- The opcode of the instruction.target
- The referenced instruction.debugIdent
- Can be used to trace wrong jump instructions back to the generator
of that instruction.Method Detail |
public boolean canComplete()
canComplete
in class Instruction
public void transformAccessors(AccessorTransformer transformer) throws BadAccessorException
transformAccessors
in interface AccessorContainer
at.dms.classfile.AccessorContainer
transformer
- The transformer used to transform accessors.public void setTarget(InstructionAccessor target)
public InstructionAccessor getTarget()
int getSize()
getSize
in class Instruction
void check(CodeEnv env, int curStack) throws ClassFileFormatException
check
in class Instruction
env
- the check environmentcurStack
- the stack height at the end of the execution of the instructionClassFileFormatException
- a problem was detectedvoid computeEndAddress(CodePosition position)
computeEndAddress
in class Instruction
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 int getPushedOnStack()
getPushedOnStack
in class Instruction
public byte getReturnType()
getReturnType
in class Instruction
public int getStack()
getStack
in class Instruction
void resolveConstants(ConstantPool cp)
resolveConstants
in class Instruction
cp
- the constant pool for this classvoid write(ConstantPool cp, java.io.DataOutput out) throws java.io.IOException
write
in class Instruction
cp
- the constant pool that contain all dataout
- the file where to write this object infojava.io.IOException
- an io problem has occuredpublic void dump()
dump
in class Instruction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |