FileDocCategorySizeDatePackage
JSR.javaAPI DocJava SE 6 API4575Tue Jun 10 00:22:20 BST 2008com.sun.org.apache.bcel.internal.generic

JSR

public class JSR extends JsrInstruction implements VariableLengthInstruction
JSR - Jump to subroutine
version
$Id: JSR.java,v 1.1.2.1 2005/07/31 23:46:00 jeffsuttor Exp $
author
M. Dahm

Fields Summary
Constructors Summary
JSR()
Empty constructor needed for the Class.newInstance() statement in Instruction.readInstruction(). Not to be used otherwise.

public JSR(InstructionHandle target)

    super(com.sun.org.apache.bcel.internal.Constants.JSR, target);
  
Methods Summary
public voidaccept(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.

param
v Visitor object

    v.visitStackProducer(this);
    v.visitVariableLengthInstruction(this);
    v.visitBranchInstruction(this);
    v.visitJsrInstruction(this);
    v.visitJSR(this);
  
public voiddump(java.io.DataOutputStream out)
Dump instruction as byte code to stream out.

param
out Output stream

    index = getTargetOffset();
    if(opcode == com.sun.org.apache.bcel.internal.Constants.JSR)
      super.dump(out);
    else { // JSR_W
      index = getTargetOffset();
      out.writeByte(opcode);
      out.writeInt(index);
    }
  
protected intupdatePosition(int offset, int max_offset)

    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.JSR_W;
      length = 5;
      return 2; // 5 - 3
    }

    return 0;