ldc_w

Operation
Push item from constant pool

ldc_w
indexbyte1
indexbyte2
(wide index)

Forms
ldc_w = 19 (0x13)

Stack
... ..., item

Description
The unsigned indexbyte1 and indexbyte2 are assembled into an unsigned 16-bit index into the constant pool of the current class (§3.6), where the value of the index is calculated as (indexbyte1 << 8) | indexbyte2. The index must be a valid index into the constant pool of the current class. The constant pool entry at the index must be a CONSTANT_Integer (§4.4.4), CONSTANT_Float (§4.4.4), or CONSTANT_String (§4.4.3). The constant pool entry is resolved (§5.4, §5.5). If the entry is a CONSTANT_Integer or CONSTANT_Float, it must contain a numeric item which is pushed onto the operand stack as an int or float, respectively.

If the entry at the constant pool index is a CONSTANT_String, it must contain a CONSTANT_Utf8 (§4.4.7) string. An instance of class String is created and initialized to the CONSTANT_Utf8 string. The item, a reference to the instance, is pushed onto the operand stack.

Linking Exceptions
During resolution of a CONSTANT_String constant pool item, any of the exceptions documented in §5.4 can be thrown.

Notes
The ldc_w instruction is identical to the ldc instruction except for its wider constant pool index.