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

📄 quick2.doc.html

📁 Jvm 规范说明。The Java Virtual Machine was designed to support the Java programming language. Some concep
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<a name="5162"></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="invokevirtual_quick.Description"></a>
<b>Description</h3></b>
<a name="11507"></a>
The <i>objectref</i> must be of type <code>reference</code> and must reference a class instance. The <i>index</i> operand is an unsigned byte, and the <i>nargs</i> operand is an unsigned byte, which must not be zero. The <i>index</i> is an index into the method table of the class of the type of <i>objectref</i>. The table entry at that index includes the method's code and its modifier information (see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>).<p>
<a name="18595"></a>
If the method is <code>synchronized</code>, the monitor associated with <i>objectref</i> is acquired.<p>
<a name="22239"></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="invokevirtual_quick"></a>
<a name="22241"></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="invokevirtual_quick.Linking"></a>
<b>Linking Exception</h3></b>
<a name="12125"></a>
If the specified method is <code>native</code> and the code that implements the method cannot be loaded or linked, the <i>invokevirtual_quick</i> instruction throws an <code>UnsatisfiedLinkError</code>.<p>
<a name="invokevirtual_quick.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="5166"></a>
Otherwise, if <i>objectref</i> is <code>null</code>, the <i>invokevirtual_quick</i> instruction throws a <code>NullPointerException</code>. <p>
<a name="invokevirtual_quick.Notes"></a>
<b>Notes</h3></b>
<a name="5168"></a>
The opcode of this instruction was originally <i>invokevirtual</i>, with <i>objectref</i> not referring to an instance of <code>java.lang.Object</code> and with operands determined dynamically to represent a method with a method table index of 255 or less. When the constant pool entry referenced by an <i>invokevirtual</i> instruction is resolved, a one-byte index for the method it references is generated. That index replaces the first operand byte of the original <i>invokevirtual</i> instruction. The second operand byte of the <i>invokevirtual</i> instruction is replaced by <i>nargs</i>, the number of argument words expected by the method.<p>
<a name="12640"></a>
An <i>invokevirtual</i> instruction referring to an instance of <code>java.lang.Object</code> and with operands representing a constant pool index of 255 or less will instead be converted into an <i>invokevirtualobject_quick</i> instruction. Any <i>invokevirtual</i> instruction with operands representing a constant pool index greater than 255 will be converted into an <i>invokevirtual_quick_w</i> instruction.<p>

<a name="invokevirtual_quick_w"></a>
<hr><h2>invokevirtual_quick_w</h2>
<a name="invokevirtual_quick_w.Operation"></a>
<b>Operation</h3></b>
<a name="6740"></a>
Invoke instance method<p><Table Border="1">
<tr><td><a name="6735"></a>
 <i>invokevirtual_quick_w</i>
<td><a name="638"></a>
 

<tr><td><a name="6737"></a>
 <i>indexbyte1</i>
<td><a name="645"></a>
 

<tr><td><a name="6739"></a>
 <i>indexbyte2</i>
<td><a name="652"></a>
 

</Table><br><br>, dispatching on class (wide index)<p>
<a name="invokevirtual_quick_w.Forms"></a>
<b>Forms</h3></b>
<a name="12461"></a>
<i>invokevirtual_quick_w</i> = 226 (0xe2)<p>
<a name="invokevirtual_quick_w.Stack"></a>
<b>Stack</h3></b>
<a name="6741"></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="invokevirtual_quick_w.Description"></a>
<b>Description</h3></b>
<a name="8709"></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 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 an unsigned <i>index</i> into the method table of the resolved class and an unsigned byte <i>nargs</i> which must not be zero.<p>
<a name="11542"></a>
The <i>objectref</i> must be of type <code>reference</code>. The <i>index</i> is used as an index into the method table of the class of the type of <i>objectref</i>. If the <i>objectref</i> is an array type, then the method table of class <code>Object</code> is used. The table entry at that index includes the method's code and its modifier information (see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>).<p>
<a name="18603"></a>
If the method is <code>synchronized</code>, the monitor associated with <i>objectref</i> is acquired.<p>

<a name="invokevirtual_quick_w"></a>
<a name="18604"></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="18605"></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="invokevirtual_quick_w.Linking"></a>
<b>Linking Exception</h3></b>
<a name="12154"></a>
If the specified method is <code>native</code> and the code that implements the method cannot be loaded or linked, the <i>invokevirtual_quick_w</i> instruction throws an <code>UnsatisfiedLinkError</code>.<p>
<a name="invokevirtual_quick_w.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="6745"></a>
Otherwise, if <i>objectref</i> is <code>null</code>, the <i>invokevirtual_quick_w</i> instruction throws a <code>NullPointerException</code>. <p>
<a name="invokevirtual_quick_w.Notes"></a>
<b>Notes</h3></b>
<a name="6747"></a>
The opcode of this instruction was originally <i>invokevirtual</i>, with operands determined dynamically to represent a method with a method table index greater than 255. The operands of the <i>invokevirtual</i> instruction are not modified.<p>
<a name="9000"></a>
The <i>invokevirtual_quick</i> and <i>invokevirtualobject_quick</i> instructions only support a one-byte offset into the method table of <i>objectref</i>. The <i>invokevirtual_quick_w</i> instruction can be used to for invocations of methods that cannot be represented using <i>invokevirtual_quick</i>.<p>

<a name="invokevirtualobject_quick"></a>
<hr><h2>invokevirtualobject_quick</h2>
<a name="invokevirtualobject_quick.Operation"></a>
<b>Operation</h3></b>
<a name="9288"></a>
Invoke instance method<p><Table Border="1">
<tr><td><a name="9283"></a>
 <i>invokevirtualobject_quick</i>
<td><a name="78"></a>
 

<tr><td><a name="9285"></a>
 <i>index</i>
<td><a name="85"></a>
 

<tr><td><a name="9287"></a>
 <i>nargs</i>
<td><a name="92"></a>
 

</Table><br><br> of class <code>java.lang.Object</code><p>
<a name="invokevirtualobject_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12462"></a>
<i>invokevirtualobject_quick</i> = 219 (0xdb)<p>
<a name="invokevirtualobject_quick.Stack"></a>
<b>Stack</h3></b>
<a name="9289"></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="invokevirtualobject_quick.Description"></a>
<b>Description</h3></b>
<a name="9068"></a>
The <i>objectref</i> must be of type <code>reference</code>. The <i>index</i> operand is an unsigned byte, and the <i>nargs</i> operand is an unsigned byte which must not be zero. The <i>index</i> is an index into the method table of the class of the type of <i>objectref</i>. If the <i>objectref</i> is an array type, then the method table of class <code>Object</code> is used. The table entry at that index includes the method's code and its modifier information (see <a href="ClassFile.doc.html#12725">Table 4.4, "Method access and modifier flags"</a>).<p>
<a name="18607"></a>
If the method is <code>synchronized</code>, the monitor associated with <i>objectref</i> is acquired.<p>
<a name="22862"></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="invokevirtualobject_quick"></a>
<a name="22864"></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="invokevirtualobject_quick.Linking"></a>
<b>Linking Exception</h3></b>
<a name="12194"></a>
If the specified method is <code>native</code> and the code that implements the method cannot be loaded or linked, <i>invokevirtual_quick</i> throws an <code>UnsatisfiedLinkError</code>.<p>
<a name="invokevirtualobject_quick.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="12078"></a>
Otherwise, if <i>objectref</i> is <code>null</code>, the <i>invokevirtualobject_quick</i> instruction throws a <code>NullPointerException</code>.<p>
<a name="invokevirtualobject_quick.Notes"></a>
<b>Notes</h3></b>
<a name="9302"></a>
The opcode of this instruction was originally <i>invokevirtual</i>, and it referred to a method of the class <code>java.lang.Object</code> determined dynamically to have a method table index of 255 or less. The <i>invokevirtualobject_quick</i> instruction is specifically for the benefit of arrays.<p>
<a name="5908"></a>
When the constant pool entry referenced by an <i>invokevirtual</i> instruction is resolved, a one-byte index for the method it references is generated. That index replaces the first operand byte of the original <i>invokevirtual</i> instruction. The second operand byte of the <i>invokevirtual</i> instruction is replaced by <i>nargs</i>, the number of argument words expected by the method.<p>
<a name="28017"></a>
The <i>invokevirtualobject_quick</i> instruction only supports a one-byte index into the method table of <i>objectref</i>. Objects with large numbers of methods may not be able to have all their methods referenced with <i>_quick</i> variants. It is always correct, if less efficient, to re-fuse to convert an instance of an <i>invokevirtual</i> instruction to <i>invokevirtualobject_quick</i>.<p>
<a name="12643"></a>
An <i>invokevirtual</i> instruction not referring to an instance of <code>java.lang.Object</code> and with operands representing a constant pool index of 255 or less will instead be converted into an <i>invokevirtual_quick</i> instruction. Any <i>invokevirtual</i> instruction with operands representing a constant pool index greater than 255 will be converted into an <i>invokevirtual_quick_w</i> instruction.<p>

<a name="ldc_quick"></a>
<hr><h2>ldc_quick</h2>
<a name="ldc_quick.Operation"></a>
<b>Operation</h3></b>
<a name="3824"></a>
Push item from constant pool<p><Table Border="1">
<tr><td><a name="3821"></a>
 <i>ldc_quick</i>
<td><a name="352"></a>
 

<tr><td><a name="3823"></a>
 <i>index</i>
<td><a name="359"></a>
 

</Table><br><br><p>
<a name="ldc_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12463"></a>
<i>ldc_quick</i> = 203 (0xcb)<p>
<a name="ldc_quick.Stack"></a>
<b>Stack</h3></b>
<a name="5577"></a>
... <img src="chars/arrwdbrt.gif">  ..., <i>item</i><p>
<a name="ldc_quick.Description"></a>
<b>Description</h3></b>
<a name="5578"></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">(&#167;3.6)</a>. The constant pool <i>item</i> at <i>index</i> must have already been resolved and must be one word wide. The <i>item</i> is fetched from the constant pool and pushed onto the operand stack.<p>
<a name="ldc_quick.Notes"></a>
<b>Notes</h3></b>
<a name="4235"></a>
The opcode of this instruction was originally <i>ldc</i>. The operand of the <i>ldc</i> instruction is not modified.<p>

<a name="ldc_w_quick"></a>
<hr><h2>ldc_w_quick</h2>
<a name="ldc_w_quick.Operation"></a>
<b>Operation</h3></b>
<a name="9443"></a>
Push item from constant pool<p><Table Border="1">
<tr><td><a name="9438"></a>
 <i>ldc_w_quick</i>
<td><a name="104"></a>
 

<tr><td><a name="9440"></a>
 <i>indexbyte1</i>
<td><a name="111"></a>
 

<tr><td><a name="9442"></a>
 <i>indexbyte2</i>
<td><a name="118"></a>
 

</Table><br><br> (wide index)<p>
<a name="ldc_w_quick.Forms"></a>
<b>Forms</h3></b>
<a name="12464"></a>
<i>ldc_w_quick</i> = 204 (0xcc)<p>
<a name="ldc_w_quick.Stack"></a>
<b>Stack</h3></b>
<a name="9444"></a>
... <img src="chars/arrwdbrt.gif">  ..., <i>item</i><p>
<a name="ldc_w_quick.Description"></a>
<b>Description</h3></b>
<a name="9445"></a>
The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are assembled into an unsigned 16-bit index into the constant pool of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>, where index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The index must be a valid index into the constant pool of the current class. The constant pool <i>item</i> at the index must have already been resolved and must be one word wide. The <i>item</i> is fetched from the constant pool and pushed onto the operand stack.<p>
<a name="ldc_w_quick.Notes"></a>
<b>Notes</h3></b>
<a name="4243"></a>
The opcode of this instruction was originally <i>ldc_w</i>. The operands of the <i>ldc_w</i> instruction are not modified.<p>
<a name="4193"></a>
The <i>ldc_w_quick</i> instruction is identical to the <i>ldc_quick</i> instruction, except for its wider constant pool index.<p>

<a name="ldc2_w_quick"></a>
<hr><h2>ldc2_w_quick</h2>
<a name="ldc2_w_quick.Operation"></a>
<b>Operation</h3></b>
<a name="6685"></a>
Push <code>long</code> or <code>double</code> from constant pool (wide index)<p><Table Border="1">

⌨️ 快捷键说明

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