⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 instructions2.doc.html

📁 A Java virtual machine instruction consists of an opcode specifying the operation to be performed, f
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!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><table width=100%><tr><td><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions.doc.html">Prev</a> | <a href="Instructions2.doc1.html">Next</a> | <a href="VMSpecIX.fm.html">Index</a></td><td align=right><i><i>The Java<sup><font size=-2>TM</font></sup> Virtual Machine Specification</i></i></td></tr></table><hr><br> <a href="Instructions2.doc.html">A</a><a href="Instructions2.doc1.html">B</a><a href="Instructions2.doc2.html">C</a><a href="Instructions2.doc3.html">D</a><a href="Instructions2.doc4.html">F</a><a href="Instructions2.doc5.html">G</a><a href="Instructions2.doc6.html">I</a><a href="Instructions2.doc7.html">J</a><a href="Instructions2.doc8.html">L</a><a href="Instructions2.doc9.html">M</a><a href="Instructions2.doc10.html">N</a><a href="Instructions2.doc11.html">P</a><a href="Instructions2.doc12.html">R</a><a href="Instructions2.doc13.html">S</a><a href="Instructions2.doc14.html">T</a><a href="Instructions2.doc15.html">W</a><a name="aaload"></a><hr><h2>aaload</h2><a name="aaload.Operation"></a><p><b>Operation</b><br><blockquote><a name="67085"></a>Load <code>reference</code> from array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67084"></a> <i>aaload</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="aaload.Forms"></a><p><b>Forms</b><br><blockquote><a name="67086"></a><i>aaload</i> = 50 (0x32)</blockquote><p><a name="aaload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67087"></a>..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value</i></blockquote><p><a name="aaload.Description"></a><p><b>Description</b><br><blockquote><a name="67088"></a>The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>reference</code>. The <i>index</i> must be of type <code>int</code>. Both <i>arrayref</i> and <i>index</i> are popped from the operand stack. The <code>reference</code> <i>value</i> in the component of the array at <i>index</i> is retrieved and pushed onto the operand stack.</blockquote><p><a name="aaload.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="159627"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>aaload</i> throws a <code>NullPointerException</code>. </blockquote><p><blockquote><a name="159628"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>aaload</i> instruction throws an <code>ArrayIndex</code><code>OutOfBoundsException</code>.</blockquote><p><a name="aastore"></a><hr><h2>aastore</h2><a name="aastore.Operation"></a><p><b>Operation</b><br><blockquote><a name="67098"></a>Store into <code>reference</code> array<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67097"></a> <i>aastore</i><td><a name="87833"></a> </Table><br></blockquote><p><a name="aastore.Forms"></a><p><b>Forms</b><br><blockquote><a name="67099"></a><i>aastore</i> = 83 (0x53)</blockquote><p><a name="aastore.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67100"></a>..., <i>arrayref</i>, <i>index</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="aastore.Description"></a><p><b>Description </b><br><blockquote><a name="92036"></a>The <i>arrayref</i> must be of type <code>reference</code> and must refer to an array whose components are of type <code>reference</code>. The <i>index</i> must be of type <code>int</code> and <i>value</i> must be of type <code>reference</code>. The <i>arrayref</i>, <i>index</i>, and <i>value</i> are popped from the operand stack. The <code>reference</code> <i>value</i> is stored as the component of the array at <i>index</i>.</blockquote><p><blockquote><a name="67105"></a>The type of <i>value</i> must be assignment compatible <a href="Concepts.doc.html#19674">(&#167;2.6.7)</a> with the type of the components of the array referenced by <i>arrayref</i>. Assignment of a value of reference type S (source) to a variable of reference type T (target) is allowed only when the type S supports all the operations defined on type T. The detailed rules follow:</blockquote><p><ul><li>If S is a class type, then:<p><ul><li>If T is a class type, then S must be the same class <a href="Concepts.doc.html#20389">(&#167;2.8.1)</a> as T, or S must be a subclass of T;<p><li>If T is an interface type, S must implement <a href="Concepts.doc.html#16432">(&#167;2.13)</a> interface T.<p></ul><li>If S is an interface type, then:<p><ul><li>If T is a class type, then T must be <code>Object</code> <a href="Concepts.doc.html#27433">(&#167;2.4.7)</a>.<p><li>If T is an interface type, then T must be the same interface as S or a superinterface of S <a href="Concepts.doc.html#20603">(&#167;2.13.2)</a>.<p><a name="aastore"></a></ul><li>If S is an array type, namely, the type SC<code>[]</code>, that is, an array of components of type SC, then:<p><ul><li>If T is a class type, then T must be <code>Object</code> <a href="Concepts.doc.html#27433">(&#167;2.4.7)</a>.<p><li>If T is an array type TC<code>[]</code>, that is, an array of components of type TC, then one of the following must be true:<p><ul><li>TC and SC are the same primitive type <a href="Concepts.doc.html#19511">(&#167;2.4.1)</a>.<p><li>TC and SC are reference types <a href="Concepts.doc.html#29375">(&#167;2.4.6)</a>, and type SC is assignable to TC by these runtime rules. <p></ul><li>If T is an interface type, T must be one of the interfaces implemented by arrays <a href="Concepts.doc.html#16446">(&#167;2.15)</a>. </ul></ul><a name="aastore.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="67116"></a>If <i>arrayref</i><em> </em>is <code>null</code>, <i>aastore</i> throws a <code>NullPointerException</code>.</blockquote><p><blockquote><a name="67117"></a>Otherwise, if <i>index</i> is not within the bounds of the array referenced by <i>arrayref</i>, the <i>aastore</i> instruction throws an <code>ArrayIndexOutOfBoundsException</code>.</blockquote><p><blockquote><a name="67118"></a>Otherwise, if <i>arrayref</i> is not <code>null</code> and the actual type of <i>value</i> is not assignment compatible <a href="Concepts.doc.html#19674">(&#167;2.6.7)</a> with the actual type of the components of the array, <i>aastore</i> throws an <code>ArrayStoreException</code>. </blockquote><p><blockquote><a name="67122"></a></blockquote><p><a name="aconst_null"></a><hr><h2>aconst_null</h2><a name="aconst_null.Operation"></a><p><b>Operation</b><br><blockquote><a name="67132"></a>Push <code>null</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67131"></a> <i>aconst_null</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="aconst_null.Forms"></a><p><b>Forms</b><br><blockquote><a name="67133"></a><i>aconst_null</i> = 1 (0x1)	</blockquote><p><a name="aconst_null.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67134"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>null</i></blockquote><p><a name="aconst_null.Description"></a><p><b>Description</b><br><blockquote><a name="67135"></a>Push the <code>null</code> object <code>reference</code> onto the operand stack.</blockquote><p><a name="aconst_null.Notes"></a><p><b>Notes</b><br><blockquote><a name="67136"></a>The Java virtual machine does not mandate a concrete value for <code>null</code>.</blockquote><p><a name="aload"></a><hr><h2>aload&#32;</h2><a name="aload.Operation"></a><p><b>Operation</b><br><blockquote><a name="67145"></a>Load <code>reference</code> from local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67142"></a> <i>aload</i><td><a name="87568"></a> <tr><td><a name="67144"></a> <i>index</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="aload.Forms"></a><p><b>Forms</b><br><blockquote><a name="67146"></a><i>aload</i> = 25 (0x19)</blockquote><p><a name="aload.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67147"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>objectref</i></blockquote><p><a name="aload.Description"></a><p><b>Description</b><br><blockquote><a name="67148"></a>The <i>index</i> is an unsigned byte that must be an index into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The local variable at <i>index</i> must contain a <code>reference</code>. The <i>objectref</i> in the local variable at <i>index</i> is pushed onto the operand stack.</blockquote><p><a name="aload.Notes"></a><p><b>Notes</b><br><blockquote><a name="67152"></a>The <i>aload</i> instruction cannot be used to load a value of type <code>returnAddress</code> from a local variable onto the operand stack. This asymmetry with the <i>astore</i> instruction is intentional.</blockquote><p><blockquote><a name="87844"></a>The <i>aload</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.</blockquote><p><a name="aload_n"></a><hr><h2>aload_&lt;n&gt;</h2><a name="aload_n.Operation"></a><p><b>Operation</b><br><blockquote><a name="67163"></a>Load <code>reference</code> from local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67162"></a> <i>aload_&lt;n&gt;</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="aload_n.Forms"></a><p><b>Forms</b><br><blockquote><a name="67164"></a><i>aload_0</i> = 42 (0x2a) <i>aload_1</i> = 43 (0x2b) <i>aload_2</i> = 44 (0x2c) <i>aload_3</i> = 45 (0x2d)</blockquote><p><a name="aload_n.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="67165"></a>... <img src="chars/arrwdbrt.gif"> ..., <i>objectref</i></blockquote><p><a name="aload_n.Description"></a><p><b>Description</b><br><blockquote><a name="67166"></a>The <i>&lt;n&gt;</i> must be an index into the local variable array of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a>. The local variable at <i>&lt;n&gt;</i> must contain a <code>reference</code>. The <i>objectref</i> in the local variable at <i>index</i> is pushed onto the operand stack.</blockquote><p><a name="aload_n.Notes"></a><p><b>Notes</b><br><blockquote><a name="67170"></a>An <i>aload_&lt;n&gt;</i> instruction cannot be used to load a value of type <code>returnAddress</code> from a local variable onto the operand stack. This asymmetry with the corresponding <i>astore_&lt;n&gt;</i> instruction is intentional. Each of the <i>aload_&lt;n&gt;</i> instructions is the same as <i>aload</i> with an <i>index</i> of <i>&lt;n&gt;</i>, except that the operand <i>&lt;n&gt;</i> is implicit.</blockquote><p><a name="anewarray"></a><hr><h2>anewarray</h2><a name="anewarray.Operation"></a><p><b>Operation</b><br><blockquote><a name="67181"></a>Create new array of <code>reference</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="67176"></a> <i>anewarray</i><td><a name="87568"></a>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -