| The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 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>fill-array-data</title> | 
 | 7 | <link rel=stylesheet href="opcode.css"> | 
 | 8 | </head> | 
 | 9 |  | 
 | 10 | <body> | 
 | 11 |  | 
 | 12 | <h1>fill-array-data</h1> | 
 | 13 |  | 
 | 14 | <h2>Purpose</h2> | 
 | 15 |  | 
 | 16 | <p> | 
 | 17 | Fill the given array with the indicated data. The reference must be to an array | 
 | 18 | of primitives, and the data table must match it in type and size. | 
 | 19 | </p> | 
 | 20 | <p> | 
 | 21 | Note: The address of the table is guaranteed to be even (that is, 4-byte | 
 | 22 | aligned). If the code size of the method is otherwise odd, then an extra code | 
 | 23 | unit is inserted between the main code and the table whose value is the same as | 
| Carl Shapiro | de75089 | 2010-06-08 16:37:12 -0700 | [diff] [blame^] | 24 | a nop. | 
| The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 25 | </p> | 
 | 26 |  | 
 | 27 | <h2>Details</h2> | 
 | 28 |  | 
 | 29 | <table class="instruc"> | 
 | 30 | <thead> | 
 | 31 | <tr> | 
 | 32 |   <th>Op & Format</th> | 
 | 33 |   <th>Mnemonic / Syntax</th> | 
 | 34 |   <th>Arguments</th> | 
 | 35 | </tr> | 
 | 36 | </thead> | 
 | 37 | <tbody> | 
 | 38 |   <td>26 31t</td> | 
 | 39 |   <td>fill-array-data vAA, +BBBBBBBB <i>(with supplemental data as specified | 
 | 40 |     below in "<code>fill-array-data</code> Format")</i></td> | 
 | 41 |   <td><code>A:</code> array reference (8 bits)<br/> | 
 | 42 |     <code>B:</code> signed "branch" offset to table data (32 bits)</td> | 
 | 43 |   </td> | 
 | 44 | </tbody> | 
 | 45 | </table> | 
 | 46 |  | 
 | 47 | <h2>Constraints</h2> | 
 | 48 |  | 
 | 49 | <ul> | 
 | 50 |   <li> | 
 | 51 |     A must be a valid register index in the current stack frame. | 
 | 52 |   </li> | 
 | 53 |   <li> | 
 | 54 |     vA must be a reference-bearing register (according to data flow) and contain | 
 | 55 |     an array-reference. | 
 | 56 |   </li> | 
 | 57 |   <li> | 
 | 58 |     B must be branch offset in the same method. | 
 | 59 |   </li> | 
 | 60 |   <li> | 
 | 61 |     The target address (PC+B) must be 4-byte aligned. | 
 | 62 |   </li> | 
 | 63 |   <li> | 
 | 64 |     The target address must hold the pseudo-opcode 0x300. | 
 | 65 |   </li> | 
 | 66 |   <li> | 
 | 67 |     The table entry size must match the size of the data type of the array. | 
 | 68 |   </li> | 
 | 69 |   <li> | 
 | 70 |     The table size must be equal or smaller than the array length. | 
 | 71 |   </li> | 
| Carl Shapiro | de75089 | 2010-06-08 16:37:12 -0700 | [diff] [blame^] | 72 | </ul> | 
 | 73 |  | 
| The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 74 | <h2>Behavior</h2> | 
 | 75 |  | 
 | 76 | <ul> | 
 | 77 |   <li> | 
 | 78 |     The contents of the array referenced by vA are filled with the table data, | 
 | 79 |     starting from array index 0 and in the given order. | 
 | 80 |   </li> | 
 | 81 |   <li> | 
 | 82 |     If there are less elements in the table than the array provides space for, | 
 | 83 |     the remaining array elements stay untouched. | 
 | 84 |   </li> | 
 | 85 | </ul> | 
 | 86 |  | 
 | 87 | <h2>Exceptions</h2> | 
 | 88 |  | 
 | 89 | <ul> | 
 | 90 |   <li> | 
| Carl Shapiro | de75089 | 2010-06-08 16:37:12 -0700 | [diff] [blame^] | 91 |     NullPointerException if vA is null. | 
| The Android Open Source Project | f6c3871 | 2009-03-03 19:28:47 -0800 | [diff] [blame] | 92 |   </li> | 
 | 93 | </ul> | 
 | 94 |  | 
 | 95 | </body> | 
 | 96 | </html> |