Java Reference
In-Depth Information
where
opcode
is the mnemonic of the instruction to be added, and
arg
is the index of the
local variable.
Mnemonic
Operation
Operand Stack
iinc
Increment
local
variable
No change
by constant
The above instruction can be added to the code section of a method by sending the
CLEmitter
instance the following message:
publicvoidaddIINCInstruction(intindex,
intconstVal)
where
index
is the local variable index, and
constVal
is the constant by which to increment.
Mnemonic
Operation
Operand Stack
bipush
Push
byte
) ;value
sipush
Push
short
) ;value
The above instructions can be added to the code section of a method by sending the
CLEmitter
instance the following message:
publicvoidaddOneArgInstruction(intopcode,
intarg)
where
opcode
is the mnemonic of the instruction to be added, and
arg
is
byte
or
short
value to push.
ldc
15
instruction can be added to the code section of a method using one of the following
CLEmitter
functions:
publicvoidaddLDCInstruction(inti)
publicvoidaddLDCInstruction(longl)
publicvoidaddLDCInstruction(floatf)
publicvoidaddLDCInstruction(doubled)
publicvoidaddLDCInstruction(Strings)
where the argument is the type of the item.
D.5.11
Stack Instructions
Mnemonic
Operation
Operand Stack
pop
Pop the top operand stack
value
;value )
pop2
Pop the top one or two
operand stack values
;value2;value1 )
;value )
dup
Duplicate the top operand
stack value
;value ) ;value;value
15
The
CLEmitter
interface implicitly adds
ldc_w
and
ldc2_w
instructions where necessary.
Search WWH ::
Custom Search