putfield_quick_w

Set field in object (wide index)

Bytecode

Type Description
u1 putfield opcode = 0x?4 (228)
u2 index

Stack ..., objectref, value => ... OR  ..., objectref, value.word1, value.word2 => ...

Description

The objectref, which must be of type reference, and value, which must be a value of a type appropriate for the specified field, are popped from the operand stack. The unsigned index is used to point to field entry. The value is written at offset into the class instance referenced by objectref.

Exception

NullPointerException - objectref is null

Notes

The opcode of this instruction was originally putfield, operating on a field determined dynamically to have an offset into the class instance data of more than 255 words.

The operands of the putfield instruction are not modified. Because the putfield_quick_w instruction operates on both one- and two-word wide fields, it needs to know both the field offset and the type of that field. Because the original putfield instruction needed a 16-bit index, the field offset may be 16 bits wide. As there is insufficient space in the instruction to store both a 16-bit offset and a field type, putfield_quick_w retains its original operands and uses them to index into the constant pool, where the offset and field type are available in the resolved entry.