📄 instructions2.doc8.html
字号:
<a name="lreturn.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69583"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> [empty]</blockquote><p><a name="lreturn.Description"></a><p><b>Description</b><br><blockquote><a name="69584"></a>The current method must have return type <code>long</code>. The <i>value</i> must be of type <code>long</code>. If the current 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. If no exception is thrown, <i>value</i> is popped from the operand stack of the current frame <a href="Overview.doc.html#17257">(§3.6)</a> and pushed onto the operand stack of the frame of the invoker. Any other values on the operand stack of the current method are discarded.</blockquote><p><blockquote><a name="69588"></a>The interpreter then returns control to the invoker of the method, reinstating the frame of the invoker.</blockquote><p><a name="lreturn.Runtime"></a><p><b>Runtime Exceptions</b><br><blockquote><a name="250753"></a>If the current method is a <code>synchronized</code> method and the current thread is not the owner of the monitor acquired or reentered on invocation of the method, <i>lreturn</i> throws an <code>IllegalMonitorStateException</code>. This can happen, for example, if a <code>synchronized</code> method contains a <i>monitorexit</i> instruction, but no <i>monitorenter</i> instruction, on the object on which the method is synchronized.</blockquote><p><blockquote><a name="250754"></a>Otherwise, if the virtual machine implementation enforces the rules on structured use of locks described in <a href="Threads.doc.html#22500">Section 8.13</a> and if the first of those rules is violated during invocation of the current method, then <i>lreturn</i> throws an <code>IllegalMonitorStateException</code>.</blockquote><p><blockquote><a name="250632"></a></blockquote><p><a name="lshl"></a><hr><h2>lshl</h2><a name="lshl.Operation"></a><p><b>Operation</b><br><blockquote><a name="69598"></a>Shift left<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69597"></a> <i>lshl</i><td><a name="87568"></a> </Table><br> <code>long</code></blockquote><p><a name="lshl.Forms"></a><p><b>Forms</b><br><blockquote><a name="69599"></a><i>lshl</i> = 121 (0x79)</blockquote><p><a name="lshl.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69600"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="lshl.Description"></a><p><b>Description</b><br><blockquote><a name="69601"></a>The <i>value1</i> must be of type <code>long</code>, and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by shifting <i>value1</i> left by <em>s</em> bit positions, where <em>s</em> is the low 6 bits of <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="lshl.Notes"></a><p><b>Notes</b><br><blockquote><a name="69602"></a>This is equivalent (even if overflow occurs) to multiplication by 2 to the power<em> </em><em>s</em>. The shift distance actually used is therefore always in the range 0 to 63, inclusive, as if <i>value2</i> were subjected to a bitwise logical AND with the mask value 0x3f. </blockquote><p><a name="lshr"></a><hr><h2>lshr</h2><a name="lshr.Operation"></a><p><b>Operation</b><br><blockquote><a name="69612"></a>Arithmetic shift right <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69611"></a> <i>lshr</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lshr.Forms"></a><p><b>Forms</b><br><blockquote><a name="69613"></a><i>lshr</i> = 123 (0x7b)</blockquote><p><a name="lshr.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69614"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="lshr.Description"></a><p><b>Description</b><br><blockquote><a name="69615"></a>The <i>value1</i> must be of type <code>long</code>, and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by shifting <i>value1</i> right by <em>s</em> bit positions, with sign extension, where <em>s</em> is the value of the low 6 bits of <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="lshr.Notes"></a><p><b>Notes</b><br><blockquote><a name="69619"></a>The resulting value is <img src="Instructions2.doc.anc13.gif">, where <i>s</i> is <i>value2</i> & 0x3f. For nonnegative <i>value1</i>, this is equivalent to truncating <code>long</code> division by 2 to the power <code>s</code>. The shift distance actually used is therefore always in the range 0 to 63, inclusive, as if <i>value2</i> were subjected to a bitwise logical AND with the mask value 0x3f. </blockquote><p><a name="lstore"></a><hr><h2>lstore</h2><a name="lstore.Operation"></a><p><b>Operation</b><br><blockquote><a name="69628"></a>Store <code>long</code> into local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69625"></a> <i>lstore</i><td><a name="87568"></a> <tr><td><a name="69627"></a> <i>index</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lstore.Forms"></a><p><b>Forms</b><br><blockquote><a name="69629"></a><i>lstore</i> = 55 (0x37)</blockquote><p><a name="lstore.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69630"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="lstore.Description"></a><p><b>Description</b><br><blockquote><a name="69631"></a>The <i>index</i> is an unsigned byte. Both <i>index</i> and <i>index </i>+ <i>1</i> must be indices into the local variable array of the current frame <a href="Overview.doc.html#17257">(§3.6)</a>. The <i>value</i> on the top of the operand stack must be of type <code>long</code>. It is popped from the operand stack, and the local variables at <i>index</i> and <i>index</i>  +  <i>1</i> are set to <i>value</i>. </blockquote><p><a name="lstore.Notes"></a><p><b>Notes</b><br><blockquote><a name="69635"></a>The <i>lstore</i> opcode can be used in conjunction with the <i>wide</i> instruction to access a local variable using a two-byte unsigned index.</blockquote><p><a name="lstore_n"></a><hr><h2>lstore_<n></h2><a name="lstore_n.Operation"></a><p><b>Operation</b><br><blockquote><a name="69645"></a>Store <code>long</code> into local variable<p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69644"></a> <i>lstore_<n></i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lstore_n.Forms"></a><p><b>Forms</b><br><blockquote><a name="69646"></a><i>lstore_0</i> = 63 (0x3f) <i>lstore_1</i> = 64 (0x40) <i>lstore_2</i> = 65 (0x41) <i>lstore_3</i> = 66 (0x42)</blockquote><p><a name="lstore_n.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="88095"></a>..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...</blockquote><p><a name="lstore_n.Description"></a><p><b>Description</b><br><blockquote><a name="69648"></a>Both <i><n></i> and <i><n> </i>+ <i>1</i> must be indices into the local variable array of the current frame <a href="Overview.doc.html#17257">(§3.6)</a>. The <i>value</i> on the top of the operand stack must be of type <code>long</code>. It is popped from the operand stack, and the local variables at <i><n></i> and <i><n></i>  +  <i>1</i> are set to <i>value</i>.</blockquote><p><a name="lstore_n.Notes"></a><p><b>Notes</b><br><blockquote><a name="69652"></a>Each of the <i>lstore_<n></i> instructions is the same as <i>lstore</i> with an <i>index</i> of <i><n></i>, except that the operand <i><n></i> is implicit.</blockquote><p><a name="lsub"></a><hr><h2>lsub</h2><a name="lsub.Operation"></a><p><b>Operation</b><br><blockquote><a name="69662"></a>Subtract <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69661"></a> <i>lsub</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lsub.Forms"></a><p><b>Forms</b><br><blockquote><a name="69663"></a><i>lsub</i> = 101 (0x65)</blockquote><p><a name="lsub.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69664"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="lsub.Description"></a><p><b>Description</b><br><blockquote><a name="69665"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>long</code>. The values are popped from the operand stack. The <code>long</code> <i>result</i> is <i>value1</i> - <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><blockquote><a name="69666"></a>For <code>long</code> subtraction, <code>a</code>-<code>b</code> produces the same result as <code>a</code>+<code>(</code>-<code>b)</code>. For <code>long</code> values, subtraction from zero is the same as negation.</blockquote><p><blockquote><a name="448562"></a>The result is the 64 low-order bits of the true mathematical result in a sufficiently wide two's-complement format, represented as a value of type <code>long</code>. If overflow occurs, then the sign of the result may not be the same as the sign of the mathematical sum of the two values.</blockquote><p><blockquote><a name="448629"></a>Despite the fact that overflow may occur, execution of an <i>lsub</i> instruction never throws a runtime exception.</blockquote><p><a name="lushr"></a><hr><h2>lushr</h2><a name="lushr.Operation"></a><p><b>Operation</b><br><blockquote><a name="69677"></a>Logical shift right <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69676"></a> <i>lushr</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lushr.Forms"></a><p><b>Forms</b><br><blockquote><a name="69678"></a><i>lushr</i> = 125 (0x7d)</blockquote><p><a name="lushr.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69679"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="lushr.Description"></a><p><b>Description</b><br><blockquote><a name="69680"></a>The <i>value1</i> must be of type <code>long</code>, and <i>value2</i> must be of type <code>int</code>. The values are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by shifting <i>value1</i> right logically (with zero extension) by the amount indicated by the low 6 bits of <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><a name="lushr.Notes"></a><p><b>Notes</b><br><blockquote><a name="459086"></a>If <em>value1</em> is positive and s is <i>value2</i> & 0x3f, the result is the same as that of <i>value1</i> >> s; if <i>value1</i> is negative, the result is equal to the value of the expression (<i>value1</i> >> s) + (2L << ~s). The addition of the (2L << ~s) term cancels out the propagated sign bit. The shift distance actually used is always in the range 0 to 63, inclusive.</blockquote><p><blockquote><a name="125524"></a></blockquote><p><a name="lxor"></a><hr><h2>lxor</h2><a name="lxor.Operation"></a><p><b>Operation</b><br><blockquote><a name="69692"></a>Boolean XOR <code>long</code><p><Table Border="1"></blockquote><p><b>Format</b><br><blockquote><tr><td><a name="69691"></a> <i>lxor</i><td><a name="87568"></a> </Table><br></blockquote><p><a name="lxor.Forms"></a><p><b>Forms</b><br><blockquote><a name="69693"></a><i>lxor</i> = 131 (0x83)</blockquote><p><a name="lxor.Operand"></a><p><b>Operand Stack</b><br><blockquote><a name="69694"></a>..., <i>value1</i>, <i>value2</i> <img src="chars/arrwdbrt.gif"> ..., <i>result</i></blockquote><p><a name="lxor.Description"></a><p><b>Description</b><br><blockquote><a name="69695"></a>Both <i>value1</i> and <i>value2</i> must be of type <code>long</code>. They are popped from the operand stack. A <code>long</code> <i>result</i> is calculated by taking the bitwise exclusive OR of <i>value1</i> and <i>value2</i>. The <i>result</i> is pushed onto the operand stack.</blockquote><p><hr><!-- This inserts footnotes--><p><a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc7.html">Prev</a> | <a href="Instructions2.doc9.html">Next</a> | <a href="VMSpecIX.fm.html">Index</a><p><font size="-1"><i>The Java</i><sup><font size=-2>TM</font></sup><i> Virtual Machine Specification </i><br><!-- HTML generated by Suzette Pelouch on March 30, 1999 --><i><a href="Copyright.doc.html">Copyright © 1999 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 + -