GOTOpublic class GOTO extends GotoInstruction implements VariableLengthInstructionGOTO - Branch always (to relative offset, not absolute address) |
Constructors Summary |
---|
GOTO()Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
| public GOTO(InstructionHandle target)
super(com.sun.org.apache.bcel.internal.Constants.GOTO, target);
|
Methods Summary |
---|
public void | accept(com.sun.org.apache.bcel.internal.generic.Visitor v)Call corresponding visitor method(s). The order is:
Call visitor methods of implemented interfaces first, then
call methods according to the class hierarchy in descending order,
i.e., the most specific visitXXX() call comes last.
v.visitVariableLengthInstruction(this);
v.visitUnconditionalBranch(this);
v.visitBranchInstruction(this);
v.visitGotoInstruction(this);
v.visitGOTO(this);
| public void | dump(java.io.DataOutputStream out)Dump instruction as byte code to stream out.
index = getTargetOffset();
if(opcode == com.sun.org.apache.bcel.internal.Constants.GOTO)
super.dump(out);
else { // GOTO_W
index = getTargetOffset();
out.writeByte(opcode);
out.writeInt(index);
}
| protected int | updatePosition(int offset, int max_offset)Called in pass 2 of InstructionList.setPositions() in order to update
the branch target, that may shift due to variable length instructions.
int i = getTargetOffset(); // Depending on old position value
position += offset; // Position may be shifted by preceding expansions
if(Math.abs(i) >= (32767 - max_offset)) { // to large for short (estimate)
opcode = com.sun.org.apache.bcel.internal.Constants.GOTO_W;
length = 5;
return 2; // 5 - 3
}
return 0;
|
|