|
3 | 3 | // found in the LICENSE file. |
4 | 4 |
|
5 | 5 | module array { |
6 | | - macro LoadWithHoleCheck<Elements : type>( |
| 6 | + macro LoadWithHoleCheck<Elements: type>( |
7 | 7 | elements: FixedArrayBase, index: Smi): Object |
8 | | - labels IfHole; |
| 8 | + labels IfHole; |
9 | 9 |
|
10 | 10 | LoadWithHoleCheck<FixedArray>(elements: FixedArrayBase, index: Smi): Object |
11 | | - labels IfHole { |
| 11 | + labels IfHole { |
12 | 12 | const elements: FixedArray = UnsafeCast<FixedArray>(elements); |
13 | 13 | const element: Object = elements[index]; |
14 | 14 | if (element == Hole) goto IfHole; |
15 | 15 | return element; |
16 | 16 | } |
17 | 17 |
|
18 | | - LoadWithHoleCheck<FixedDoubleArray>( |
19 | | - elements: FixedArrayBase, index: Smi): Object |
20 | | - labels IfHole { |
| 18 | + LoadWithHoleCheck<FixedDoubleArray>(elements: FixedArrayBase, index: Smi): |
| 19 | + Object |
| 20 | + labels IfHole { |
21 | 21 | const elements: FixedDoubleArray = UnsafeCast<FixedDoubleArray>(elements); |
22 | 22 | const element: float64 = LoadDoubleWithHoleCheck(elements, index) |
23 | | - otherwise IfHole; |
| 23 | + otherwise IfHole; |
24 | 24 | return AllocateHeapNumberWithValue(element); |
25 | 25 | } |
26 | 26 |
|
27 | | - macro FastArrayLastIndexOf<Elements : type>( |
| 27 | + macro FastArrayLastIndexOf<Elements: type>( |
28 | 28 | context: Context, array: JSArray, length: Smi, from: Smi, |
29 | 29 | searchElement: Object): Smi { |
30 | 30 | const elements: FixedArrayBase = array.elements; |
31 | 31 | let k: Smi = from; |
32 | 32 | while (k >= 0) { |
33 | 33 | try { |
34 | 34 | const element: Object = LoadWithHoleCheck<Elements>(elements, k) |
35 | | - otherwise Hole; |
| 35 | + otherwise Hole; |
36 | 36 |
|
37 | 37 | const same: Boolean = StrictEqual(searchElement, element); |
38 | 38 | if (same == True) { |
@@ -74,7 +74,7 @@ module array { |
74 | 74 | macro TryFastArrayLastIndexOf( |
75 | 75 | context: Context, receiver: JSReceiver, searchElement: Object, |
76 | 76 | from: Number): Object |
77 | | - labels Slow { |
| 77 | + labels Slow { |
78 | 78 | EnsureFastJSArray(context, receiver) otherwise Slow; |
79 | 79 | const array: JSArray = UnsafeCast<JSArray>(receiver); |
80 | 80 |
|
@@ -142,7 +142,7 @@ module array { |
142 | 142 |
|
143 | 143 | try { |
144 | 144 | return TryFastArrayLastIndexOf(context, object, searchElement, from) |
145 | | - otherwise Baseline; |
| 145 | + otherwise Baseline; |
146 | 146 | } |
147 | 147 | label Baseline { |
148 | 148 | return GenericArrayLastIndexOf(context, object, searchElement, from); |
|
0 commit comments