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>return-object</title>
      7 <link rel=stylesheet href="opcode.css">
      8 </head>
      9 
     10 <body>
     11 
     12 <h1>return-object</h1>
     13 
     14 <h2>Purpose</h2>
     15 
     16 <p>
     17 Return from an object-returning method.
     18 </p>
     19 
     20 <h2>Details</h2>
     21 
     22 <table class="instruc">
     23 <thead>
     24 <tr>
     25   <th>Op &amp; Format</th>
     26   <th>Mnemonic / Syntax</th>
     27   <th>Arguments</th>
     28 </tr>
     29 </thead>
     30 <tbody>
     31 <tr>
     32   <td>11 11x</td>
     33   <td>return-object vAA</td>
     34   <td><code>A:</code> return value register (8 bits)</td>
     35 </tr>
     36 </tbody>
     37 </table>
     38 
     39 <h2>Constraints</h2>
     40 
     41 <ul>
     42   <li>
     43     The return type of the current method must be a reference.
     44   </li>
     45   <li>
     46     A must be a valid register index in the current stack frame.
     47   </li>
     48   <li>
     49     Register vA must be known to be reference-bearing.
     50   </li>
     51 </ul>
     52 
     53 <h2>Behavior</h2>
     54 
     55 <ul>
     56   <li>
     57     If the method is synchronized, the object's monitor is released in a way
     58     similar to the monitor-exit instruction.
     59   </li>
     60   <li>
     61     The stack frame of the current method invocation is removed from the stack.
     62     This includes all its registers becoming invalid.
     63   </li>
     64   <li>
     65     If the stack is now empty, the current thread terminates.
     66   </li>
     67   <li>
     68     Otherwise, the following happens:
     69   </li>
     70     <ul>
     71       <li>
     72         The stack frame that caused this method invocation becomes valid. This
     73         includes all its registers and their old values.
     74       </li>
     75       <li>
     76         Execution continues at the bytecode instruction immediately following
     77         the invoke instruction that caused this method invocation.
     78       </li>
     79       <li>
     80         The return value can be consumed by (exactly) the first instruction
     81         following the invoke-kind or invoke-kind/range instruction that caused
     82         this method invocation, and this instructions needs to be a
     83         move-result-object instruction.
     84       </li>
     85     </ul>
     86   </li>
     87 </ul>
     88 
     89 <h2>Exceptions</h2>
     90 
     91 <p>
     92 None.
     93 </p>
     94 
     95 </body>
     96 </html>
     97