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

📄 quick2.doc.html

📁 Jvm 规范说明。The Java Virtual Machine was designed to support the Java programming language. Some concep
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<b>Forms</h3></b>
<a name="12456"></a>
<i>invokeinterface_quick</i> = 218 (0xda)<p>
<a name="invokeinterface_quick.Stack"></a>
<b>Stack</h3></b>
<a name="5258"></a>
 ...<em>, </em><i>objectref</i><em>, [</em><i>arg1</i><em>, [</em><i>arg2</i><em> </em>...<em>]] </em><img src="chars/arrwdbrt.gif"> ...<p>
<a name="invokeinterface_quick.Description"></a>
<b>Description</h3></b>
<a name="11638"></a>
The unsigned <i>idbyte1</i> and <i>idbyte2</i> are used to construct an identifier for the name and descriptor <a href="ClassFile.doc.html#7035">(&#167;4.3.3)</a> of the desired method, where the value of the identifier is (<i>idbyte1</i> << 8) | <i>idbyte2</i>. <p>
<a name="11642"></a>
The <i>nargs</i> operand is an unsigned byte which must not be zero. The <i>objectref</i> must be of type <code>reference</code> and must be followed on the operands stack by <i>nargs</i> - 1 words of arguments. The method table of the class of the type of <i>objectref</i> is determined. If <i>objectref</i> is an array type, then the method table of class <code>Object</code> is used.<p>
<a name="11615"></a>
The unsigned <i>guess</i> is used to index into the method table. If there is a method at index <i>guess</i>, and if its identifier is identical to the constructed identifier, then that method is selected. Otherwise, the method table is searched for a method whose identifier is identical to the constructed identifier. If one is found, the current value of <i>guess</i> is overwritten by that index.<p>
<a name="11655"></a>
The result of the search is a method table entry, which includes a direct reference to the code for the interface method and the method's modifier information ((see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>). The method table entry must be that of a <code>public</code> method.<p>

<a name="invokeinterface_quick"></a>
<hr><h2>invokeinterface_quick</h2>
<a name="18526"></a>
If the method is <code>synchronized</code>, the monitor associated with <i>objectref</i> is acquired.<p>
<a name="18527"></a>
If the method is not <code>native</code>, the <i>nargs </i>- 1 words of arguments and <i>objectref</i> are popped from the operand stack. A new stack frame is created for the method being invoked, and <i>objectref</i> and the words of arguments are made the values of its first <i>nargs</i> local variables, with <i>objectref</i> in local variable <i>0</i>, <i>arg1</i> in local variable <i>1</i>, and so on. The new stack frame is then made current, and the Java Virtual Machine <code>pc</code> is set to the opcode of the first instruction of the method to be invoked. Execution continues with the first instruction of the method.<p>
<a name="18528"></a>
If the method is <code>native</code> and the platform-dependent code that implements it has not yet been loaded and linked into the Java Virtual Machine, that is done. The <i>nargs </i>- 1 words of arguments and <i>objectref</i> are popped from the operand stack; the code that implements the method is invoked in an implementation-dependent manner.<p>
<a name="invokeinterface_quick.Linking"></a>
<b>Linking Exceptions</h3></b>
<a name="12075"></a>
If no method matching the resolved name and descriptor can be found in the class of <i>objectref</i>, <i>invokeinterface_quick</i> throws an <code>IncompatibleClassChangeError</code>.<p>
<a name="11782"></a>
 Otherwise, if the selected method is a class (<code>static</code>) method, the <i>invokeinterface_quick</i> instruction throws an <code>IncompatibleClassChangeError</code>.<p>
<a name="11783"></a>
 Otherwise, if the selected method is not <code>public</code>, the <i>in-vokeinterface_quick</i> instruction throws an <code>IllegalAccess-Error</code>.<p>
<a name="12163"></a>
 Otherwise, if the selected method is <code>abstract</code>, <i>invoke-interface_quick</i> throws an <code>AbstractMethodError</code>.<p>
<a name="12164"></a>
 Otherwise, if the selected method is <code>native</code> and the code that implements the method cannot be loaded or linked, <i>invoke-interface_quick </i>throws an <code>UnsatisfiedLinkError</code>.<p>

<a name="invokeinterface_quick"></a>
<hr><h2>invokeinterface_quick</h2>
<a name="invokeinterface_quick.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="5268"></a>
Otherwise, if <i>objectref</i> is <code>null</code>, the <i>invokeinterface_quick</i> instruction throws a <code>NullPointerException</code>. <p>
<a name="invokeinterface_quick.Notes"></a>
<b>Notes</h3></b>
<a name="5270"></a>
The opcode of this instruction was originally <i>invokeinterface</i>. The initial value of <i>guess</i> is 0, the operand value supplied by <i>invokeinterface</i>. The identifiers being compared and stored in the <i>invokeinterface_quick</i> instruction encode a method name and descriptor as a 16-bit quantity that can be compared quickly. The details of the encoding are implementation-specific. The bytes of the identifier for the method being invoked, <i>idbyte1</i> and <i>idbyte2</i>, replace the original constant pool index bytes. The identifier can be calculated when each method is loaded, or at run time. The value of the <i>nargs</i> operand is not modified.<p>

<a name="invokenonvirtual_quick"></a>
<hr><h2>invokenonvirtual_quick</h2>
<a name="invokenonvirtual_quick.Operation"></a>
<b>Operation</h3></b>
<a name="12217"></a>
Invoke an instance initialization method or a private method, dispatching based on compile-time type<p><Table Border="1">
<tr><td><a name="12212"></a>
 <i>invokenonvirtual_quick</i>
<td><a name="664"></a>
 

<tr><td><a name="12214"></a>
 <i>indexbyte1</i>
<td><a name="671"></a>
 

<tr><td><a name="12216"></a>
 <i>indexbyte2</i>
<td><a name="678"></a>
 

</Table><br><br><p>
<a name="invokenonvirtual_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12457"></a>
<i>invokenonvirtual_quick</i> = 215 (0xd7)<p>
<a name="invokenonvirtual_quick.Stack"></a>
<b>Stack</h3></b>
<a name="12218"></a>
 ...<em>, </em><i>objectref</i><em>, [</em><i>arg1</i><em>, [</em><i>arg2</i><em> </em>...<em>]] </em><img src="chars/arrwdbrt.gif">  ...<p>
<a name="invokenonvirtual_quick.Description"></a>
<b>Description</h3></b>
<a name="12219"></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">(&#167;3.6)</a>, where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item at the index must be a <code>CONSTANT_Methodref</code> <a href="ClassFile.doc.html#4723">(&#167;4.4.2)</a> which must already have been resolved successfully. The constant pool entry representing the resolved method includes a direct reference to the code for the method, an unsigned byte <i>nargs</i> which must be greater than zero, and the method's modifier information (see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>).<p>
<a name="18530"></a>
If the method is <code>synchronized</code>, the monitor associated with <i>objectref</i> is acquired.<p>
<a name="18531"></a>
If the method is not <code>native</code>, the <i>nargs </i>- 1 words of arguments and <i>objectref</i> are popped from the operand stack. A new stack frame is created for the method being invoked, and <i>objectref</i> and the words of arguments are made the values of its first <i>nargs</i> local variables, with <i>objectref</i> in local variable <i>0</i>, <i>arg1</i> in local variable <i>1</i>, and so on. The new stack frame is then made current, and the Java Virtual Machine <code>pc</code> is set to the opcode of the first instruction of the method to be invoked. Execution continues with the first instruction of the method.<p>
<a name="18532"></a>
If the method is <code>native</code>, the <i>nargs </i>- 1 words of arguments and <i>objectref</i> are popped from the operand stack; the code that implements the method is invoked in an implementation-dependent manner.<p>
<a name="invokenonvirtual_quick.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="12339"></a>
If <i>objectref</i> is <code>null</code>, the <i>invokenonvirtual_quick</i> instruction throws a <code>NullPointerException</code>.<p>
<a name="invokenonvirtual_quick.Notes"></a>
<b>Notes</h3></b>
<a name="12233"></a>
The opcode of this instruction was originally <i>invokespecial</i>, and the method it invoked was determined dynamically to be either an instance initialization method <code>&lt;init&gt;</code> or a <code>private</code> method. The operands of the <i>invokespecial</i> instruction are not modified.<p>
<a name="18418"></a>
The difference between the <i>invokenonvirtual_quick</i> and the <i>in-vokevirtual_quick_w</i> instructions is that <i>invokevirtual_quick_w</i> invokes a method based on the actual (runtime) type of the object. The <i>invokenonvirtual_quick</i> instruction invokes an instance initialization method or <code>private</code> method based on the compile-time type of the object.<p>

<a name="invokesuper_quick"></a>
<hr><h2>invokesuper_quick</h2>
<a name="invokesuper_quick.Operation"></a>
<b>Operation</h3></b>
<a name="5203"></a>
Invoke a superclass method, dispatching based on compile-time type<p><Table Border="1">
<tr><td><a name="5198"></a>
 <i>invokesuper_quick</i>
<td><a name="326"></a>
 

<tr><td><a name="5200"></a>
 <i>indexbyte1</i>
<td><a name="333"></a>
 

<tr><td><a name="5202"></a>
 <i>indexbyte2</i>
<td><a name="340"></a>
 

</Table><br><br><p>
<a name="invokesuper_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12458"></a>
<i>invokesuper_quick</i> = 216 (0xd8)<p>
<a name="invokesuper_quick.Stack"></a>
<b>Stack</h3></b>
<a name="5204"></a>
...<em>, </em><i>objectref</i><em>, [</em><i>arg1</i><em>, [</em><i>arg2</i><em> </em>...<em>]] </em><img src="chars/arrwdbrt.gif">  ...<p>
<a name="invokesuper_quick.Description"></a>
<b>Description</h3></b>
<a name="12282"></a>
The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are used to construct an index into the method table of the superclass of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>, where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The specified method table entry includes a direct reference to the code for the method, an unsigned byte <i>nargs</i> which must be greater than zero, and the method's modifier information (see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>).<p>
<a name="18545"></a>
If the method is <code>synchronized</code>, the monitor associated with <i>objectref</i> is acquired.<p>
<a name="18546"></a>
If the method is not <code>native</code>, the <i>nargs </i>- 1 words of arguments and <i>objectref</i> are popped from the operand stack. A new stack frame is created for the method being invoked, and <i>objectref</i> and the words of arguments are made the values of its first <i>nargs</i> local variables, with <i>objectref</i> in local variable <i>0</i>, <i>arg1</i> in local variable <i>1</i>, and so on. The new stack frame is then made current, and the Java Virtual Machine <code>pc</code> is set to the opcode of the first instruction of the method to be invoked. Execution continues with the first instruction of the method.<p>
<a name="18547"></a>
If the method is <code>native</code>, the <i>nargs </i>- 1 words of arguments and <i>objectref</i> are popped from the operand stack; the code that implements the method is invoked in an implementation-dependent manner.<p>
<b>Runtime Exception</h3></b>
<a name="5211"></a>
If <i>objectref</i> is <code>null</code>, the <i>invokesuper_quick</i> instruction throws a <code>NullPointerException</code>.<p>
<a name="invokesuper_quick.Notes"></a>
<b>Notes</h3></b>
<a name="12259"></a>
The opcode of this instruction was originally <i>invokespecial</i>, and the method it invoked was determined dynamically to be a method in a superclass of the current object. The operands of the <i>invokespecial</i> instruction are not modified.<p>
<a name="11950"></a>
The difference between the <i>invokesuper_quick</i> and the <i>invokevirtual_quick_w</i> instructions is that <i>invokevirtual_quick_w</i> invokes a method based on the class of the object. The <i>invokesuper_quick</i> instruction is used to invoke methods in a superclass of the current class. <p>
<a name="11952"></a>
The <i>invokesuper_quick</i> instruction was introduced in Sun's JDK 1.0.2 release to fix a bug in earlier versions of the Java Virtual Machine. Prior to that release, the <i>invokespecial</i> instruction (then named <i>invokenonvirtual</i>) would always be converted to the <i>invokenonvirtual_quick</i> instruction.<p>
<a name="11948"></a>
<p>

<a name="invokestatic_quick"></a>
<hr><h2>invokestatic_quick</h2>
<a name="invokestatic_quick.Operation"></a>
<b>Operation</h3></b>
<a name="5230"></a>
Invoke a class (static) method<p><Table Border="1">
<tr><td><a name="5225"></a>
 <i>invokestatic_quick</i>
<td><a name="52"></a>
 

<tr><td><a name="5227"></a>
 <i>indexbyte1</i>
<td><a name="59"></a>
 

<tr><td><a name="5229"></a>
 <i>indexbyte2</i>
<td><a name="66"></a>
 

</Table><br><br><p>
<a name="invokestatic_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12459"></a>
<i>invokestatic_quick</i> = 217 (0xd9)<p>
<a name="invokestatic_quick.Stack"></a>
<b>Stack</h3></b>
<a name="5231"></a>
...<em>, [</em><i>arg1</i><em>, [</em><i>arg2</i><em> </em>...<em>]] </em><img src="chars/arrwdbrt.gif">  ...<p>
<a name="invokestatic_quick.Description"></a>
<b>Description</h3></b>
<a name="11579"></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">(&#167;3.6)</a>, where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item at the index must be a <code>CONSTANT_Methodref</code> <a href="ClassFile.doc.html#4723">(&#167;4.4.2)</a> which must already have been resolved successfully.<p>
<a name="11586"></a>
The constant pool entry representing the resolved method includes a direct reference to the code for the method, an unsigned byte <i>nargs</i> which may be zero, and the method's modifier information (see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>).<p>
<a name="18563"></a>
If the method is <code>synchronized</code>, the monitor associated with the current class is acquired.<p>
<a name="18564"></a>
If the method is not <code>native</code>, the <i>nargs </i>words of arguments are popped from the operand stack. A new stack frame is created for the method being invoked, and the words of arguments are made the values of its first <i>nargs</i> local variables, with <i>arg1</i> in local variable <i>0</i>, <i>arg2</i> in local variable <i>1</i>, and so on. The new stack frame is then made current, and the Java Virtual Machine <code>pc</code> is set to the opcode of the first instruction of the method to be invoked. Execution continues with the first instruction of the method.<p>
<a name="18565"></a>
If the method is <code>native</code>, the <i>nargs </i>words of arguments are popped from the operand stack; the code that implements the method is invoked in an implementation-dependent manner.<p>
<a name="invokestatic_quick.Notes"></a>
<b>Notes</h3></b>
<a name="5239"></a>
The opcode of this instruction was originally <i>invokestatic</i>. The operands of the <i>invokestatic</i> instruction are not modified.<p>

<a name="invokevirtual_quick"></a>
<hr><h2>invokevirtual_quick</h2>
<a name="invokevirtual_quick.Operation"></a>
<b>Operation</h3></b>
<a name="5161"></a>
Invoke instance method<p><Table Border="1">
<tr><td><a name="5156"></a>
 <i>invokevirtual_quick</i>
<td><a name="156"></a>
 

<tr><td><a name="5158"></a>
 <i>index</i>
<td><a name="163"></a>
 

<tr><td><a name="5160"></a>
 <i>nargs</i>
<td><a name="170"></a>
 

</Table><br><br>; dispatch based on class<p>
<a name="invokevirtual_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12460"></a>
<i>invokevirtual_quick</i> = 214 (0xd6)<p>
<a name="invokevirtual_quick.Stack"></a>
<b>Stack</h3></b>

⌨️ 快捷键说明

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