ldc2_w <value>
<value>
is a long integer or a double-precision floating point number.
Stack
Before
Description
After
...
<value>-word1
<value>-word2
...
ldc2_w pushes a two-word constant value onto the operand stack. ldc2_w takes a single parameter, <value>, which is the two-word item to push. The following Java types can be pushed using ldc2_w:
long
double
Example
ldc2_w 10 ; push the long integer 10 ldc2_w 1.54 ; push the double precision float 1.54Bytecode
In bytecode, the ldc2_w opcode is followed by a 16-bit unsigned integer. This integer is the index of an entry in the constant pool. The entry is tagged either as a CONSTANT_Double or a CONSTANT_Long entry, and has a data field which contains <value>.
Type
|
Description
|
|
u1
|
ldc2_w
opcode = 0x14 (20)
|
|
u2
|
index
|
bipush, sipush, ldc, ldc_w, aconst_null, iconst_m1, iconst_<n>, lconst_<l>, fconst_<f>, dconst_<d>