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-tostring --harmony-reflect | 5 // Flags: --harmony-simd --harmony-tostring --harmony-reflect |
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'. |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 var instance = createInstance(type); | 330 var instance = createInstance(type); |
331 | 331 |
332 // Every SIMD value should equal itself, and non-strictly equal its wrapper. | 332 // Every SIMD value should equal itself, and non-strictly equal its wrapper. |
333 assertSame(instance, instance) | 333 assertSame(instance, instance) |
334 assertEquals(instance, instance) | 334 assertEquals(instance, instance) |
335 assertTrue(Object.is(instance, instance)) | 335 assertTrue(Object.is(instance, instance)) |
336 assertTrue(instance === instance) | 336 assertTrue(instance === instance) |
337 assertTrue(instance == instance) | 337 assertTrue(instance == instance) |
338 assertFalse(instance === Object(instance)) | 338 assertFalse(instance === Object(instance)) |
339 assertFalse(Object(instance) === instance) | 339 assertFalse(Object(instance) === instance) |
340 assertFalse(instance == Object(instance)) | 340 assertTrue(instance == Object(instance)) |
341 assertFalse(Object(instance) == instance) | 341 assertTrue(Object(instance) == instance) |
342 assertTrue(instance === instance.valueOf()) | 342 assertTrue(instance === instance.valueOf()) |
343 assertTrue(instance.valueOf() === instance) | 343 assertTrue(instance.valueOf() === instance) |
344 assertTrue(instance == instance.valueOf()) | 344 assertTrue(instance == instance.valueOf()) |
345 assertTrue(instance.valueOf() == instance) | 345 assertTrue(instance.valueOf() == instance) |
346 assertFalse(Object(instance) === Object(instance)) | 346 assertFalse(Object(instance) === Object(instance)) |
347 assertEquals(Object(instance).valueOf(), Object(instance).valueOf()) | 347 assertEquals(Object(instance).valueOf(), Object(instance).valueOf()) |
348 | 348 |
349 function notEqual(other) { | 349 function notEqual(other) { |
350 assertFalse(instance === other) | 350 assertFalse(instance === other) |
351 assertFalse(other === instance) | 351 assertFalse(other === instance) |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 assertSame(Object.getPrototypeOf(SIMD), Object.prototype); | 611 assertSame(Object.getPrototypeOf(SIMD), Object.prototype); |
612 assertSame(SIMD + "", "[object SIMD]"); | 612 assertSame(SIMD + "", "[object SIMD]"); |
613 // The SIMD object is mutable. | 613 // The SIMD object is mutable. |
614 SIMD.foo = "foo"; | 614 SIMD.foo = "foo"; |
615 assertSame(SIMD.foo, "foo"); | 615 assertSame(SIMD.foo, "foo"); |
616 delete SIMD.foo; | 616 delete SIMD.foo; |
617 delete SIMD.Bool8x16; | 617 delete SIMD.Bool8x16; |
618 assertSame(SIMD.Bool8x16, undefined); | 618 assertSame(SIMD.Bool8x16, undefined); |
619 } | 619 } |
620 TestSIMDObject() | 620 TestSIMDObject() |
OLD | NEW |