1 17 package org.apache.bcel.generic; 18 19 25 public abstract class JsrInstruction extends BranchInstruction implements UnconditionalBranch, 26 TypedInstruction, StackProducer { 27 28 JsrInstruction(short opcode, InstructionHandle target) { 29 super(opcode, target); 30 } 31 32 33 37 JsrInstruction() { 38 } 39 40 41 43 public Type getType( ConstantPoolGen cp ) { 44 return new ReturnaddressType(physicalSuccessor()); 45 } 46 47 48 59 public InstructionHandle physicalSuccessor() { 60 InstructionHandle ih = this.target; 61 while (ih.getPrev() != null) { 63 ih = ih.getPrev(); 64 } 65 while (ih.getInstruction() != this) { 67 ih = ih.getNext(); 68 } 69 InstructionHandle toThis = ih; 70 while (ih != null) { 71 ih = ih.getNext(); 72 if ((ih != null) && (ih.getInstruction() == this)) { 73 throw new RuntimeException ("physicalSuccessor() called on a shared JsrInstruction."); 74 } 75 } 76 return toThis.getNext(); 78 } 79 } 80 | Popular Tags |