| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 (function() { |
| 6 |
| 5 "use strict"; | 7 "use strict"; |
| 6 | 8 |
| 7 // This file relies on the fact that the following declaration has been made | 9 %CheckIsBootstrapping(); |
| 8 // in runtime.js: | |
| 9 // var $Array = global.Array; | |
| 10 | 10 |
| 11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
| 12 | 12 |
| 13 macro TYPED_ARRAYS(FUNCTION) | 13 macro TYPED_ARRAYS(FUNCTION) |
| 14 // arrayIds below should be synchronized with Runtime_TypedArrayInitialize. | 14 // arrayIds below should be synchronized with Runtime_TypedArrayInitialize. |
| 15 FUNCTION(1, Uint8Array, 1) | 15 FUNCTION(1, Uint8Array, 1) |
| 16 FUNCTION(2, Int8Array, 1) | 16 FUNCTION(2, Int8Array, 1) |
| 17 FUNCTION(3, Uint16Array, 2) | 17 FUNCTION(3, Uint16Array, 2) |
| 18 FUNCTION(4, Int16Array, 2) | 18 FUNCTION(4, Int16Array, 2) |
| 19 FUNCTION(5, Uint32Array, 4) | 19 FUNCTION(5, Uint32Array, 4) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 array[i] = %_Arguments(i); | 65 array[i] = %_Arguments(i); |
| 66 } | 66 } |
| 67 return array; | 67 return array; |
| 68 } | 68 } |
| 69 | 69 |
| 70 endmacro | 70 endmacro |
| 71 | 71 |
| 72 TYPED_ARRAYS(TYPED_ARRAY_HARMONY_ADDITIONS) | 72 TYPED_ARRAYS(TYPED_ARRAY_HARMONY_ADDITIONS) |
| 73 | 73 |
| 74 | 74 |
| 75 function HarmonyTypedArrayExtendPrototypes() { | |
| 76 macro EXTEND_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE) | 75 macro EXTEND_TYPED_ARRAY(ARRAY_ID, NAME, ELEMENT_SIZE) |
| 77 %CheckIsBootstrapping(); | |
| 78 | |
| 79 // Set up non-enumerable functions on the object. | 76 // Set up non-enumerable functions on the object. |
| 80 InstallFunctions(global.NAME, DONT_ENUM | DONT_DELETE | READ_ONLY, [ | 77 InstallFunctions(global.NAME, DONT_ENUM | DONT_DELETE | READ_ONLY, [ |
| 81 "of", NAMEOf | 78 "of", NAMEOf |
| 82 ]); | 79 ]); |
| 83 | 80 |
| 84 // Set up non-enumerable functions on the prototype object. | 81 // Set up non-enumerable functions on the prototype object. |
| 85 InstallFunctions(global.NAME.prototype, DONT_ENUM, [ | 82 InstallFunctions(global.NAME.prototype, DONT_ENUM, [ |
| 86 "forEach", NAMEForEach | 83 "forEach", NAMEForEach |
| 87 ]); | 84 ]); |
| 88 endmacro | 85 endmacro |
| 89 | 86 |
| 90 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) | 87 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) |
| 91 } | |
| 92 | 88 |
| 93 HarmonyTypedArrayExtendPrototypes(); | 89 })(); |
| OLD | NEW |