1 package com.sun.org.apache.bcel.internal.generic; 2 3 56 import java.io.*; 57 58 64 public class JSR extends JsrInstruction implements VariableLengthInstruction { 65 69 JSR() {} 70 71 public JSR(InstructionHandle target) { 72 super(com.sun.org.apache.bcel.internal.Constants.JSR, target); 73 } 74 75 79 public void dump(DataOutputStream out) throws IOException { 80 index = getTargetOffset(); 81 if(opcode == com.sun.org.apache.bcel.internal.Constants.JSR) 82 super.dump(out); 83 else { index = getTargetOffset(); 85 out.writeByte(opcode); 86 out.writeInt(index); 87 } 88 } 89 90 protected int updatePosition(int offset, int max_offset) { 91 int i = getTargetOffset(); 93 position += offset; 95 if(Math.abs(i) >= (32767 - max_offset)) { opcode = com.sun.org.apache.bcel.internal.Constants.JSR_W; 97 length = 5; 98 return 2; } 100 101 return 0; 102 } 103 104 112 public void accept(Visitor v) { 113 v.visitStackProducer(this); 114 v.visitVariableLengthInstruction(this); 115 v.visitBranchInstruction(this); 116 v.visitJsrInstruction(this); 117 v.visitJSR(this); 118 } 119 } 120 | Popular Tags |