Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: src/js/harmony-simd.js

Issue 1477073005: Use new.target in favor of %_IsConstructCall intrinsic (1). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/js/harmony-sharedarraybuffer.js ('k') | src/js/messages.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, 426 return %NAMEShuffle(a, b, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10,
427 c11, c12, c13, c14, c15); 427 c11, c12, c13, c14, c15);
428 } 428 }
429 endmacro 429 endmacro
430 430
431 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS) 431 SIMD_X16_TYPES(DECLARE_X16_FUNCTIONS)
432 432
433 //------------------------------------------------------------------- 433 //-------------------------------------------------------------------
434 434
435 function Float32x4Constructor(c0, c1, c2, c3) { 435 function Float32x4Constructor(c0, c1, c2, c3) {
436 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Float32x4"); 436 if (!IS_UNDEFINED(new.target)) {
437 throw MakeTypeError(kNotConstructor, "Float32x4");
438 }
437 return %CreateFloat32x4(TO_NUMBER(c0), TO_NUMBER(c1), 439 return %CreateFloat32x4(TO_NUMBER(c0), TO_NUMBER(c1),
438 TO_NUMBER(c2), TO_NUMBER(c3)); 440 TO_NUMBER(c2), TO_NUMBER(c3));
439 } 441 }
440 442
441 443
442 function Int32x4Constructor(c0, c1, c2, c3) { 444 function Int32x4Constructor(c0, c1, c2, c3) {
443 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int32x4"); 445 if (!IS_UNDEFINED(new.target)) {
446 throw MakeTypeError(kNotConstructor, "Int32x4");
447 }
444 return %CreateInt32x4(TO_NUMBER(c0), TO_NUMBER(c1), 448 return %CreateInt32x4(TO_NUMBER(c0), TO_NUMBER(c1),
445 TO_NUMBER(c2), TO_NUMBER(c3)); 449 TO_NUMBER(c2), TO_NUMBER(c3));
446 } 450 }
447 451
448 452
449 function Uint32x4Constructor(c0, c1, c2, c3) { 453 function Uint32x4Constructor(c0, c1, c2, c3) {
450 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint32x4"); 454 if (!IS_UNDEFINED(new.target)) {
455 throw MakeTypeError(kNotConstructor, "Uint32x4");
456 }
451 return %CreateUint32x4(TO_NUMBER(c0), TO_NUMBER(c1), 457 return %CreateUint32x4(TO_NUMBER(c0), TO_NUMBER(c1),
452 TO_NUMBER(c2), TO_NUMBER(c3)); 458 TO_NUMBER(c2), TO_NUMBER(c3));
453 } 459 }
454 460
455 461
456 function Bool32x4Constructor(c0, c1, c2, c3) { 462 function Bool32x4Constructor(c0, c1, c2, c3) {
457 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool32x4"); 463 if (!IS_UNDEFINED(new.target)) {
464 throw MakeTypeError(kNotConstructor, "Bool32x4");
465 }
458 return %CreateBool32x4(c0, c1, c2, c3); 466 return %CreateBool32x4(c0, c1, c2, c3);
459 } 467 }
460 468
461 469
462 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { 470 function Int16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) {
463 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int16x8"); 471 if (!IS_UNDEFINED(new.target)) {
472 throw MakeTypeError(kNotConstructor, "Int16x8");
473 }
464 return %CreateInt16x8(TO_NUMBER(c0), TO_NUMBER(c1), 474 return %CreateInt16x8(TO_NUMBER(c0), TO_NUMBER(c1),
465 TO_NUMBER(c2), TO_NUMBER(c3), 475 TO_NUMBER(c2), TO_NUMBER(c3),
466 TO_NUMBER(c4), TO_NUMBER(c5), 476 TO_NUMBER(c4), TO_NUMBER(c5),
467 TO_NUMBER(c6), TO_NUMBER(c7)); 477 TO_NUMBER(c6), TO_NUMBER(c7));
468 } 478 }
469 479
470 480
471 function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { 481 function Uint16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) {
472 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint16x8"); 482 if (!IS_UNDEFINED(new.target)) {
483 throw MakeTypeError(kNotConstructor, "Uint16x8");
484 }
473 return %CreateUint16x8(TO_NUMBER(c0), TO_NUMBER(c1), 485 return %CreateUint16x8(TO_NUMBER(c0), TO_NUMBER(c1),
474 TO_NUMBER(c2), TO_NUMBER(c3), 486 TO_NUMBER(c2), TO_NUMBER(c3),
475 TO_NUMBER(c4), TO_NUMBER(c5), 487 TO_NUMBER(c4), TO_NUMBER(c5),
476 TO_NUMBER(c6), TO_NUMBER(c7)); 488 TO_NUMBER(c6), TO_NUMBER(c7));
477 } 489 }
478 490
479 491
480 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) { 492 function Bool16x8Constructor(c0, c1, c2, c3, c4, c5, c6, c7) {
481 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool16x8"); 493 if (!IS_UNDEFINED(new.target)) {
494 throw MakeTypeError(kNotConstructor, "Bool16x8");
495 }
482 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7); 496 return %CreateBool16x8(c0, c1, c2, c3, c4, c5, c6, c7);
483 } 497 }
484 498
485 499
486 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, 500 function Int8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11,
487 c12, c13, c14, c15) { 501 c12, c13, c14, c15) {
488 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Int8x16"); 502 if (!IS_UNDEFINED(new.target)) {
503 throw MakeTypeError(kNotConstructor, "Int8x16");
504 }
489 return %CreateInt8x16(TO_NUMBER(c0), TO_NUMBER(c1), 505 return %CreateInt8x16(TO_NUMBER(c0), TO_NUMBER(c1),
490 TO_NUMBER(c2), TO_NUMBER(c3), 506 TO_NUMBER(c2), TO_NUMBER(c3),
491 TO_NUMBER(c4), TO_NUMBER(c5), 507 TO_NUMBER(c4), TO_NUMBER(c5),
492 TO_NUMBER(c6), TO_NUMBER(c7), 508 TO_NUMBER(c6), TO_NUMBER(c7),
493 TO_NUMBER(c8), TO_NUMBER(c9), 509 TO_NUMBER(c8), TO_NUMBER(c9),
494 TO_NUMBER(c10), TO_NUMBER(c11), 510 TO_NUMBER(c10), TO_NUMBER(c11),
495 TO_NUMBER(c12), TO_NUMBER(c13), 511 TO_NUMBER(c12), TO_NUMBER(c13),
496 TO_NUMBER(c14), TO_NUMBER(c15)); 512 TO_NUMBER(c14), TO_NUMBER(c15));
497 } 513 }
498 514
499 515
500 function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, 516 function Uint8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11,
501 c12, c13, c14, c15) { 517 c12, c13, c14, c15) {
502 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Uint8x16"); 518 if (!IS_UNDEFINED(new.target)) {
519 throw MakeTypeError(kNotConstructor, "Uint8x16");
520 }
503 return %CreateUint8x16(TO_NUMBER(c0), TO_NUMBER(c1), 521 return %CreateUint8x16(TO_NUMBER(c0), TO_NUMBER(c1),
504 TO_NUMBER(c2), TO_NUMBER(c3), 522 TO_NUMBER(c2), TO_NUMBER(c3),
505 TO_NUMBER(c4), TO_NUMBER(c5), 523 TO_NUMBER(c4), TO_NUMBER(c5),
506 TO_NUMBER(c6), TO_NUMBER(c7), 524 TO_NUMBER(c6), TO_NUMBER(c7),
507 TO_NUMBER(c8), TO_NUMBER(c9), 525 TO_NUMBER(c8), TO_NUMBER(c9),
508 TO_NUMBER(c10), TO_NUMBER(c11), 526 TO_NUMBER(c10), TO_NUMBER(c11),
509 TO_NUMBER(c12), TO_NUMBER(c13), 527 TO_NUMBER(c12), TO_NUMBER(c13),
510 TO_NUMBER(c14), TO_NUMBER(c15)); 528 TO_NUMBER(c14), TO_NUMBER(c15));
511 } 529 }
512 530
513 531
514 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, 532 function Bool8x16Constructor(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11,
515 c12, c13, c14, c15) { 533 c12, c13, c14, c15) {
516 if (%_IsConstructCall()) throw MakeTypeError(kNotConstructor, "Bool8x16"); 534 if (!IS_UNDEFINED(new.target)) {
535 throw MakeTypeError(kNotConstructor, "Bool8x16");
536 }
517 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, 537 return %CreateBool8x16(c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,
518 c13, c14, c15); 538 c13, c14, c15);
519 } 539 }
520 540
521 541
522 function Float32x4AbsJS(a) { 542 function Float32x4AbsJS(a) {
523 return %Float32x4Abs(a); 543 return %Float32x4Abs(a);
524 } 544 }
525 545
526 546
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 to.Bool32x4ToString = Bool32x4ToString; 932 to.Bool32x4ToString = Bool32x4ToString;
913 to.Int16x8ToString = Int16x8ToString; 933 to.Int16x8ToString = Int16x8ToString;
914 to.Uint16x8ToString = Uint16x8ToString; 934 to.Uint16x8ToString = Uint16x8ToString;
915 to.Bool16x8ToString = Bool16x8ToString; 935 to.Bool16x8ToString = Bool16x8ToString;
916 to.Int8x16ToString = Int8x16ToString; 936 to.Int8x16ToString = Int8x16ToString;
917 to.Uint8x16ToString = Uint8x16ToString; 937 to.Uint8x16ToString = Uint8x16ToString;
918 to.Bool8x16ToString = Bool8x16ToString; 938 to.Bool8x16ToString = Bool8x16ToString;
919 }); 939 });
920 940
921 }) 941 })
OLDNEW
« no previous file with comments | « src/js/harmony-sharedarraybuffer.js ('k') | src/js/messages.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698