📄 quick2.doc3.html
字号:
<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>
<p>
<a name="instanceof_quick.Forms"></a>
<b>Forms</b><br>
<a name="12457"></a>
<i>invokenonvirtual_quick</i> = 215 (0xd7)<p>
<a name="instanceof_quick.Stack"></a>
<b>Stack</b><br>
<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="instanceof_quick.Description"></a>
<b>Description</b><br>
<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">(§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">(§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="22182"></a>
invokenonvirtual_quick (cont.) invokenonvirtual_quick (cont.)<p>
<a name="instanceof_quick.Runtime"></a>
<b>Runtime Exception</b><br>
<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="instanceof_quick.Notes"></a>
<b>Notes</b><br>
<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><init></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="5193"></a>
invokesuper_quick invokesuper_quick<p>
<a name="instanceof_quick.Operation"></a>
<b>Operation</b><br>
<a name="5203"></a>
Invoke a superclass method, dispatching based on compile-time type<p>
<Table Border="0">
<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>
<p>
<a name="instanceof_quick.Forms"></a>
<b>Forms</b><br>
<a name="12458"></a>
<i>invokesuper_quick</i> = 216 (0xd8)<p>
<a name="instanceof_quick.Stack"></a>
<b>Stack</b><br>
<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="instanceof_quick.Description"></a>
<b>Description</b><br>
<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">(§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>
<a name="22197"></a>
invokesuper_quick (cont.) invokesuper_quick (cont.)<p>
<a name="instanceof_quick.Runtime"></a>
<b>Runtime Exception</b><br>
<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="instanceof_quick.Notes"></a>
<b>Notes</b><br>
<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="5220"></a>
<a href="Quick2.doc.html#">invokestatic_quick invokestatic_quick</a><p>
<a name="instanceof_quick.Operation"></a>
<b>Operation</b><br>
<a name="5230"></a>
Invoke a class (static) method<p>
<Table Border="0">
<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>
<p>
<a name="instanceof_quick.Forms"></a>
<b>Forms</b><br>
<a name="12459"></a>
<i>invokestatic_quick</i> = 217 (0xd9)<p>
<a name="instanceof_quick.Stack"></a>
<b>Stack</b><br>
<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="instanceof_quick.Description"></a>
<b>Description</b><br>
<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">(§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">(§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="instanceof_quick.Notes"></a>
<b>Notes</b><br>
<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="5151"></a>
invokevirtual_quick invokevirtual_quick<p>
<a name="instanceof_quick.Operation"></a>
<b>Operation</b><br>
<a name="5161"></a>
Invoke instance method<p>
<Table Border="0">
<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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -