📄 instructions2.doc135.html
字号:
<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="Instructions2.doc134.html">Prev</a> | <a href="Instructions2.doc136.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><hr><br> <a name="ldc"></a><h2>ldc</h2><a name="ldc.Operation"></a><b>Operation</b><br><a name="69333"></a>Push item from constant pool<p><Table Border="3"><tr><td><a name="69330"></a> <i>ldc</i><td><a name="87568"></a> <tr><td><a name="69332"></a> <i>index</i><td><a name="87568"></a> </Table><Table><tr><td></Table><p><a name="ldc.Forms"></a><b>Forms</b><br><a name="69334"></a><i>ldc</i><em> </em>= 18 (0x12)<p><a name="ldc.Stack"></a><b>Stack</b><br><a name="69335"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>item</i><p><a name="ldc.Description"></a><b>Description</b><br><a name="69336"></a>The <i>index</i> is an unsigned byte that must be a valid index into the constant pool of the current class <a href="Overview.doc.html#17257">(§3.6)</a>. The constant pool entry at <i>index</i> must be a <code>CONSTANT_Integer</code> <a href="ClassFile.doc.html#21942">(§4.4.4)</a>, <code>CONSTANT_Float</code> <a href="ClassFile.doc.html#21942">(§4.4.4)</a>, or <code>CONSTANT_String</code> <a href="ClassFile.doc.html#8794">(§4.4.3)</a>. The constant pool entry is resolved (<a href="ConstantPool.doc.html#38759">§5.4</a>, <a href="ConstantPool.doc.html#49466">§5.5)</a>. If the entry is a <code>CONSTANT_Integer</code> or <code>CONSTANT_Float</code>, it must contain a numeric <i>item</i> which is pushed onto the operand stack as an <code>int</code> or <code>float</code>, respectively.<p><a name="69352"></a>If the entry at <i>index</i> is a <code>CONSTANT_String</code>, it must contain a <code>CONSTANT_Utf8</code> <a href="ClassFile.doc.html#7963">(§4.4.7)</a> string. An instance of class <code>String</code> is created and initialized to the <code>CONSTANT_Utf8</code> string. The <i>item</i>, a <code>reference</code> to the instance, is pushed onto the operand stack.<p><a name="ldc.Linking"></a><b>Linking Exceptions</b><br><a name="117410"></a>During resolution of a <code>CONSTANT_String </code>constant pool item, any of the exceptions documented in <a href="ConstantPool.doc.html#38759">§5.4</a> can be thrown.<p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc134.html">Prev</a> | <a href="Instructions2.doc136.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><p><font size=-1>Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)<br><i><a href="Copyright.doc.html">Copyright © 1996 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 + -