OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 var $arrayValues; | 5 var $arrayValues; |
6 | 6 |
7 (function(global, utils) { | 7 (function(global, utils) { |
8 | 8 |
9 "use strict"; | 9 "use strict"; |
10 | 10 |
11 %CheckIsBootstrapping(); | 11 %CheckIsBootstrapping(); |
12 | 12 |
| 13 // ----------------------------------------------------------------------- |
| 14 // Imports |
| 15 |
| 16 var arrayIterationKindSymbol = |
| 17 utils.GetPrivateSymbol("array_iteration_kind_symbol"); |
| 18 var arrayIteratorNextIndexSymbol = |
| 19 utils.GetPrivateSymbol("array_iterator_next_symbol"); |
| 20 var arrayIteratorObjectSymbol = |
| 21 utils.GetPrivateSymbol("array_iterator_object_symbol"); |
13 var GlobalArray = global.Array; | 22 var GlobalArray = global.Array; |
14 | 23 |
15 macro TYPED_ARRAYS(FUNCTION) | 24 macro TYPED_ARRAYS(FUNCTION) |
16 FUNCTION(Uint8Array) | 25 FUNCTION(Uint8Array) |
17 FUNCTION(Int8Array) | 26 FUNCTION(Int8Array) |
18 FUNCTION(Uint16Array) | 27 FUNCTION(Uint16Array) |
19 FUNCTION(Int16Array) | 28 FUNCTION(Int16Array) |
20 FUNCTION(Uint32Array) | 29 FUNCTION(Uint32Array) |
21 FUNCTION(Int32Array) | 30 FUNCTION(Int32Array) |
22 FUNCTION(Float32Array) | 31 FUNCTION(Float32Array) |
23 FUNCTION(Float64Array) | 32 FUNCTION(Float64Array) |
24 FUNCTION(Uint8ClampedArray) | 33 FUNCTION(Uint8ClampedArray) |
25 endmacro | 34 endmacro |
26 | 35 |
27 macro COPY_FROM_GLOBAL(NAME) | 36 macro COPY_FROM_GLOBAL(NAME) |
28 var GlobalNAME = global.NAME; | 37 var GlobalNAME = global.NAME; |
29 endmacro | 38 endmacro |
30 | 39 |
31 TYPED_ARRAYS(COPY_FROM_GLOBAL) | 40 TYPED_ARRAYS(COPY_FROM_GLOBAL) |
32 | 41 |
33 var arrayIteratorObjectSymbol = GLOBAL_PRIVATE("ArrayIterator#object"); | 42 // ----------------------------------------------------------------------- |
34 var arrayIteratorNextIndexSymbol = GLOBAL_PRIVATE("ArrayIterator#next"); | |
35 var arrayIterationKindSymbol = GLOBAL_PRIVATE("ArrayIterator#kind"); | |
36 | |
37 | 43 |
38 function ArrayIterator() {} | 44 function ArrayIterator() {} |
39 | 45 |
40 | 46 |
41 // TODO(wingo): Update section numbers when ES6 has stabilized. The | 47 // TODO(wingo): Update section numbers when ES6 has stabilized. The |
42 // section numbers below are already out of date as of the May 2014 | 48 // section numbers below are already out of date as of the May 2014 |
43 // draft. | 49 // draft. |
44 | 50 |
45 | 51 |
46 // 15.4.5.1 CreateArrayIterator Abstract Operation | 52 // 15.4.5.1 CreateArrayIterator Abstract Operation |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 to.ArrayIteratorCreateResultObject = CreateIteratorResultObject; | 168 to.ArrayIteratorCreateResultObject = CreateIteratorResultObject; |
163 }); | 169 }); |
164 | 170 |
165 $arrayValues = ArrayValues; | 171 $arrayValues = ArrayValues; |
166 | 172 |
167 utils.ExportToRuntime(function(to) { | 173 utils.ExportToRuntime(function(to) { |
168 to.ArrayValues = ArrayValues; | 174 to.ArrayValues = ArrayValues; |
169 }); | 175 }); |
170 | 176 |
171 }) | 177 }) |
OLD | NEW |