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

📄 instructions2.doc.html

📁 Jvm 规范说明。The Java Virtual Machine was designed to support the Java programming language. Some concep
💻 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="Lindholm.INDEX.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 name="aaload"></a>
<h2>aaload</h2>
<a name="aaload.Operation"></a>
<b>Operation</h3></b>
<a name="67085"></a>
Load <code>reference</code> from array<p><Table Border="1">
<tr><td><a name="67084"></a>
 <i>aaload</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="aaload.Forms"></a>
<b>Forms</h3></b>
<a name="67086"></a>
<i>aaload</i> = 50 (0x32)<p>
<a name="aaload.Stack"></a>
<b>Stack</h3></b>
<a name="67087"></a>
..., <i>arrayref</i>, <i>index</i> <img src="chars/arrwdbrt.gif"> ..., <i>value</i><p>
<a name="aaload.Description"></a>
<b>Description</h3></b>
<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 top of the operand stack.<p>
<a name="aaload.Runtime"></a>
<b>Runtime Exceptions</h3></b>
<a name="159627"></a>
If <i>arrayref</i><em> </em>is <code>null</code>, <i>aaload</i> throws a <code>NullPointerException</code>. <p>
<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-OutOfBounds-Exception</code>.<p>

<a name="aastore"></a>
<hr><h2>aastore</h2>
<a name="aastore.Operation"></a>
<b>Operation</h3></b>
<a name="67098"></a>
Store into <code>reference</code> array<p><Table Border="1">
<tr><td><a name="67097"></a>
 <i>aastore</i>
<td><a name="87833"></a>
 

</Table><br><br><p>
<a name="aastore.Forms"></a>
<b>Forms</h3></b>
<a name="67099"></a>
<i>aastore</i> = 83 (0x53)<p>
<a name="aastore.Stack"></a>
<b>Stack</h3></b>
<a name="67100"></a>
..., <i>arrayref</i>, <i>index</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="aastore.Description"></a>
<b>Description </h3></b>
<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>.<p>
<a name="67105"></a>
The type of <i>value</i> must be assignment compatible <a href="Concepts.doc.html#19674">(&#167;2.6.6)</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:<p>
<ul><a name="67106"></a>
<li>If S is a class type, then:
<ul>
<a name="67107"></a>
<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;
<a name="67108"></a>
<li>If T is an interface type, S must implement <a href="Concepts.doc.html#16432">(&#167;2.13)</a> interface T.
</ul>
</ul>
<a name="aastore"></a>
<ul><a name="158140"></a>
<li>If S is an array type, namely the type SC<code>[]</code>, that is, an array of components of type SC, then:
<ul>
<a name="158144"></a>
<li>If T is a class type, T must be <code>Object</code> <a href="Concepts.doc.html#27433">(&#167;2.4.6)</a>, or:
<ul>
<a name="67112"></a>
<li>If T is an array type, namely the type TC<code>[]</code>, an array of components of type TC, then eitherTC and SC must be the same primitive type, or
<a name="67113"></a>
<li>TC and SC must both be reference types with type SC assignable to TC, by these rules.
</ul>
</ul>
</ul><a name="67114"></a>
S cannot be an interface type, because there are no instances of interfaces, only instances of classes and arrays.<p>
<a name="aastore.Runtime"></a>
<b>Runtime Exceptions</h3></b>
<a name="67116"></a>
If <i>arrayref</i><em> </em>is <code>null</code>, <i>aastore</i> throws a <code>NullPointerException</code>.<p>
<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>ArrayIndex</code><code>-OutOfBounds-Exception</code>.<p>
<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.6)</a> with the actual type of the components of the array, <i>aastore</i> throws an <code>ArrayStoreException</code>. <p>
<a name="67122"></a>
<p>

<a name="aconst_null"></a>
<hr><h2>aconst_null</h2>
<a name="aconst_null.Operation"></a>
<b>Operation</h3></b>
<a name="67132"></a>
Push <code>null</code><p><Table Border="1">
<tr><td><a name="67131"></a>
 <i>aconst_null</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="aconst_null.Forms"></a>
<b>Forms</h3></b>
<a name="67133"></a>
<i>aconst_null</i> = 1 (0x1)	<p>
<a name="aconst_null.Stack"></a>
<b>Stack</h3></b>
<a name="67134"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>null</i><p>
<a name="aconst_null.Description"></a>
<b>Description</h3></b>
<a name="67135"></a>
Push the <code>null</code> object <code>reference</code> onto the operand stack.<p>
<a name="aconst_null.Notes"></a>
<b>Notes</h3></b>
<a name="67136"></a>
The Java Virtual Machine does not mandate a concrete value for <code>null</code>.<p>

<a name="aload"></a>
<hr><h2>aload</h2>
<a name="aload.Operation"></a>
<b>Operation</h3></b>
<a name="67145"></a>
Load <code>reference</code> from local variable<p><Table Border="1">
<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><br><p>
<a name="aload.Forms"></a>
<b>Forms</h3></b>
<a name="67146"></a>
<i>aload</i> = 25 (0x19)<p>
<a name="aload.Stack"></a>
<b>Stack</h3></b>
<a name="67147"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>objectref</i><p>
<a name="aload.Description"></a>
<b>Description</h3></b>
<a name="67148"></a>
The <i>index</i> is an unsigned byte that must be a valid index into the local variables 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.<p>
<a name="aload.Notes"></a>
<b>Notes</h3></b>
<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.<p>
<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.<p>

<a name="aload_n"></a>
<hr><h2>aload_&lt;n&gt;</h2>
<a name="aload_n.Operation"></a>
<b>Operation</h3></b>
<a name="67163"></a>
Load <code>reference</code> from local variable<p><Table Border="1">
<tr><td><a name="67162"></a>
 <i>aload_&lt;n&gt;</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="aload_n.Forms"></a>
<b>Forms</h3></b>
<a name="67164"></a>
<i>aload_0</i> = 42 (0x2a)<i></i><p>
<a name="177901"></a>
<i>aload_1</i> = 43 (0x2b)<i></i><p>
<a name="177903"></a>
<i>aload_2</i> = 44 (0x2c)<i></i><p>
<a name="177905"></a>
<i>aload_3</i> = 45 (0x2d)<p>
<a name="aload_n.Stack"></a>
<b>Stack</h3></b>
<a name="67165"></a>
... <img src="chars/arrwdbrt.gif"> ..., <i>objectref</i><p>
<a name="aload_n.Description"></a>
<b>Description</h3></b>
<a name="67166"></a>
The <i>&lt;n&gt;</i> must be a valid index into the local variables 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.<p>
<a name="aload_n.Notes"></a>
<b>Notes</h3></b>
<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.<p>

<a name="anewarray"></a>
<hr><h2>anewarray</h2>
<a name="anewarray.Operation"></a>
<b>Operation</h3></b>
<a name="67181"></a>
Create new array<p><Table Border="1">
<tr><td><a name="67176"></a>
 <i>anewarray</i>
<td><a name="87568"></a>
 

<tr><td><a name="67178"></a>
 <i>indexbyte1</i>
<td><a name="87568"></a>
 

<tr><td><a name="67180"></a>

⌨️ 快捷键说明

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