📄 instructions2.doc112.html
字号:
<html><head><title>VM Spec </title></head><body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000> <a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc111.html">Prev</a> | <a href="Instructions2.doc113.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><hr><br> <a name="invokevirtual"></a><h2>invokevirtual</h2><a name="invokevirtual.Operation"></a><b>Operation</b><br><a name="68948"></a>Invoke instance method<p><Table Border="3"><tr><td><a name="68943"></a> <i>invokevirtual</i><td><a name="87568"></a> <tr><td><a name="68945"></a> <i>indexbyte1</i><td><a name="87568"></a> <tr><td><a name="68947"></a> <i>indexbyte2</i><td><a name="87568"></a> </Table><Table><tr><td></Table>; dispatch based on class<p><a name="invokevirtual.Forms"></a><b>Forms</b><br><a name="68949"></a><i>invokevirtual</i> = 182 (0xb6)<p><a name="invokevirtual.Stack"></a><b>Stack</b><br><a name="68950"></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.Description"></a><b>Description</b><br><a name="68951"></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 item at that index in the constant pool must have the tag <code>CONSTANT_Methodref</code> <a href="ClassFile.doc.html#4723">(§4.4.2)</a>, a reference to a class name, a method name, and the method's descriptor <a href="ClassFile.doc.html#7035">(§4.3.3)</a>. The named method is resolved <a href="ConstantPool.doc.html#49425">(§5.2)</a>. The descriptor of the resolved method must be identical to the descriptor of the one of the methods of the resolved class. The method must not be <code><init></code>, an instance initialization method <a href="Overview.doc.html#12174">(§3.8)</a>, or <code><clinit></code>, a class or interface initialization method <a href="Overview.doc.html#12174">(§3.8)</a>. Finally, if the method is <code>protected</code> <a href="ClassFile.doc.html#1513">(§4.6)</a>, then it must be either a member of the current class or a member of a superclass of the current class, and the class of <i>objectref</i> must be either the current class or a subclass of the current class. <p><a name="68967"></a>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> that must not be zero.<p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc111.html">Prev</a> | <a href="Instructions2.doc113.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><p><font size=-1>Java Virtual Machine Specification (HTML generated by dkramer on February 25, 1997)<br><i><a href="Copyright.doc.html">Copyright © 1996 Sun Microsystems, Inc.</a>All rights reserved</i><br>Please send any comments or corrections to <a href="mailto:doug.kramer@sun.com">doug.kramer@sun.com</a></font></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -