1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 57 63 public abstract class JsrInstruction extends BranchInstruction 64 implements UnconditionalBranch, TypedInstruction, StackProducer 65 { 66 JsrInstruction(short opcode, InstructionHandle target) { 67 super(opcode, target); 68 } 69 70 74 JsrInstruction(){} 75 76 78 public Type getType(ConstantPoolGen cp) { 79 return new ReturnaddressType(physicalSuccessor()); 80 } 81 82 83 94 public InstructionHandle physicalSuccessor(){ 95 InstructionHandle ih = this.target; 96 97 while(ih.getPrev() != null) 99 ih = ih.getPrev(); 100 101 while(ih.getInstruction() != this) 103 ih = ih.getNext(); 104 105 InstructionHandle toThis = ih; 106 107 while(ih != null){ 108 ih = ih.getNext(); 109 if ((ih != null) && (ih.getInstruction() == this)) 110 throw new RuntimeException ("physicalSuccessor() called on a shared JsrInstruction."); 111 } 112 113 return toThis.getNext(); 115 } 116 } 117 | Popular Tags |