| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 // Flags: --harmony-simd --harmony-reflect | 5 // Flags: --harmony-simd |
| 6 // Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt | 6 // Flags: --allow-natives-syntax --expose-natives-as natives --noalways-opt |
| 7 | 7 |
| 8 function lanesForType(typeName) { | 8 function lanesForType(typeName) { |
| 9 // The lane count follows the first 'x' in the type name, which begins with | 9 // The lane count follows the first 'x' in the type name, which begins with |
| 10 // 'float', 'int', or 'bool'. | 10 // 'float', 'int', or 'bool'. |
| 11 return Number.parseInt(typeName.substr(typeName.indexOf('x') + 1)); | 11 return Number.parseInt(typeName.substr(typeName.indexOf('x') + 1)); |
| 12 } | 12 } |
| 13 | 13 |
| 14 | 14 |
| 15 // Creates an instance that has been zeroed, so it can be used for equality | 15 // Creates an instance that has been zeroed, so it can be used for equality |
| (...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 assertEquals(expected, JSON.stringify(input, null, 0)); | 625 assertEquals(expected, JSON.stringify(input, null, 0)); |
| 626 } | 626 } |
| 627 | 627 |
| 628 TestStringify(undefined, SIMD.Float32x4(1, 2, 3, 4)); | 628 TestStringify(undefined, SIMD.Float32x4(1, 2, 3, 4)); |
| 629 TestStringify('[null]', [SIMD.Float32x4(1, 2, 3, 4)]); | 629 TestStringify('[null]', [SIMD.Float32x4(1, 2, 3, 4)]); |
| 630 TestStringify('[{}]', [Object(SIMD.Float32x4(1, 2, 3, 4))]); | 630 TestStringify('[{}]', [Object(SIMD.Float32x4(1, 2, 3, 4))]); |
| 631 var simd_wrapper = Object(SIMD.Float32x4(1, 2, 3, 4)); | 631 var simd_wrapper = Object(SIMD.Float32x4(1, 2, 3, 4)); |
| 632 TestStringify('{}', simd_wrapper); | 632 TestStringify('{}', simd_wrapper); |
| 633 simd_wrapper.a = 1; | 633 simd_wrapper.a = 1; |
| 634 TestStringify('{"a":1}', simd_wrapper); | 634 TestStringify('{"a":1}', simd_wrapper); |
| OLD | NEW |