Contents | Prev | Next | IndexThe JavaTM Virtual Machine Specification


ldc_quick

Operation
Push item from constant pool

ldc_quick
index

Forms
ldc_quick = 203 (0xcb)

Stack
... ..., item

Description
The index is an unsigned byte that must be a valid index into the constant pool of the current class (§3.6). The constant pool item at index must have already been resolved and must be one word wide. The item is fetched from the constant pool and pushed onto the operand stack.

Notes
The opcode of this instruction was originally ldc. The operand of the ldc instruction is not modified.

ldc_w_quick lcd_w_quick

Operation
Push item from constant pool

ldc_w_quick
indexbyte1
indexbyte2
(wide index)

Forms
ldc_w_quick = 204 (0xcc)

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 index is (indexbyte1 << 8) | indexbyte2. The index must be a valid index into the constant pool of the current class. The constant pool item at the index must have already been resolved and must be one word wide. The item is fetched from the constant pool and pushed onto the operand stack.

Notes
The opcode of this instruction was originally ldc_w. The operands of the ldc_w instruction are not modified.

The ldc_w_quick instruction is identical to the ldc_quick instruction, except for its wider constant pool index.

ldc2_w_quick ldc2_w_quick

Operation
Push long or double from constant pool (wide index)

ldc2_w_quick
indexbyte1
indexbyte2

Forms
ldc2_w_quick = 205 (0xcd)

Stack
... ..., item.word1, item.word2

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 (indexbyte1 << 8) | indexbyte2. The index must be a valid index into the constant pool of the current class. The (64-bit) constant pool constant at the index must have already been resolved and must be two words wide.

Notes
The opcode of this instruction was originally ldc2_w. The operands of the original ldc2_w instruction are not modified.

Only a wide index version of this instruction exists; there is no ldc2_quick instruction that pushes a two-word constant with a single-byte index.



Contents | Prev | Next | Index

Java Virtual Machine Specification (HTML generated by chsieh on March 13, 1997)
Copyright © 1996, 1997 Sun Microsystems, Inc. All rights reserved
Please send any comments or corrections to doug.kramer@sun.com