📄 quick2.doc8.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><html><head><title>VM Spec </title></head><body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000> <a href="VMSpecTOC.doc.html">Contents</a> | <a href="Quick2.doc7.html">Prev</a> | <a href="Mnemonics.doc.html">Next</a> | <a href="Lindholm.INDEX.html">Index</a><hr><br> <a name="putfield_quick"></a><h2>putfield_quick</h2><a name="putfield_quick.Operation"></a><b>Operation</b><br><a name="6789"></a>Set field in object<p><Table Border="1"><tr><td><a name="6784"></a> <i>putfield_quick</i><td><a name="248"></a> <tr><td><a name="6786"></a> <i>offset</i><td><a name="255"></a> <tr><td><a name="6788"></a> <i>unused</i><td><a name="262"></a> </Table><Table><tr><td></Table><p><a name="putfield_quick.Forms"></a><b>Forms</b><br><a name="12468"></a><i>putfield_quick</i> = 207 (0xcf)<p><a name="putfield_quick.Stack"></a><b>Stack</b><br><a name="1367"></a>..., <i>objectref</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p><a name="putfield_quick.Description"></a><b>Description</b><br><a name="4914"></a>The <i>objectref</i>, which m<em>ust be of type </em><code>reference</code>, and <i>value</i>, which m<em>ust be a value of a type appropriate for the specified field, are popped from the </em>operand stack<em>. </em>The <i>value</i> is written at <i>offset</i> into the class instance referenced by <i>objectref</i>.<p><a name="putfield_quick.Runtime"></a><b>Runtime Exception</b><br><a name="4915"></a>If <i>objectref</i> is <code>null</code>, the <i>putfield_quick</i> instruction throws a <code>NullPointerException</code>.<p><a name="putfield_quick.Notes"></a><b>Notes</b><br><a name="17325"></a>The opcode of this instruction was originally <i>putfield</i>, 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. <p><a name="17425"></a>When the constant pool entry referenced by a <i>putfield</i> instruction is resolved, the offset for the field it references is generated. That offset replaces the first operand byte of the original <i>putfield</i> instruction. The second operand byte of the <i>putfield</i> is unused in <i>putfield_quick</i>.<p><a name="putfield_quick_w"></a><hr><h2>putfield_quick_w</h2><a name="putfield_quick_w.Operation"></a><b>Operation</b><br><a name="6698"></a>Set field in object<p><Table Border="1"><tr><td><a name="6693"></a> <i>putfield_quick_w</i><td><a name="612"></a> <tr><td><a name="6695"></a> <i>indexbyte1</i><td><a name="619"></a> <tr><td><a name="6697"></a> <i>indexbyte2</i><td><a name="626"></a> </Table><Table><tr><td></Table> (wide index)<p><a name="putfield_quick_w.Forms"></a><b>Forms</b><br><a name="12469"></a><i>putfield_quick_w</i> = 228 (0xe4)<p><a name="putfield_quick_w.Stack"></a><b>Stack</b><br><a name="6699"></a>..., <i>objectref</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p><a name="17271"></a>OR<p><a name="putfield_quick_w.Stack"></a><b>Stack</b><br><a name="17274"></a>..., <i>objectref</i>, <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p><a name="putfield_quick_w.Description"></a><b>Description</b><br><a name="6707"></a>The <i>objectref</i>, which m<em>ust be of type </em><code>reference</code>, and <i>value</i>, which m<em>ust be a value of a type appropriate for the specified field, are popped from the </em>operand stack<em>. The unsigned </em><i>indexbyte1</i> and <i>indexbyte2</i> are used to construct an index into the constant pool of the current class <a href="Overview.doc.html#17257">(§3.6)</a>, where the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item at the index must be a <code>CONSTANT_Fieldref</code> <a href="ClassFile.doc.html#4723">(§4.4.2)</a> which must already have been resolved and must not be a class (<code>static</code>) field. The <i>value</i> is written at <i>offset</i> into the class instance referenced by <i>objectref</i>.<p><a name="putfield_quick_w.Runtime"></a><b>Runtime Exception</b><br><a name="6701"></a>If <i>objectref</i> is <code>null</code>, the <i>putfield_quick_w</i> instruction throws a <code>NullPointerException</code>.<p><a name="putfield_quick_w.Notes"></a><b>Notes</b><br><a name="6724"></a>The opcode of this instruction was originally <i>putfield</i>, operating on a field determined dynamically to have an offset into the class instance data of more than 255 words.<p><a name="putfield_quick_w"></a><hr><h2>putfield_quick_w</h2><a name="17418"></a>The operands of the <i>putfield</i> instruction are not modified. Because the <i>putfield_quick_w</i> 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 <i>putfield</i> 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, <i>putfield_quick_w</i> 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.<p><a name="putfield2_quick"></a><hr><h2>putfield2_quick</h2><a name="putfield2_quick.Operation"></a><b>Operation</b><br><a name="6806"></a>Set <code>long</code> or <code>double</code> field in object<p><Table Border="1"><tr><td><a name="6801"></a> <i>putfield2_quick</i><td><a name="449"></a> <tr><td><a name="6803"></a> <i>offset</i><td><a name="456"></a> <tr><td><a name="6805"></a> <i>unused</i><td><a name="463"></a> </Table><Table><tr><td></Table><p><a name="putfield2_quick.Forms"></a><b>Forms</b><br><a name="12470"></a><i>putfield2_quick</i> = 209 (0xd1)<p><a name="putfield2_quick.Stack"></a><b>Stack</b><br><a name="6807"></a>..., <i>objectref</i>, <i>value.word1</i>, <i>value.word2 </i><img src="chars/arrwdbrt.gif"> ...<p><a name="putfield2_quick.Description"></a><b>Description</b><br><a name="6919"></a>The <i>objectref</i>, which m<em>ust be of type </em><code>reference</code>, and <i>value</i>, which m<em>ust be a value of a type appropriate for the specified field, are popped from the </em>operand stack<em>. The </em><i>value</i> is written at <i>offset</i> into the class instance referenced by <i>objectref</i>.<p><a name="putfield2_quick.Runtime"></a><b>Runtime Exception</b><br><a name="6809"></a>If <i>objectref</i> is <code>null</code>, the <i>putfield2_quick</i> instruction throws a <code>NullPointerException</code>.<p><a name="putfield2_quick.Notes"></a><b>Notes</b><br><a name="6448"></a>The opcode of this instruction was originally <i>putfield</i>, 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. <p><a name="17424"></a>When the constant pool entry referenced by a <i>putfield</i> instruction is resolved, the offset for the field it references is generated. That offset replaces the first operand of the original <i>putfield</i> instruction. The second operand of the <i>putfield</i> is unused by <i>putfield2_quick</i>.<p><a name="putstatic_quick"></a><hr><h2>putstatic_quick</h2><a name="putstatic_quick.Operation"></a><b>Operation</b><br><a name="9140"></a>Set <code>static</code> field in class<p><Table Border="1"><tr><td><a name="9135"></a> <i>putstatic_quick</i><td><a name="274"></a> <tr><td><a name="9137"></a> <i>indexbyte1</i><td><a name="281"></a> <tr><td><a name="9139"></a> <i>indexbyte2</i><td><a name="288"></a> </Table><Table><tr><td></Table><p><a name="putstatic_quick.Forms"></a><b>Forms</b><br><a name="12471"></a><i>putstatic_quick</i> = 211 (0xd3)<p><a name="putstatic_quick.Stack"></a><b>Stack</b><br><a name="9141"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p><a name="putstatic_quick.Description"></a><b>Description</b><br><a name="9142"></a>The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are used to construct an index into the constant pool of the current class <a href="Overview.doc.html#17257">(§3.6)</a> where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item must be a field reference to a class (<code>static</code>) field that must have already been successfully resolved to a type that is one word wide. The <i>value</i> must be of a type appropriate to that class field. The <i>value</i> is popped from the operand stack, and that class field is set to <i>value</i>.<p><a name="putstatic_quick.Notes"></a><b>Notes</b><br><a name="8619"></a>The opcode of this instruction was originally <i>putstatic</i>, operating on a <code>static</code> field determined dynamically to be one word wide. The operands of the <i>putstatic</i> instruction are not modified. There is no equivalent to the <i>putfield_quick</i> instruction, storing a class offset as an instruction operand, for one-word <code>static</code> fields.<p><a name="8617"></a><p><a name="putstatic2_quick"></a><hr><h2>putstatic2_quick</h2><a name="putstatic2_quick.Operation"></a><b>Operation</b><br><a name="9157"></a>Set <code>static</code> field in class<p><Table Border="1"><tr><td><a name="9152"></a> <i>putstatic2_quick</i><td><a name="501"></a> <tr><td><a name="9154"></a> <i>indexbyte1</i><td><a name="508"></a> <tr><td><a name="9156"></a> <i>indexbyte2</i><td><a name="515"></a> </Table><Table><tr><td></Table><p><a name="putstatic2_quick.Forms"></a><b>Forms</b><br><a name="12472"></a><i>putstatic2_quick</i> = 213 (0xd5)<p><a name="putstatic2_quick.Stack"></a><b>Stack</b><br><a name="9158"></a>..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p><a name="putstatic2_quick.Description"></a><b>Description</b><br><a name="9159"></a>The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are used to construct an index into the constant pool of the current class <a href="Overview.doc.html#17257">(§3.6)</a>, where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item must be a field reference to a class (<code>static</code>) field that must have already been successfully resolved to a type that is two words wide. The <i>value</i> must be of a type appropriate to that class field. The <i>value</i> is popped from the operand stack, and that class field is set to <i>value</i>.<p><a name="putstatic2_quick.Notes"></a><b>Notes</b><br><a name="8639"></a>The opcode of this instruction was originally <i>putstatic</i>, operating on a <code>static</code> field determined dynamically to be two words wide. The operands of the <i>putstatic</i> instruction are not modified. There is no equivalent to the <i>putfield2_quick</i> instruction, storing a class offset as an instruction operand, for two-word <code>static</code> fields.<p><hr><!-- This inserts footnotes--><p><hr><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Quick2.doc7.html">Prev</a> | <a href="Mnemonics.doc.html">Next</a> | <a href="Lindholm.INDEX.html">Index</a><p><font size=-1>Java Virtual Machine Specification (HTML generated by chsieh on March 04, 1997)<br><i><a href="Copyright.doc.html">Copyright © 1996, 1997 Sun Microsystems, Inc.</a>All rights reserved</i><br>Please send any comments or corrections to <a href="mailto:doug.kramer@sun.com">doug.kramer@sun.com</a></font></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -