|
TechTrader Bytecode Toolkit | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.techtrader.modules.tools.bytecode.Instruction | +--com.techtrader.modules.tools.bytecode.JumpInstruction
Represents an IF, GOTO, JSR, or similar instruction that specifies as its argument a position in the code block to jump to.
Field Summary | |
protected int |
_offset
|
protected Instruction |
_target
|
Fields inherited from class com.techtrader.modules.tools.bytecode.Instruction |
_byteIndex,
_opcode,
_opcodeTypes,
_owner |
Constructor Summary | |
protected |
JumpInstruction(Code owner,
int opcode)
|
Method Summary | |
void |
acceptVisit(BCVisitor visit)
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object. |
protected void |
copy(Instruction orig)
|
boolean |
equals(Object other)
JumpInstructions are equal if they represent the same operation and the Instruction they jump to is the same, or if the jump Instruction of either is unset. |
int |
getLength()
Return the length in bytes of this opcode, including all arguments. |
int |
getOffset()
Get the byte offset for the jump instruction. |
int |
getStackChange()
Return the number of stack positions this instruction pushes or pops during its execution. |
Instruction |
getTarget()
Get the current target instruction to jump to, if it has been set. |
protected void |
readData(DataInput in)
Read the arguments for this opcode from the given stream. |
void |
setMarkers(List instructions)
Use the byte indexes read from the .class file to calculate and set references to the target instruction(s) for this ptr. |
void |
setOffset(int offset)
Set the byte offset for the jump instruction. |
JumpInstruction |
setTarget(Instruction instruction)
Set the instruction to jump to; the instruction must already be added to the code block. |
protected void |
writeData(DataOutput out)
Write the arguments for this opcode to the given stream. |
Methods inherited from class com.techtrader.modules.tools.bytecode.Instruction |
getByteIndex,
getName,
getOpCode,
getOwner,
invalidate,
setByteIndex,
setOpCode |
Methods inherited from class java.lang.Object |
clone,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected int _offset
protected Instruction _target
Constructor Detail |
protected JumpInstruction(Code owner, int opcode)
Method Detail |
public void setOffset(int offset)
public int getOffset()
public JumpInstruction setTarget(Instruction instruction)
public Instruction getTarget()
public void setMarkers(List instructions)
codes
- the list of opcodes in the methodpublic boolean equals(Object other)
public int getLength()
public int getStackChange()
protected void copy(Instruction orig)
protected void readData(DataInput in) throws IOException
protected void writeData(DataOutput out) throws IOException
public void acceptVisit(BCVisitor visit)
|
TechTrader Bytecode Toolkit | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |