Home | History | Annotate | Download | only in opcodes
      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>
     17 Perform the identified object instance field operation with the identified
     18 field, loading or storing into the value register.
     19 </p>
     20 <p>
     21 Note: These opcodes are reasonable candidates for static linking, altering the
     22 field 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>52..58 22c</td>
     38   <td>i<i>instanceop</i> vA, vB, field@CCCC<br/>
     39     52: iget<br/>
     40     53: iget-wide<br/>
     41     54: iget-object<br/>
     42     55: iget-boolean<br/>
     43     56: iget-byte<br/>
     44     57: iget-char<br/>
     45     58: iget-short<br/>
     46   </td>
     47   <td><code>A:</code> dest 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 stackframe.
     59   </li>
     60   <li>
     61     For the -wide variant, also A+1 must be a valid register index in the
     62     current stackframe.
     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 </ul>
     75 
     76 <h2>Behavior</h2>
     77 
     78 <ul>
     79   <li>
     80     The value of the given instance field is read from the given object and
     81     moved into the given register vA, that is, vA'=&lt;object&gt;.&lt;field&gt;.
     82   </li>
     83   <li>
     84     If v(A-1) is the lower half of a register pair, v(A-1)' becomes undefined.
     85   </li>
     86     <li>For all but the -wide variant, if v(A+1) is the upper half of a register
     87     pair, v(A+1)' becomes undefined.
     88   </li>
     89   <li>
     90     For the -wide variant, if v(A+2) is the upper half of a register pair,
     91     v(A+2)' becomes undefined.
     92   </li>
     93 </ul>
     94 
     95 <h2>Exceptions</h2>
     96 
     97 <ul>
     98   <li>
     99     NullPointerException if object is null.
    100   </li>
    101   <li>
    102     IllegalAccessException if &lt;object&gt;.&lt;field&gt; is not visible from
    103     the current context according to the usual visibility and access rules of
    104     the Java programming language.
    105   </li>
    106 </ul>
    107 
    108 </body>
    109 </html>
    110