summaryrefslogtreecommitdiffstats
path: root/docs/opcodes/opcode-25-filled-new-array-range.html
blob: 2ee750562c8ae09a037484451933f1cdba0a634a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>

<head>
<title>filled-new-array/range</title>
<link rel=stylesheet href="opcode.css">
</head>

<body>

<h1>filled-new-array/range</h1>

<h2>Purpose</h2>

<p>
Construct an array of the given type and size, filling it with the supplied
contents. Clarifications and restrictions are the same as filled-new-array,
described above.
</p>

<h2>Details</h2>

<table class="instruc">
<thead>
<tr>
  <th>Op &amp; Format</th>
  <th>Mnemonic / Syntax</th>
  <th>Arguments</th>
</tr>
</thead>
<tbody>
<tr>
  <td>25 3rc</td>
  <td>filled-new-array/range {vCCCC .. vNNNN}, type@BBBB</td>
  <td><code>A:</code> array size and argument word count (8 bits)<br/>
    <code>B:</code> type index (16 bits)<br/>
    <code>C:</code> first argument register (16 bits)<br/>
    <code>N = A + C - 1</code></td>
</tr>
</tbody>
</table>

<h2>Constraints</h2>

<ul>
  <li>
    vN must be a valid register index in the current stack frame (this means
    everything below vN is valid, too).
  </li>
  <li>
    For all values I in the interval [C .. N] the following must hold:
    <ul>
      <li>
        vI must not be part of a register pair
      </li>
      <li>
        If the array type is a simple type, vI must be a simple type, too.
      </li>
      <li>
        If the array type is a reference type, vI must be a reference type, too.
      </li>
    </ul>
  </li>
  <li>
    B must be a valid index into the type pool.
  </li>
  <li>
    The type denoted by B must be an array type.
  </li>
  <li>
    The element size of the type denoted by B must be no larger than 32 bits.
  </li>
</ul>

<h2>Behavior</h2>

<ul>
  <li>
    An attempt is made to get a reference to the type T the name of which is
    contained in type pool entry B.
  </li>
  <li>
    If T has not been loaded and resolved before, it is being loaded and
    resolved. All exceptions that are possible during class loading can occur at
    this point.
  </li>
  <li>
    An attempt is made to create a new instance J of type T and length vA. All
    exceptions that are possible during instantiation can occur at this point.
  </li>
  <li>
    The elements of R are filled according to the following rules:
    <ul>
      <li>
        J[0] = vC
      </li>
      <li>
        J[1] = v(C+1)
      </li>
      <li>
        ...
      </li>
      <li>
        J[vA] = vN
      </li>
    </ul>
  </li>
  <li>
    No reference to J is stored in any register. Instead, J can be accessed by a
    move-result-object instruction immediately following this filled-new-array
    instruction.
  </li>
</ul>

<h2>Exceptions</h2>

<ul>
  <li>
    NegativeArraySizeException if vA < 0
  </li>
</ul>

</body>
</html>