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

📄 instructions2.doc11.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.doc10.html">Prev</a> | <a href="Instructions2.doc12.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="pop">
</a><h2>pop</h2>
<a name="pop.Operation"></a>
<b>Operation</h3></b>
<a name="69883"></a>
Pop top operand stack word<p><Table Border="1">
<tr><td><a name="69882"></a>
 <i>pop</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="pop.Forms"></a>
<b>Forms</h3></b>
<a name="69884"></a>
<i>pop</i> = 87 (0x57)<p>
<a name="pop.Stack"></a>
<b>Stack</h3></b>
<a name="69885"></a>
..., <i>word</i><em> </em><img src="chars/arrwdbrt.gif"> ...<p>
<a name="pop.Description"></a>
<b>Description</h3></b>
<a name="69886"></a>
The top word is popped from the operand stack. <p>
<a name="69887"></a>
The <i>pop</i> instruction must not be used unless <i>word</i> is a word that contains a 32-bit data type.<p>
<a name="pop.Notes"></a>
<b>Notes</h3></b>
<a name="69888"></a>
Except for restrictions preserving the integrity of 64-bit data types, the <i>pop</i> instruction operates on an untyped word, ignoring the type of the datum it contains.<p>

<a name="pop2"></a>
<hr><h2>pop2</h2>
<a name="pop2.Operation"></a>
<b>Operation</h3></b>
<a name="69898"></a>
Pop top two operand stack word<p><Table Border="1">
<tr><td><a name="69897"></a>
 <i>pop2</i>
<td><a name="87568"></a>
 

</Table><br><br>s<p>
<a name="pop2.Forms"></a>
<b>Forms</h3></b>
<a name="69899"></a>
<i>pop2</i> = 88 (0x58)<p>
<a name="pop2.Stack"></a>
<b>Stack</h3></b>
<a name="69900"></a>
...,<em> </em><i>word2</i>, <i>word1</i><em> </em><img src="chars/arrwdbrt.gif"> ...<p>
<a name="pop2.Description"></a>
<b>Description</h3></b>
<a name="69901"></a>
The top two words are popped from the operand stack. <p>
<a name="69902"></a>
The <i>pop2</i> instruction must not be used unless each of word <i>word1</i> and <i>word2</i> is a word that contains a 32-bit data types or together are the two words of a single 64-bit datum.<p>
<a name="pop2.Notes"></a>
<b>Notes</h3></b>
<a name="69903"></a>
Except for restrictions preserving the integrity of 64-bit data types, the <i>pop2</i> instruction operates on raw words, ignoring the types of the data they contain.<p>

<a name="putfield"></a>
<hr><h2>putfield</h2>
<a name="putfield.Operation"></a>
<b>Operation</h3></b>
<a name="69920"></a>
Set field in object<p><Table Border="1">
<tr><td><a name="69915"></a>
 <i>putfield</i>
<td><a name="87568"></a>
 

<tr><td><a name="69917"></a>
 <i>indexbyte1</i>
<td><a name="87568"></a>
 

<tr><td><a name="69919"></a>
 <i>indexbyte2</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="putfield.Forms"></a>
<b>Forms</h3></b>
<a name="69921"></a>
<i>putfield</i> = 181 (0xb5)<p>
<a name="putfield.Stack"></a>
<b>Stack</h3></b>
<a name="69922"></a>
..., <i>objectref</i>, <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="69923"></a>
OR<p>
<a name="putfield.Stack"></a>
<b>Stack</h3></b>
<a name="69924"></a>
..., <i>objectref</i>, <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="putfield.Description"></a>
<b>Description</h3></b>
<a name="69925"></a>
The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are used to construct an index into the constant pool of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>, where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item at the index must be a <code>CONSTANT_Fieldref</code> <a href="ClassFile.doc.html#4723">(&#167;4.4.2)</a>, a reference to a class name and a field name. If the field is <code>protected</code> <a href="ClassFile.doc.html#1513">(&#167;4.6)</a>, then it must be either a member of the current class or a member of a superclass of the current class, and the class of <i>objectref</i> must be either the current class or a subclass of the current class.<p>
The constant pool item is resolved <a href="ConstantPool.doc.html#49425">(&#167;5.2)</a>, determining both the field width and the field offset. The type of a <i>value</i> stored by a <i>put</i><i>field</i> instruction must be compatible with the descriptor of the field <a href="ClassFile.doc.html#14152">(&#167;4.3.2)</a> of the class instance being stored into. If the field descriptor type is <code>byte</code>, <code>char</code>, <code>short</code>, or <code>int</code>, then the <i>value</i> must be an <code>int</code>. If the field descriptor type is <code>float</code>, <code>long</code>, or <code>double</code>, then the <i>value</i> must be a <code>float</code>, <code>long</code>, or <code>double</code>, respectively. If the field descriptor type is a reference type, then the <i>value</i> must be of a type that is assignment compatible <a href="Concepts.doc.html#19674">(&#167;2.6.6)</a> with the field descriptor type.<p>
<a name="69945"></a>
The <i>value</i> and <i>objectref</i>, which must be of type <code>reference</code>, are popped from the operand stack. The field at the offset from the start of the object referenced by <i>objectref</i> is set to the <i>value</i>.<p>
<a name="putfield.Linking"></a>
<b>Linking Exceptions</h3></b>
<a name="119376"></a>
During resolution of the <code>CONSTANT_Fieldref</code> constant pool item, any of the exceptions documented in <a href="ConstantPool.doc.html#49425">&#167;5.2</a> can be thrown.<p>
<a name="putfield."></a>
<b></h3></b>
<a name="119381"></a>
Otherwise, if the specified field exists but is a <code>static</code> field, <i>putfield</i> throws an <code>IncompatibleClassChangeError</code>.<p>
<a name="putfield.Runtime"></a>
<b>Runtime Exception</h3></b>
<a name="69949"></a>
Otherwise, if <i>objectref</i><em> </em>is <code>null</code>, the <i>putfield</i> instruction throws a <code>NullPointerException</code>.<p>
<a name="putfield.Notes"></a>
<b>Notes</h3></b>
<a name="69950"></a>
The <i>putfield</i> instruction operates on both one- and two-word wide fields.<p>

<a name="putstatic"></a>
<hr><h2>putstatic</h2>
<a name="putstatic.Operation"></a>
<b>Operation</h3></b>
<a name="69961"></a>
Set <code>static</code> field in class<p><Table Border="1">
<tr><td><a name="69956"></a>
 <i>putstatic</i>
<td><a name="87568"></a>
 

<tr><td><a name="69958"></a>
 <i>indexbyte1</i>
<td><a name="87568"></a>
 

<tr><td><a name="69960"></a>
 <i>indexbyte2</i>
<td><a name="87568"></a>
 

</Table><br><br><p>
<a name="putstatic.Forms"></a>
<b>Forms</h3></b>
<a name="69962"></a>
<i>putstatic</i> = 179 (0xb3)<p>
<a name="putstatic.Stack"></a>
<b>Stack</h3></b>
<a name="69963"></a>
..., <i>value</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="69964"></a>
OR<p>
<a name="putstatic.Stack"></a>
<b>Stack</h3></b>
<a name="69965"></a>
..., <i>value.word1</i>, <i>value.word2</i> <img src="chars/arrwdbrt.gif"> ...<p>
<a name="putstatic.Description"></a>
<b>Description</h3></b>
<a name="69966"></a>
The unsigned <i>indexbyte1</i> and <i>indexbyte2</i> are used to construct an index into the constant pool of the current class <a href="Overview.doc.html#17257">(&#167;3.6)</a>, where the value of the index is (<i>indexbyte1</i> << 8) | <i>indexbyte2</i>. The constant pool item at the index must be a <code>CONSTANT_Fieldref</code> <a href="ClassFile.doc.html#4723">(&#167;4.4.2)</a>, a reference to a class name and a field name. If the field is <code>protected</code> <a href="ClassFile.doc.html#1513">(&#167;4.6)</a>, then it must be either a member of the current class or a member of a superclass of the current class. <p>
The constant pool item is resolved <a href="ConstantPool.doc.html#49425">(&#167;5.2)</a>, determining both the class field and its width. The type of a <i>value</i> stored by a <i>putstatic </i>instruction must be compatible with the descriptor of the field <a href="ClassFile.doc.html#14152">(&#167;4.3.2)</a> of the class instance being stored into. If the field descriptor type is <code>byte</code>, <code>char</code>, <code>short</code>, or <code>int</code>, then the <i>value</i> must be an <code>int</code>. If the field descriptor type is <code>float</code>, <code>long</code>, or <code>double</code>, then the <i>value</i> must be a <code>float</code>, <code>long</code>, or <code>double</code>, respectively. If the field descriptor type is a reference type, then the <i>value</i> must be of a type that is assignment compatible <a href="Concepts.doc.html#19674">(&#167;2.6.6)</a> with the field descriptor type.<p>
<a name="69986"></a>
The <i>value</i> is popped from the operand stack, and the class field is set to <i>value</i>.<p>
<a name="putstatic.Linking"></a>
<b>Linking Exceptions</h3></b>
<a name="135940"></a>
During resolution of the <code>CONSTANT_Fieldref</code> constant pool item, any of the exceptions documented in <a href="ConstantPool.doc.html#49425">&#167;5.2</a> can be thrown.<p>
<a name="108678"></a>
Otherwise, if the specified field exists but is not a <code>static</code> field (class variable), <i>putstatic</i> throws an <code>Incompatible-Class-ChangeError</code>.<p>
<a name="putstatic.Notes"></a>
<b>Notes</h3></b>
<a name="69989"></a>
The <i>putstatic</i> instruction operates on both one- and two-word wide fields.<p>
<a name="69990"></a>
<p>


<hr>
<!-- This inserts footnotes--><p>
<a href="VMSpecTOC.doc.html">Contents</a> | <a href="Instructions2.doc10.html">Prev</a> | <a href="Instructions2.doc12.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 + -