JsrInstructionpublic abstract class JsrInstruction extends BranchInstruction implements UnconditionalBranch, StackProducer, TypedInstructionSuper class for JSR - Jump to subroutine |
Constructors Summary |
---|
JsrInstruction(short opcode, InstructionHandle target)
super(opcode, target);
| JsrInstruction()Empty constructor needed for the Class.newInstance() statement in
Instruction.readInstruction(). Not to be used otherwise.
|
Methods Summary |
---|
public com.sun.org.apache.bcel.internal.generic.Type | getType(com.sun.org.apache.bcel.internal.generic.ConstantPoolGen cp)
return new ReturnaddressType(physicalSuccessor());
| public com.sun.org.apache.bcel.internal.generic.InstructionHandle | physicalSuccessor()Returns an InstructionHandle to the physical successor
of this JsrInstruction. For this method to work,
this JsrInstruction object must not be shared between
multiple InstructionHandle objects!
Formally, there must not be InstructionHandle objects
i, j where i != j and i.getInstruction() == this ==
j.getInstruction().
InstructionHandle ih = this.target;
// Rewind!
while(ih.getPrev() != null)
ih = ih.getPrev();
// Find the handle for "this" JsrInstruction object.
while(ih.getInstruction() != this)
ih = ih.getNext();
InstructionHandle toThis = ih;
while(ih != null){
ih = ih.getNext();
if ((ih != null) && (ih.getInstruction() == this))
throw new RuntimeException("physicalSuccessor() called on a shared JsrInstruction.");
}
// Return the physical successor
return toThis.getNext();
|
|