Contents | Prev | Next | Index

putfield_quick

Operation
Set field in object

putfield_quick
offset
unused

Forms
putfield_quick = 207 (0xcf)

Stack
..., objectref, value ...

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 value is written at offset into the class instance referenced by objectref.

Runtime Exception
If objectref is null, the putfield_quick instruction throws a NullPointerException.

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 255 words or less and to have a width of one word.

When the constant pool entry referenced by a putfield instruction is resolved, the offset for the field it references is generated. That offset replaces the first operand byte of the original putfield instruction. The second operand byte of the putfield is unused in putfield_quick.


putfield_quick_w

Operation
Set field in object

putfield_quick_w
indexbyte1
indexbyte2
(wide index)

Forms
putfield_quick_w = 228 (0xe4)

Stack
..., objectref, value ...

OR

Stack
..., 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 indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class (§3.6), where the index is (indexbyte1 << 8) | indexbyte2. The constant pool item at the index must be a CONSTANT_Fieldref (§4.4.2) which must already have been resolved and must not be a class (static) field. The value is written at offset into the class instance referenced by objectref.

Runtime Exception
If objectref is null, the putfield_quick_w instruction throws a NullPointerException.

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.


putfield_quick_w

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.


putfield2_quick

Operation
Set long or double field in object

putfield2_quick
offset
unused

Forms
putfield2_quick = 209 (0xd1)

Stack
..., 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 value is written at offset into the class instance referenced by objectref.

Runtime Exception
If objectref is null, the putfield2_quick instruction throws a NullPointerException.

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 255 words or less and to have a width of two words.

When the constant pool entry referenced by a putfield instruction is resolved, the offset for the field it references is generated. That offset replaces the first operand of the original putfield instruction. The second operand of the putfield is unused by putfield2_quick.


putstatic_quick

Operation
Set static field in class

putstatic_quick
indexbyte1
indexbyte2

Forms
putstatic_quick = 211 (0xd3)

Stack
..., value ...

Description
The unsigned indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class (§3.6) where the value of the index is (indexbyte1 << 8) | indexbyte2. The constant pool item must be a field reference to a class (static) field that must have already been successfully resolved to a type that is one word wide. The value must be of a type appropriate to that class field. The value is popped from the operand stack, and that class field is set to value.

Notes
The opcode of this instruction was originally putstatic, operating on a static field determined dynamically to be one word wide. The operands of the putstatic instruction are not modified. There is no equivalent to the putfield_quick instruction, storing a class offset as an instruction operand, for one-word static fields.


putstatic2_quick

Operation
Set static field in class

putstatic2_quick
indexbyte1
indexbyte2

Forms
putstatic2_quick = 213 (0xd5)

Stack
..., value.word1, value.word2 ...

Description
The unsigned indexbyte1 and indexbyte2 are used to construct an index into the constant pool of the current class (§3.6), where the value of the index is (indexbyte1 << 8) | indexbyte2. The constant pool item must be a field reference to a class (static) field that must have already been successfully resolved to a type that is two words wide. The value must be of a type appropriate to that class field. The value is popped from the operand stack, and that class field is set to value.

Notes
The opcode of this instruction was originally putstatic, operating on a static field determined dynamically to be two words wide. The operands of the putstatic instruction are not modified. There is no equivalent to the putfield2_quick instruction, storing a class offset as an instruction operand, for two-word static fields.



Contents | Prev | Next | Index

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