| java.lang.Object org.apache.harmony.pack200.bytecode.forms.ByteCodeForm org.apache.harmony.pack200.bytecode.forms.VariableInstructionForm
All known Subclasses: org.apache.harmony.pack200.bytecode.forms.WideForm, org.apache.harmony.pack200.bytecode.forms.SwitchForm,
VariableInstructionForm | abstract public class VariableInstructionForm extends ByteCodeForm (Code) | | This abstract class implements the common code for
instructions which have variable lengths. This
is currently the *switch instructions and some
wide (_w) instructions.
|
Method Summary | |
public void | setRewrite2Bytes(int operand, int[] rewrite) Given an int operand, set the rewrite bytes for
the next available operand position and the byte
immediately following it to a high-byte,
low-byte encoding of the operand.
Note that unlike the ByteCode setOperand* operations, this
starts with an actual bytecode rewrite array (rather than
a ByteCodeForm prototype rewrite array). | public void | setRewrite2Bytes(int operand, int absPosition, int[] rewrite) This method writes operand directly into the rewrite
array at index position specified.
Parameters: operand - value to write Parameters: absPosition - position in array to write. | public void | setRewrite4Bytes(int operand, int[] rewrite) Given an int operand, set the rewrite bytes for
the next available operand position and the three
immediately following it to a highest-byte,
mid-high, mid-low, low-byte encoding of the operand.
Note that unlike the ByteCode setOperand* operations, this
starts with an actual bytecode rewrite array (rather than
a ByteCodeForm prototype rewrite array). | public void | setRewrite4Bytes(int operand, int absPosition, int[] rewrite) This method writes operand directly into the rewrite
array at index position specified.
Parameters: operand - value to write Parameters: absPosition - position in array to write. |
VariableInstructionForm | public VariableInstructionForm(int opcode, String name)(Code) | | |
VariableInstructionForm | public VariableInstructionForm(int opcode, String name, int[] rewrite)(Code) | | |
setRewrite2Bytes | public void setRewrite2Bytes(int operand, int[] rewrite)(Code) | | Given an int operand, set the rewrite bytes for
the next available operand position and the byte
immediately following it to a high-byte,
low-byte encoding of the operand.
Note that unlike the ByteCode setOperand* operations, this
starts with an actual bytecode rewrite array (rather than
a ByteCodeForm prototype rewrite array). Also, this method
overwrites -1 values in the rewrite array - so if you start
with an array that looks like:
{100, -1, -1, -1, -1, 200, -1, -1, -1, -1} then calling
setRewrite2Bytes(0, rewrite) the first time will convert
it to:
{100, 0, 0, -1, -1, 200, -1, -1, -1, -1}
Calling setRewrite2Bytes(0, rewrite) a second time will
convert it to:
{100, 0, 0, 0, 0, 200, -1, -1, -1, -1}
Parameters: operand - int to set the rewrite bytes to Parameters: rewrite - int[] bytes to rewrite |
setRewrite2Bytes | public void setRewrite2Bytes(int operand, int absPosition, int[] rewrite)(Code) | | This method writes operand directly into the rewrite
array at index position specified.
Parameters: operand - value to write Parameters: absPosition - position in array to write. Note thatthis is absolute position in the array, so one canoverwrite the bytecode if one isn't careful. Parameters: rewrite - array to write into |
setRewrite4Bytes | public void setRewrite4Bytes(int operand, int[] rewrite)(Code) | | Given an int operand, set the rewrite bytes for
the next available operand position and the three
immediately following it to a highest-byte,
mid-high, mid-low, low-byte encoding of the operand.
Note that unlike the ByteCode setOperand* operations, this
starts with an actual bytecode rewrite array (rather than
a ByteCodeForm prototype rewrite array). Also, this method
overwrites -1 values in the rewrite array - so if you start
with an array that looks like:
{100, -1, -1, -1, -1, 200, -1, -1, -1, -1} then calling
setRewrite4Bytes(0, rewrite) the first time will convert
it to:
{100, 0, 0, 0, 0, 200, -1, -1, -1, -1}
Calling setRewrite4Bytes(0, rewrite) a second time will
convert it to:
{100, 0, 0, 0, 0, 200, 0, 0, 0, 0}
Parameters: operand - int to set the rewrite bytes to Parameters: rewrite - int[] bytes to rewrite |
setRewrite4Bytes | public void setRewrite4Bytes(int operand, int absPosition, int[] rewrite)(Code) | | This method writes operand directly into the rewrite
array at index position specified.
Parameters: operand - value to write Parameters: absPosition - position in array to write. Note thatthis is absolute position in the array, so one canoverwrite the bytecode if one isn't careful. Parameters: rewrite - array to write into |
|
|