📄 instructions2.doc111.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.doc110.html">Prev</a> | <a href="Instructions2.doc112.html">Next</a> | <a href="Mnemonics.doc.html">Index</a><hr><br> <a name="invokestatic"></a><h2>invokestatic</h2><a name="68921"></a>The operand stack must contain <i>nargs</i> words of arguments, where the number of words of arguments and the type and order of the values they represent must be consistent with the descriptor of the resolved method.<p><a name="138176"></a>If the method is <code>synchronized</code>, the monitor associated with the current class is acquired.<p><a name="138172"></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="138173"></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.Linking"></a><b>Linking Exceptions</b><br><a name="117162"></a>During resolution of the <code>CONSTANT_Methodref </code>constant pool item, any of the exceptions documented in <a href="ConstantPool.doc.html#49425">§5.2</a> can be thrown.<p><a name="68925"></a>Otherwise, if the specified method exists but is an instance method, the <i>invokestatic</i> instruction throws an <code>IncompatibleClass-ChangeError</code>.<p><a name="158805"></a>Otherwise, if the specified method is <code>native</code> and the code that implements the method cannot be loaded or linked, <i>invokestatic</i> throws an <code>UnsatisfiedLinkError</code>.<p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc110.html">Prev</a> | <a href="Instructions2.doc112.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 + -