📄 appa.html
字号:
<P><H3><FONT FACE="Courier New">aload</H3></FONT> - Load <FONT FACE="Courier New">reference</FONT> from local variable</P>
<P><H3>Opcode:</H3> 25 (0x19)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">aload</FONT>, <I>index</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>The <I>index</I> operand, which serves as an 8-bit unsigned index into the local variables of the current frame, must specify a local variable word that contains a <FONT FACE="Courier New">reference</FONT>. To execute the <FONT FACE="Courier New">aload</FONT> instruction, the Java Virtual Machine pushes onto the operand stack the <FONT FACE="Courier New">reference</FONT> contained in the local variable word specified by <I>index</I>.</P>
<P>Note that the <FONT FACE="Courier New">wide</FONT> instruction can precede the <FONT FACE="Courier New">aload</FONT> instruction, to allow a local variable to be accessed with a 16-bit unsigned offset.</P>
<P>Note also that even though the <FONT FACE="Courier New">astore</FONT> instruction may be used to pop a <FONT FACE="Courier New">returnAddress</FONT> value off the operand stack and into a local variable, the <FONT FACE="Courier New">aload</FONT> instruction cannot be used to push a <FONT FACE="Courier New">returnAddress</FONT> value back onto the operand stack. For more information about the use of <FONT FACE="Courier New">returnAddress</FONT>, see Chapter 18, "Finally Clauses."</P>
<P>For more information about the <FONT FACE="Courier New">aload</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">aload_0</H3></FONT> - Load <FONT FACE="Courier New">reference</FONT> from local variable 0</P>
<P><H3>Opcode:</H3> 42 (0x2a)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">aload_0</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>...</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The local variable word at index zero must contain a <FONT FACE="Courier New">reference</FONT>. To execute the <FONT FACE="Courier New">aload_0</FONT> instruction, the Java Virtual Machine pushes onto the operand stack the <FONT FACE="Courier New">reference</FONT> <I>value</I> contained in the local variable word zero.</P>
<P>Note that even though the <FONT FACE="Courier New">astore_0</FONT> instruction may be used to pop a <FONT FACE="Courier New">returnAddress</FONT> value off the operand stack and into a local variable, the <FONT FACE="Courier New">aload_0</FONT> instruction cannot be used to push a <FONT FACE="Courier New">returnAddress</FONT> value back onto the operand stack. For more information about the use of <FONT FACE="Courier New">returnAddress</FONT>, see Chapter 18, "Finally Clauses."</P>
<P>For more information about the <FONT FACE="Courier New">aload_0</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">aload_1</H3></FONT> - Load <FONT FACE="Courier New">reference</FONT> from local variable 1</P>
<P><H3>Opcode:</H3> 43 (0x2b)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">aload_1</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>...</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The local variable word at index one must contain a <FONT FACE="Courier New">reference</FONT>. To execute the <FONT FACE="Courier New">aload_1</FONT> instruction, the Java Virtual Machine pushes onto the operand stack the <FONT FACE="Courier New">reference</FONT> <I>value</I> contained in the local variable word one.</P>
<P>Note that even though the <FONT FACE="Courier New">astore_1</FONT> instruction may be used to pop a <FONT FACE="Courier New">returnAddress</FONT> value off the operand stack and into a local variable, the <FONT FACE="Courier New">aload_1</FONT> instruction cannot be used to push a <FONT FACE="Courier New">returnAddress</FONT> value back onto the operand stack. For more information about the use of <FONT FACE="Courier New">returnAddress</FONT>, see Chapter 18, "Finally Clauses."</P>
<P>For more information about the <FONT FACE="Courier New">aload_1</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">aload_2</H3></FONT> - Load <FONT FACE="Courier New">reference</FONT> from local variable 2</P>
<P><H3>Opcode:</H3> 44 (0x2c)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">aload_2</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>...</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The local variable word at index two must contain a <FONT FACE="Courier New">reference</FONT>. To execute the <FONT FACE="Courier New">aload_2</FONT> instruction, the Java Virtual Machine pushes onto the operand stack the <FONT FACE="Courier New">reference</FONT> <I>value</I> contained in the local variable word two.</P>
<P>Note that even though the <FONT FACE="Courier New">astore_2</FONT> instruction may be used to pop a <FONT FACE="Courier New">returnAddress</FONT> value off the operand stack and into a local variable, the <FONT FACE="Courier New">aload_2</FONT> instruction cannot be used to push a <FONT FACE="Courier New">returnAddress</FONT> value back onto the operand stack. For more information about the use of <FONT FACE="Courier New">returnAddress</FONT>, see Chapter 18, "Finally Clauses."</P>
<P>For more information about the <FONT FACE="Courier New">aload_2</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">aload_3</H3></FONT> - Load <FONT FACE="Courier New">reference</FONT> from local variable 3</P>
<P><H3>Opcode:</H3> 45 (0x2d)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">aload_3</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>...</P></EM></H4>
<P>After:<I>..., value</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The local variable word at index three must contain a <FONT FACE="Courier New">reference</FONT>. To execute the <FONT FACE="Courier New">aload_3</FONT> instruction, the Java Virtual Machine pushes onto the operand stack the <FONT FACE="Courier New">reference</FONT> <I>value</I> contained in the local variable word three.</P>
<P>Note that even though the <FONT FACE="Courier New">astore_3</FONT> instruction may be used to pop a <FONT FACE="Courier New">returnAddress</FONT> value off the operand stack and into a local variable, the <FONT FACE="Courier New">aload_3</FONT> instruction cannot be used to push a <FONT FACE="Courier New">returnAddress</FONT> value back onto the operand stack. For more information about the use of <FONT FACE="Courier New">returnAddress</FONT>, see Chapter 18, "Finally Clauses."</P>
<P>For more information about the <FONT FACE="Courier New">aload_3</FONT> instruction, see Chapter 10, "Stack Operations."</P>
<P><H3><FONT FACE="Courier New">anewarray</H3></FONT> - Allocate new array of reference type components</P>
<P><H3>Opcode:</H3> 189 (0xbd)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">anewarray</FONT>, <I>indexbyte1</I>, <I>indexbyte2</P></EM></H4>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., count</P></EM></H4>
<P>After:<I>arrayref</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The top word of the operand stack, <I>count</I>, must be an <FONT FACE="Courier New">int</FONT>. To execute the <FONT FACE="Courier New">anewarray</FONT> instruction, the Java Virtual Machine first forms an unsigned 16-bit index into the constant pool by calculating <I>(indexbyte1 <FONT FACE="Courier New"> 8) | indexbyte2</I>. The virtual machine then looks up the constant pool entry specified by the calculated index. The constant pool entry at that index must be a <FONT FACE="Courier New">CONSTANT_Class_info</FONT> entry. If it hasn韙 already, the virtual machine resolves the entry. The entry may be a class, interface, or array type. </P>
<P>If the resolution is successful, the Java Virtual Machine pops <I>count</I> and creates on the heap an array of size <I>count</I> of the reference type specified by the resolved <FONT FACE="Courier New">CONSTANT_Class_info</FONT> entry. The virtual machine initializes each array element to its default initial value (<FONT FACE="Courier New">null</FONT>) and pushes <I>arrayref</I>, a reference to the new array, onto the operand stack.</P>
<P>As a result of executing this instruction, the Java Virtual Machine may throw any of the linking errors listed in Chapter 8, "The Linking Model," as possible during resolution of a <FONT FACE="Courier New">CONSTANT_Class_info</FONT> entry. If resolution succeeds, but <I>count</I> is less than zero, the virtual machine throws <FONT FACE="Courier New">NegativeArraySizeException</FONT>.</P>
<P>For more information about the <FONT FACE="Courier New">anewarray</FONT> instruction, see Chapter 15, "Objects and Arrays."</P>
<P><H3><FONT FACE="Courier New">areturn</H3></FONT> - Return <FONT FACE="Courier New">reference</FONT>from method</P>
<P><H3>Opcode:</H3> 176 (0xb0)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">areturn</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., objectref</P></EM></H4>
<P>After:<I>[empty]</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The return type of the returning method must be <FONT FACE="Courier New">reference</FONT>. The top word of the operand stack, <I> objectref</I> , must be a <FONT FACE="Courier New">reference</FONT> that is assignment compatible with the type represented by the returning method韘 descriptor. To execute the <FONT FACE="Courier New">areturn</FONT> instruction, the Java Virtual Machine pops <I>objectref</I> from the operand stack of the current frame and pushes it onto the operand stack of the invoking method韘 frame. The virtual machine discards any other words that may still be on the returning method韘 frame. If the returning method is synchronized, the monitor that was acquired when the method was invoked is released. The invoking method韘 frame is made current, and the virtual machine continues execution in the invoking method.</P>
<P>For more information about monitors, see Chapter 20, "Thread Synchronization." For more information about the <FONT FACE="Courier New">areturn</FONT> instruction, see Chapter 19, "Method Invocation and Return."</P>
<P><H3><FONT FACE="Courier New">arraylength</H3></FONT> - Get length of array</P>
<P><H3>Opcode:</H3> 190 (0xbe)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">arraylength</FONT></P>
<P><H3>Stack:</H3></P>
<P>Before:<I>..., arrayref</P></EM></H4>
<P>After:<I>..., length</P></EM></H4>
<P><H3>Description:</H3></P>
<P>The top word of the operand stack, <I>arrayref</I>, must be a <FONT FACE="Courier New">reference</FONT> that points to an array. To execute the <FONT FACE="Courier New">arraylength</FONT> instruction, the Java Virtual Machine pops <I>arrayref</I> and pushes the length of the array pointed to by <I>arrayref</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>.</P>
<P>For more information about the <FONT FACE="Courier New">arraylength</FONT> instruction, see Chapter 15, "Objects and Arrays."</P>
<P><H3><FONT FACE="Courier New">astore</H3></FONT> - Store <FONT FACE="Courier New">reference</FONT> or <FONT FACE="Courier New">returnAddress</FONT> into local variable</P>
<P><H3>Opcode:</H3> 58 (0x3a)</P>
<P><H3>Instruction Format:</H3> <FONT FACE="Courier New">astore</FONT>, <I>index</P></EM></H4>
<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 <I>index</I> operand must specify a valid 8-bit unsigned index into the local variables of the current frame. The <I>value</I> 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</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 specified by <I>index</I>.</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -