TechTrader Bytecode Toolkit

com.techtrader.modules.tools.bytecode
Class WideInstruction

java.lang.Object
  |
  +--com.techtrader.modules.tools.bytecode.Instruction
        |
        +--com.techtrader.modules.tools.bytecode.LocalVariableInstruction
              |
              +--com.techtrader.modules.tools.bytecode.IIncInstruction
                    |
                    +--com.techtrader.modules.tools.bytecode.WideInstruction

public class WideInstruction
extends IIncInstruction

Representation of the WIDE instruction, which is used to allow other instructions to index values beyond what they can normally index baed on the length of their arguments.

Author:
Abe White

Fields inherited from class com.techtrader.modules.tools.bytecode.LocalVariableInstruction
_index
 
Fields inherited from class com.techtrader.modules.tools.bytecode.Instruction
_byteIndex, _opcode, _opcodeTypes, _owner
 
Constructor Summary
protected WideInstruction(Code owner)
           
 
Method Summary
 void acceptVisit(BCVisitor visit)
          Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object.
 WideInstruction aload()
          Set the type of instruction this wide instruction modifies.
 WideInstruction astore()
          Set the type of instruction this wide instruction modifies.
protected  void copy(Instruction orig)
           
 WideInstruction dload()
          Set the type of instruction this wide instruction modifies.
 WideInstruction dstore()
          Set the type of instruction this wide instruction modifies.
 WideInstruction fload()
          Set the type of instruction this wide instruction modifies.
 WideInstruction fstore()
          Set the type of instruction this wide instruction modifies.
 int getInstruction()
          Get the code of the instruction to modify; this will return one of the constants defined in Constants.
 int getLength()
          Return the length in bytes of this opcode, including all arguments.
 int getStackChange()
          Return the number of stack positions this instruction pushes or pops during its execution.
 WideInstruction iinc()
          Set the type of instruction this wide instruction modifies.
 WideInstruction iload()
          Set the type of instruction this wide instruction modifies.
 WideInstruction istore()
          Set the type of instruction this wide instruction modifies.
 WideInstruction lload()
          Set the type of instruction this wide instruction modifies.
 WideInstruction lstore()
          Set the type of instruction this wide instruction modifies.
protected  void readData(DataInput in)
          Read the arguments for this opcode from the given stream.
 WideInstruction ret()
          Set the type of instruction this wide instruction modifies.
 WideInstruction setInstruction(int code)
          Set the code of the instruction to modify.
protected  void writeData(DataOutput out)
          Write the arguments for this opcode to the given stream.
 
Methods inherited from class com.techtrader.modules.tools.bytecode.IIncInstruction
equals, getIncrement, setIncrement
 
Methods inherited from class com.techtrader.modules.tools.bytecode.LocalVariableInstruction
calculateOpCode, getIndex, setIndex
 
Methods inherited from class com.techtrader.modules.tools.bytecode.Instruction
getByteIndex, getName, getOpCode, getOwner, invalidate, setByteIndex, setOpCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WideInstruction

protected WideInstruction(Code owner)
Method Detail

iinc

public WideInstruction iinc()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

ret

public WideInstruction ret()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

iload

public WideInstruction iload()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

fload

public WideInstruction fload()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

aload

public WideInstruction aload()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

lload

public WideInstruction lload()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

dload

public WideInstruction dload()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

istore

public WideInstruction istore()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

fstore

public WideInstruction fstore()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

astore

public WideInstruction astore()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

lstore

public WideInstruction lstore()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

dstore

public WideInstruction dstore()
Set the type of instruction this wide instruction modifies.
Returns:
this Instruction, for method chaining

setInstruction

public WideInstruction setInstruction(int code)
Set the code of the instruction to modify. Should be one of: IINC, RET, ILOAD, ALOAD, FLOAD, DLOAD, LLOAD, ISTORE, ASTORE, FSTORE, DSTORE, LSTORE.
Returns:
this Instruction, for method chaining

getInstruction

public int getInstruction()
Get the code of the instruction to modify; this will return one of the constants defined in Constants.

copy

protected void copy(Instruction orig)
Overrides:
copy in class IIncInstruction

getLength

public int getLength()
Description copied from class: Instruction
Return the length in bytes of this opcode, including all arguments. This method should be overridden by opcodes that take arguments.
Overrides:
getLength in class IIncInstruction

getStackChange

public int getStackChange()
Description copied from class: Instruction
Return the number of stack positions this instruction pushes or pops during its execution.
Overrides:
getStackChange in class Instruction
Tags copied from class: Instruction
Returns:
0 if the stack is not affected by this instruction, a positive number if it pushes onto the stack, and a negative number if it pops from the stack

readData

protected void readData(DataInput in)
                 throws IOException
Description copied from class: Instruction
Read the arguments for this opcode from the given stream. This method should be overridden by opcodes that take arguments.
Overrides:
readData in class IIncInstruction

writeData

protected void writeData(DataOutput out)
                  throws IOException
Description copied from class: Instruction
Write the arguments for this opcode to the given stream. This method should be overridden by opcodes that take arguments.
Overrides:
writeData in class IIncInstruction

acceptVisit

public void acceptVisit(BCVisitor visit)
Description copied from interface: VisitAcceptor
Accept a visit from a BCVisitor, calling the appropriate methods to notify the visitor that it has entered this entity, and to provide it with the proper callbacks for each sub-entity owned by this object.
Overrides:
acceptVisit in class IIncInstruction

TechTrader Bytecode Toolkit