1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
6 <title>new-array</title>
7 <link rel=stylesheet href="opcode.css">
17 Construct a new array of the indicated type and size. The type must be an array
23 <table class="instruc">
26 <th>Op & Format</th>
27 <th>Mnemonic / Syntax</th>
34 <td>new-array vA, vB, type@CCCC</td>
35 <td><code>A:</code> destination register (8 bits)<br/>
36 <code>B:</code> size register<br/>
37 <code>C:</code> type index</td>
46 A and B must be valid register indices for the current stack frame.
49 Register vB must not contain a reference value.
52 Register vB must not be part of a register pair.
55 C must be a valid index into the type pool.
58 Type constant pool entry C must contain a valid array type descriptor.
66 An attempt is made to get a reference to the class K the name of which is
67 contained in type pool entry C.
70 If K has not been loaded and resolved before, it is being loaded and
71 resolved. All exceptions that are possible during class loading can occur at
75 An attempt is made to create a new instance I of K and length B. All
76 exceptions that are possible during instantiation can occur at this point.
79 All elements of the new array are initialized to null (for object arrays) or
80 0 (for numeric arrays) or false (for boolean arrays).
83 A reference to the new array is moved to register vA, that is, vA' = I.
86 If v(A-1) is the lower half of a register pair, v(A-1)' becomes undefined.
89 If v(A+1) is the upper half of a register pair, v(A+1)' becomes undefined.
97 NegativeArraySizeException if vB < 0
100 All exceptions that are possible during class loading can occur.
103 All exceptions that are possible during instantiation can occur.