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

📄 instructions2.doc12.html

📁 Jvm 规范说明。The Java Virtual Machine was designed to support the Java programming language. Some concep
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>VM Spec  </title>
</head>
<body BGCOLOR=#eeeeff text=#000000 LINK=#0000ff VLINK=#000077 ALINK=#ff0000>
<table width=100%><tr>
<td><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc11.html">Prev</a> | <a href="Instructions2.doc13.html">Next</a> | <a href="Lindholm.INDEX.html">Index</a></td><td align=right><i><i>The Java<sup><font size=-2>TM</font></sup> Virtual Machine Specification</i></i></td>
</tr></table>


<hr><br>
 

<a name="ret">
</a><h2>ret</h2>
<a name="ret.Operation"></a>
<b>Operation</h3></b>
<a name="70002"></a>
Return from subroutine<p><Table Border="1">
<tr><td><a name="69999"></a>
 <i>ret</i>
<td><a name="87568"></a>
 

<tr><td><a name="70001"></a>
 <i>index</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="ret.Forms"></a>
<b>Forms</h3></b>
<a name="70003"></a>
<i>ret</i> = 169 (0xa9)<p>
<a name="ret.Stack"></a>
<b>Stack</h3></b>
<a name="70004"></a>
No change<p>
<a name="ret.Description"></a>
<b>Description</h3></b>
<a name="70005"></a>
The <i>index</i> is an unsigned byte between 0 and 255, inclusive. <em>The local variable </em>at<em> </em><i>index</i> in t<em>he current frame </em><a href="Overview.doc.html#17257">(&#167;3.6)</a><em> must contain a value of type </em><code>returnAddress</code><em>. </em>The contents of the local variable are written into the Java Virtual Machine's <code>pc</code> register, and execution continues there.<p>
<a name="ret.Notes"></a>
<b>Notes</h3></b>
<a name="70009"></a>
The <i>ret</i> instruction is used with <i>jsr</i> or <i>jsr_w</i> instructions in the implementation of the <code>finally</code> keyword of the Java language (see <a href="Compiling.doc.html#13789">Section 7.13, "Compiling finally"</a>). Note that <i>jsr</i> pushes the address onto the stack and <i>ret</i> gets it out of a local variable. This asymmetry is intentional.<p>
<a name="100993"></a>
The <i>ret</i> instruction should not be confused with the <i>return</i> instruction. A <i>return</i> instruction returns control from a Java method to its invoker, without passing any value back to the invoker.<p>
<a name="166941"></a>
The <i>ret</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.<p>
<a name="166939"></a>
<p>

<a name="return"></a>
<hr><h2>return</h2>
<a name="return.Operation"></a>
<b>Operation</h3></b>
<a name="70019"></a>
Return <code>void</code> from method<p><Table Border="1">
<tr><td><a name="70018"></a>
 <i>return</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="return.Forms"></a>
<b>Forms</h3></b>
<a name="70020"></a>
<i>return</i> = 177 (0xb1)<p>
<a name="return.Stack"></a>
<b>Stack</h3></b>
<a name="70021"></a>
... <img src="chars/arrwdbrt.gif"> <p>
<a name="178063"></a>
[empty]<p>
<a name="return.Description"></a>
<b>Description</h3></b>
<a name="70022"></a>
The returning method must have return type <code>void</code>. Any values on the operand stack of the current frame <a href="Overview.doc.html#17257">(&#167;3.6)</a> are discarded. If the returning method is a <code>synchronized</code> method, the monitor acquired or reentered on invocation of the method is released or exited (respectively) as if by execution of a <i>monitorexit</i> instruction. <p>
<a name="70026"></a>
The interpreter then returns control to the invoker of the method, reinstating the frame of the invoker.<p>


<hr>
<!-- This inserts footnotes--><p>
<a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc11.html">Prev</a> | <a href="Instructions2.doc13.html">Next</a> | <a href="Lindholm.INDEX.html">Index</a>
<p>
<font size = -1>Java Virtual Machine Specification <br>
<!--(HTML generated by dkramer on March 31, 1997)-->
<!--
(HTML generated by dkramer on March 25, 1997)-->
<br>
<i><a href="Copyright.doc.html">Copyright &#169 1996, 1997 Sun Microsystems, Inc.</a>
All rights reserved</i>
<br>
Please send any comments or corrections to <a href="mailto:jvm@java.sun.com">jvm@java.sun.com</a>
</font>
</body></html>

⌨️ 快捷键说明

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