net.sf.rej.java.instruction
Class _wide

java.lang.Object
  extended by net.sf.rej.java.instruction.Instruction
      extended by net.sf.rej.java.instruction._wide

public class _wide
extends Instruction

The first form of the wide instruction modifies one of the instructions iload, fload, aload, lload, dload, istore, fstore, astore, lstore, dstore, or ret. The second form applies only to the iinc instruction.


Field Summary
static java.lang.String MNEMONIC
           
static int OPCODE
           
 
Constructor Summary
_wide()
           
_wide(Instruction instruction)
           
 
Method Summary
 Instruction createNewInstance()
          Returns a new instance of this instruction.
 void execute(ExecutionContext ec)
          Reserved for possible future use.
 byte[] getData(DecompilationContext dc)
          Get the bytecode data for this instruction.
 Instruction getInstruction()
           
 java.lang.String getMnemonic()
          Return the mnemonic of this instruction.
 int getOpcode()
          Return the Opcode of this instruction.
 Parameters getParameters()
          Return a Parameters object describing the types of parameters(if any) and the values set to this particular instance for those parameters.
 Parameters getParameterTypes()
          Return a Parameters object describing the types of parameters(if any) that are applicable to this type of an instruction.
 int getSize()
          Return the size of this instruction.
 int getSize(DecompilationContext dc)
          Override for variable sized instructions.
 void setData(byte[] data, DecompilationContext dc)
          Set the data for this instruction.
 void setParameters(Parameters params)
          Update the parameter values of this instruction with the values in the Parameters object defined by params.
 
Methods inherited from class net.sf.rej.java.instruction.Instruction
getLabels, getPoppedElements, getPushedElements, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPCODE

public static final int OPCODE
See Also:
Constant Field Values

MNEMONIC

public static final java.lang.String MNEMONIC
See Also:
Constant Field Values
Constructor Detail

_wide

public _wide()

_wide

public _wide(Instruction instruction)
Method Detail

getOpcode

public int getOpcode()
Description copied from class: Instruction
Return the Opcode of this instruction.

Specified by:
getOpcode in class Instruction
Returns:
The Opcode value of this instruction.

getMnemonic

public java.lang.String getMnemonic()
Description copied from class: Instruction
Return the mnemonic of this instruction. Such as aload, invokespecial, nop, etc..

Specified by:
getMnemonic in class Instruction
Returns:
mnemonic.

getSize

public int getSize()
Description copied from class: Instruction
Return the size of this instruction.

Specified by:
getSize in class Instruction
Returns:
Size of the instruction in bytes.

getSize

public int getSize(DecompilationContext dc)
Description copied from class: Instruction
Override for variable sized instructions. This method should be called to query the size of an instruction. The default implementation simply calls the getSize() method, but for instructions where the size depetends on the location of the instruction in a code block, this method needs to be overridden, since it offers access to the decompilation context where the current position and other attributes may be queried.

Overrides:
getSize in class Instruction
Parameters:
dc - Context information(most importantly the pc position).
Returns:
Size of instruction in this given context in bytes.

execute

public void execute(ExecutionContext ec)
Description copied from class: Instruction
Reserved for possible future use.

Specified by:
execute in class Instruction
Parameters:
ec - Context for execution.

setData

public void setData(byte[] data,
                    DecompilationContext dc)
Description copied from class: Instruction
Set the data for this instruction. Called by the decompiler to initialize the parameters of the instruction from bytecode data.

Specified by:
setData in class Instruction
Parameters:
data - A byte arrray with the instruction data, starting with the opcode byte(s) and followed by any parameters if applicable.
dc - A callback mechanism to offer the instruction information about the context where it's located.

getData

public byte[] getData(DecompilationContext dc)
Description copied from class: Instruction
Get the bytecode data for this instruction. In other words, tell the instruction to serialize itself. Some instructions use padding to put the subsequent parameters in a pc position that is divisible by 4 and thus require the pc position which they can obtain from the DecompilationContext

Specified by:
getData in class Instruction
Parameters:
dc - A callback mechanism to offer the instruction information about the context where it's located.
Returns:
A byte array with the instruction data.

getParameters

public Parameters getParameters()
Description copied from class: Instruction
Return a Parameters object describing the types of parameters(if any) and the values set to this particular instance for those parameters. For different parameter types see the Parameters class. Modifications in the values of the parameters class are not reflected by this instruction unless setParameters(Parameters) is called subsequently.

Specified by:
getParameters in class Instruction
Returns:
A Parameters object with the types and current values of the parameters.

getParameterTypes

public Parameters getParameterTypes()
Description copied from class: Instruction
Return a Parameters object describing the types of parameters(if any) that are applicable to this type of an instruction. This method is identical to the getParameters() method, only the Parameters object return by a call to this method, does not contain the values of the parameters, just the type information.

Specified by:
getParameterTypes in class Instruction
Returns:
A Parameters object with the types of parameters applicable for this type of an instruction.

setParameters

public void setParameters(Parameters params)
Description copied from class: Instruction
Update the parameter values of this instruction with the values in the Parameters object defined by params. Observe that the types and count of the parameters in the Parameters object MUST match those that this instruction expects. This can be ensured by obtaining the Parameters object with a call to getParameters() of this instruction.

Specified by:
setParameters in class Instruction
Parameters:
params - A Parameters object with new values for this instruction.

createNewInstance

public Instruction createNewInstance()
                              throws java.lang.InstantiationException,
                                     java.lang.IllegalAccessException
Description copied from class: Instruction
Returns a new instance of this instruction. No parameters are copied. If the instruction is a wide instruction, also the contained, widened instruction will be cloned.

Overrides:
createNewInstance in class Instruction
Returns:
a new blank instance of this instruction.
Throws:
java.lang.InstantiationException - a problem with instantiation.
java.lang.IllegalAccessException - access exception.

getInstruction

public Instruction getInstruction()