📄 appa.html
字号:
<P>Note that the <FONT FACE="Courier New">wide</FONT> instruction can precede the <FONT FACE="Courier New">astore</FONT> instruction, to enable a <I>value</I> to be stored into a local variable specified by a 16-bit unsigned offset.</P>
<P>For more information about the <FONT FACE="Courier New">astore</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">astore_0</H3></FONT> - Store <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> into local variable 0</P>
<P><H3>Opcode:</H3> 75 (0x4b)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">astore_0</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., value</P></EM></H4>
<P>After:<I>...</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The index zero must be a valid index into the local variables of the current stack frame, and the <I>value</I> word on the top of the operand stack must be a <FONT FACE="Courier New">reference</FONT> or a <FONT FACE="Courier New">returnAddress</FONT>. To execute the <FONT FACE="Courier New">astore_0</FONT> instruction, the Java Virtual Machine pops the <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> <I>value</I> from the top of the operand stack and stores it into the local variable word at index zero.</P>
<P>For more information about the <FONT FACE="Courier New">astore_0</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">astore_1</H3></FONT> - Store <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> into local variable 1</P>
<P><H3>Opcode:</H3> 76 (0x4c)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">astore_1</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., value</P></EM></H4>
<P>After:<I>...</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The index one must be a valid index into the local variables of the current stack frame, and the <I>value</I> word on the top of the operand stack must be a <FONT FACE="Courier New">reference</FONT> or a <FONT FACE="Courier New">returnAddress</FONT>. To execute the <FONT FACE="Courier New">astore_1</FONT> instruction, the Java Virtual Machine pops the <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> <I>value</I> from the top of the operand stack and stores it into the local variable word at index one.</P>
<P>For more information about the <FONT FACE="Courier New">astore_1</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">astore_2</H3></FONT> - Store <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> into local variable 2</P>
<P><H3>Opcode:</H3> 77 (0x4d)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">astore_2</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., value</P></EM></H4>
<P>After:<I>...</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The index two must be a valid index into the local variables of the current stack frame, and the <I>value</I> word on the top of the operand stack must be a <FONT FACE="Courier New">reference</FONT> or a <FONT FACE="Courier New">returnAddress</FONT>. To execute the <FONT FACE="Courier New">astore_2</FONT> instruction, the Java Virtual Machine pops the <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> <I>value</I> from the top of the operand stack and stores it into the local variable word at index two.</P>
<P>For more information about the <FONT FACE="Courier New">astore_2</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">astore_3</H3></FONT> - Store <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> into local variable 3</P>
<P><H3>Opcode:</H3> 78 (0x4e)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">astore_3</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., value</P></EM></H4>
<P>After:<I>...</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The index three must be a valid index into the local variables of the current stack frame, and the <I>value</I> word on the top of the operand stack must be a <FONT FACE="Courier New">reference</FONT> or a <FONT FACE="Courier New">returnAddress</FONT>. To execute the <FONT FACE="Courier New">astore_3</FONT> instruction, the Java Virtual Machine pops the <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> <I>value</I> from the top of the operand stack and stores it into the local variable word at index three.</P>
<P>For more information about the <FONT FACE="Courier New">astore_3</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">athrow</H3></FONT> - Throw exception or error</P>
<P><H3>Opcode:</H3> 191 (0xbf)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">athrow</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., objectref</P></EM></H4>
<P>After<I>objectref</P></EM></H4>
<P>Note that "Before" shows the operand stack of the frame belonging to the method containing the <FONT FACE="Courier New">athrow</FONT> instruction being executed. "After" shows the operand stack of the frame belonging to the method in which the catch clause is found, <I>if</I> a catch clause is found. If no catch clause is found, the thread exits and there are no more operand stacks for that thread.</P>
<P><H3>Description:</H3></P>
<P>The top word of the operand stack, <I>objectref</I>, must be a <FONT FACE="Courier New">reference</FONT> that points either to an instance of class <FONT FACE="Courier New">java.lang.Throwable</FONT> or to an instance of some subclass of <FONT FACE="Courier New">java.lang.Throwable</FONT>. To execute the <FONT FACE="Courier New">athrow</FONT> instruction, the Java Virtual Machine pops <I>objectref</I> from the operand stack. The virtual machine "throws" the exception by searching through the current method韘 exception table for the most recent catch clause that catches either the class of the throwable object pointed to by <I>objectref</I>, or a subclass of the throwable object韘 class. If the current method韘 exception table contains a matching entry, the virtual machine extracts the address of the handler to jump to from the matching exception table entry. The virtual machine pops any words remaining on the operand stack, pushes the <I>objectref</I>, sets the program counter to the handler address, and continues execution there. If the current method韘 exception table doesn韙 have a matching catch clause, the virtual machine pops the current method韘 entire frame and rethrows the exception in the previous method. This process repeats until either a matching catch clause is found or the stack frames for all the methods along the current thread韘 call stack have been popped. If no catch clause is found by this process, the current thread exits.</P>
<P>If the <I>objectref</I> word is <FONT FACE="Courier New">null</FONT>, the virtual machine throws <FONT FACE="Courier New">NullPointerException</FONT>.</P>
<P>For more information about the <FONT FACE="Courier New">athrow</FONT> instruction, see Chapter 17, "Exceptions."</P>
<P><H3><FONT FACE="Courier New">baload</H3></FONT> - Load <FONT FACE="Courier New">byte</FONT> or <FONT FACE="Courier New">boolean</FONT> from array</P>
<P><H3>Opcode:</H3> 51 (0x33)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">baload</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., arrayref, index</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>To execute the <FONT FACE="Courier New">baload</FONT> instruction, the Java Virtual Machine first pops two words from the operand stack. The <I>arrayref</I> word must be a <FONT FACE="Courier New">reference</FONT> that refers to an array of <FONT FACE="Courier New">byte</FONT>s or <FONT FACE="Courier New">boolean</FONT>s. The <I>index</I> word must be an <FONT FACE="Courier New">int</FONT>. The virtual machine retrieves from the <I>arrayref</I> array the <FONT FACE="Courier New">byte</FONT> or <FONT FACE="Courier New">boolean</FONT> <I>value</I> specified by <I>index</I>, sign-extends it to an <FONT FACE="Courier New">int</FONT>, and pushes it onto the operand stack.</P>
<P>If <I>arrayref</I> is <FONT FACE="Courier New">null</FONT>, the Java Virtual Machine throws <FONT FACE="Courier New">NullPointerException</FONT>. Otherwise, if <I>index</I> is not a legal index into the <I>arrayref</I> array, the virtual machine throws <FONT FACE="Courier New">ArrayIndexOutOfBoundsException</FONT>.</P>
<P>For more information about the <FONT FACE="Courier New">baload</FONT> instruction, see Chapter 15, "Objects and Arrays."</P>
<P><H3><FONT FACE="Courier New">bastore</H3></FONT> - Store into <FONT FACE="Courier New">byte</FONT> or <FONT FACE="Courier New">boolean</FONT> array</P>
<P><H3>Opcode:</H3> 84 (0x54)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">bastore</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., arrayref, index, value</P></EM></H4>
<P>After:<I>...</P></EM></H4>
<P><H3>Description:</H3></P>
<P>To execute the <FONT FACE="Courier New">bastore</FONT> instruction, the Java Virtual Machine first pops three words from the operand stack. The <I>arrayref</I> word must be a <FONT FACE="Courier New">reference</FONT> that refers to an array of <FONT FACE="Courier New">byte</FONT>s or <FONT FACE="Courier New">boolean</FONT>s. The <I>index</I> and <I>value</I> words must be <FONT FACE="Courier New">int</FONT>s. The virtual machine truncates the <FONT FACE="Courier New">int</FONT> <I>value</I> to a <FONT FACE="Courier New">byte</FONT> and stores it into the <I>arrayref</I> array location specified by <I>index</I>.</P>
<P>If <I>arrayref</I> is <FONT FACE="Courier New">null</FONT>, the Java Virtual Machine throws <FONT FACE="Courier New">NullPointerException</FONT>. Otherwise, if <I>index</I> is not a legal index into the <I>arrayref</I> array, the virtual machine throws <FONT FACE="Courier New">ArrayIndexOutOfBoundsException</FONT>.</P>
<P>For more information about the <FONT FACE="Courier New">bastore</FONT> instruction, see Chapter 15, "Objects and Arrays."</P>
<P><H3><FONT FACE="Courier New">bipush</H3></FONT> - Push 8-bit signed integer</P>
<P><H3>Opcode:</H3> 16 (0x10)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">bipush</FONT>, <I>byte</P></EM></H4>
<P><H3>Stack:</H3></P>
<P>Before:<I>...</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>To execute the <FONT FACE="Courier New">bipush</FONT> instruction, the Java Virtual Machine first sign-extends operand <I>byte</I>, an 8-bit signed integer, to an <FONT FACE="Courier New">int</FONT>. The virtual machine then pushes the resulting <FONT FACE="Courier New">int</FONT> <I>value</I> onto the operand stack.</P>
<P>For more information about the <FONT FACE="Courier New">bipush</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">caload</H3></FONT> - Load <FONT FACE="Courier New">char</FONT> from array</P>
<P><H3>Opcode:</H3> 52 (0x34)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">caload</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., arrayref, index</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>To execute the <FONT FACE="Courier New">caload</FONT> instruction, the Java Virtual Machine first pops two words from the operand stack. The <I>arrayref</I> word must be a <FONT FACE="Courier New">reference</FONT> that refers to an array of <FONT FACE="Courier New">char</FONT>s. The <I>index</I> word must be an <FONT FACE="Courier New">int</FONT>. The virtual machine retrieves from the <I>arrayref</I> array the <FONT FACE="Courier New">char</FONT> <I>value</I> specified by <I>index</I>, zero-extends it to an <FONT FACE="Courier New">int</FONT>, and pushes it onto the operand stack.</P>
<P>If <I>arrayref</I> is <FONT FACE="Courier New">null</FONT>, the Java Virtual Machine throws <FONT FACE="Courier New">NullPointerException</FONT>. Otherwise, if <I>index</I> is not a legal index into the <I>arrayref</I> array, the virtual machine throws <FONT FACE="Courier New">ArrayIndexOutOfBoundsException</FONT>.</P>
<P>For more information about the <FONT FACE="Courier New">caload</FONT> instruction, see Chapter 15, "Objects and Arrays."</P>
<P><H3><FONT FACE="Courier New">castore</H3></FONT> - Store into <FONT FACE="Courier New">char</FONT> array</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -