• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
3<html>
4
5<head>
6<title>iget&lt;kind&gt;</title>
7<link rel=stylesheet href="opcode.css">
8</head>
9
10<body>
11
12<h1>iget&lt;kind&gt;</h1>
13
14<h2>Purpose</h2>
15
16<p>
17Perform the identified object instance field operation with the identified
18field, loading or storing into the value register.
19</p>
20<p>
21Note: These opcodes are reasonable candidates for static linking, altering the
22field argument to be a more direct offset.
23</p>
24
25<h2>Details</h2>
26
27<table class="instruc">
28<thead>
29<tr>
30  <th>Op &amp; Format</th>
31  <th>Mnemonic / Syntax</th>
32  <th>Arguments</th>
33</tr>
34</thead>
35<tbody>
36<tr>
37  <td>59..5f 22c</td>
38  <td>i<i>instanceop</i> vA, vB, field@CCCC<br/>
39    59: iput<br/>
40    5a: iput-wide<br/>
41    5b: iput-object<br/>
42    5c: iput-boolean<br/>
43    5d: iput-byte<br/>
44    5e: iput-char<br/>
45    5f: iput-short
46  </td>
47  <td><code>A:</code> source value register or pair; (4 bits)<br/>
48    <code>B:</code> object register (4 bits)<br/>
49    <code>C:</code> instance field reference index (16 bits)</td>
50</tr>
51</tbody>
52</table>
53
54<h2>Constraints</h2>
55
56<ul>
57  <li>
58    A and B must be valid register indices in the current stack frame.
59  </li>
60  <li>
61    For the -wide variant, also A+1 must be a valid register index in the
62    current stack frame.
63  </li>
64  <li>
65    Register vB must contain an object reference.
66  </li>
67  <li>
68    C must be a valid index into the field reference pool.
69  </li>
70  <li>
71    The field must be an instance field. The type of the field denoted by C must
72    match the variant of the instruction.
73  </li>
74  <li>
75    For the -object variant, the instance referenced by register vA must be
76    assignment-compatible to the type of the field.
77  </li>
78</ul>
79
80<h2>Behavior</h2>
81
82<ul>
83  <li>
84    For all but the -wide variant, the value of register vA is move into the
85    field, that is, &lt;object&gt;.&lt;field&gt;'=vA.
86  </li>
87  <li>
88    For the -wide variant, the registers vA and v(A+1) are moved into the
89    field as follows:
90    <ul>
91      <li>
92        &lt;object&gt;.&lt;field&gt;' = vA &lt;&lt; 0x20 | v(A+1)
93      </li>
94    </ul>
95  </li>
96</ul>
97
98<h2>Exceptions</h2>
99
100<ul>
101  <li>
102    NullPointerException if vB=null.
103  </li>
104  <li>
105    IllegalAccessException if &lt;object&gt;.&lt;field&gt; is not visible from
106    the current context according to the usual visibility and access rules of
107    the Java programming language, or final.
108  </li>
109</ul>
110
111</body>
112</html>
113