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 #include "src/compiler/representation-change.h" | 5 #include "src/compiler/representation-change.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 return machine()->Int32Div(); | 576 return machine()->Int32Div(); |
577 case IrOpcode::kNumberModulus: | 577 case IrOpcode::kNumberModulus: |
578 return machine()->Int32Mod(); | 578 return machine()->Int32Mod(); |
579 case IrOpcode::kNumberBitwiseOr: | 579 case IrOpcode::kNumberBitwiseOr: |
580 return machine()->Word32Or(); | 580 return machine()->Word32Or(); |
581 case IrOpcode::kNumberBitwiseXor: | 581 case IrOpcode::kNumberBitwiseXor: |
582 return machine()->Word32Xor(); | 582 return machine()->Word32Xor(); |
583 case IrOpcode::kNumberBitwiseAnd: | 583 case IrOpcode::kNumberBitwiseAnd: |
584 return machine()->Word32And(); | 584 return machine()->Word32And(); |
585 case IrOpcode::kNumberEqual: | 585 case IrOpcode::kNumberEqual: |
| 586 case IrOpcode::kSpeculativeNumberEqual: |
586 return machine()->Word32Equal(); | 587 return machine()->Word32Equal(); |
587 case IrOpcode::kNumberLessThan: | 588 case IrOpcode::kNumberLessThan: |
| 589 case IrOpcode::kSpeculativeNumberLessThan: |
588 return machine()->Int32LessThan(); | 590 return machine()->Int32LessThan(); |
589 case IrOpcode::kNumberLessThanOrEqual: | 591 case IrOpcode::kNumberLessThanOrEqual: |
| 592 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
590 return machine()->Int32LessThanOrEqual(); | 593 return machine()->Int32LessThanOrEqual(); |
591 default: | 594 default: |
592 UNREACHABLE(); | 595 UNREACHABLE(); |
593 return nullptr; | 596 return nullptr; |
594 } | 597 } |
595 } | 598 } |
596 | 599 |
597 const Operator* RepresentationChanger::Int32OverflowOperatorFor( | 600 const Operator* RepresentationChanger::Int32OverflowOperatorFor( |
598 IrOpcode::Value opcode) { | 601 IrOpcode::Value opcode) { |
599 switch (opcode) { | 602 switch (opcode) { |
(...skipping 14 matching lines...) Expand all Loading... |
614 return machine()->Int32Add(); | 617 return machine()->Int32Add(); |
615 case IrOpcode::kNumberSubtract: | 618 case IrOpcode::kNumberSubtract: |
616 return machine()->Int32Sub(); | 619 return machine()->Int32Sub(); |
617 case IrOpcode::kNumberMultiply: | 620 case IrOpcode::kNumberMultiply: |
618 return machine()->Int32Mul(); | 621 return machine()->Int32Mul(); |
619 case IrOpcode::kNumberDivide: | 622 case IrOpcode::kNumberDivide: |
620 return machine()->Uint32Div(); | 623 return machine()->Uint32Div(); |
621 case IrOpcode::kNumberModulus: | 624 case IrOpcode::kNumberModulus: |
622 return machine()->Uint32Mod(); | 625 return machine()->Uint32Mod(); |
623 case IrOpcode::kNumberEqual: | 626 case IrOpcode::kNumberEqual: |
| 627 case IrOpcode::kSpeculativeNumberEqual: |
624 return machine()->Word32Equal(); | 628 return machine()->Word32Equal(); |
625 case IrOpcode::kNumberLessThan: | 629 case IrOpcode::kNumberLessThan: |
| 630 case IrOpcode::kSpeculativeNumberLessThan: |
626 return machine()->Uint32LessThan(); | 631 return machine()->Uint32LessThan(); |
627 case IrOpcode::kNumberLessThanOrEqual: | 632 case IrOpcode::kNumberLessThanOrEqual: |
| 633 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
628 return machine()->Uint32LessThanOrEqual(); | 634 return machine()->Uint32LessThanOrEqual(); |
629 case IrOpcode::kNumberClz32: | 635 case IrOpcode::kNumberClz32: |
630 return machine()->Word32Clz(); | 636 return machine()->Word32Clz(); |
631 case IrOpcode::kNumberImul: | 637 case IrOpcode::kNumberImul: |
632 return machine()->Int32Mul(); | 638 return machine()->Int32Mul(); |
633 default: | 639 default: |
634 UNREACHABLE(); | 640 UNREACHABLE(); |
635 return nullptr; | 641 return nullptr; |
636 } | 642 } |
637 } | 643 } |
638 | 644 |
639 | 645 |
640 const Operator* RepresentationChanger::Float64OperatorFor( | 646 const Operator* RepresentationChanger::Float64OperatorFor( |
641 IrOpcode::Value opcode) { | 647 IrOpcode::Value opcode) { |
642 switch (opcode) { | 648 switch (opcode) { |
643 case IrOpcode::kSpeculativeNumberAdd: | 649 case IrOpcode::kSpeculativeNumberAdd: |
644 case IrOpcode::kNumberAdd: | 650 case IrOpcode::kNumberAdd: |
645 return machine()->Float64Add(); | 651 return machine()->Float64Add(); |
646 case IrOpcode::kSpeculativeNumberSubtract: | 652 case IrOpcode::kSpeculativeNumberSubtract: |
647 case IrOpcode::kNumberSubtract: | 653 case IrOpcode::kNumberSubtract: |
648 return machine()->Float64Sub(); | 654 return machine()->Float64Sub(); |
649 case IrOpcode::kNumberMultiply: | 655 case IrOpcode::kNumberMultiply: |
650 return machine()->Float64Mul(); | 656 return machine()->Float64Mul(); |
651 case IrOpcode::kNumberDivide: | 657 case IrOpcode::kNumberDivide: |
652 return machine()->Float64Div(); | 658 return machine()->Float64Div(); |
653 case IrOpcode::kNumberModulus: | 659 case IrOpcode::kNumberModulus: |
654 return machine()->Float64Mod(); | 660 return machine()->Float64Mod(); |
655 case IrOpcode::kNumberEqual: | 661 case IrOpcode::kNumberEqual: |
| 662 case IrOpcode::kSpeculativeNumberEqual: |
656 return machine()->Float64Equal(); | 663 return machine()->Float64Equal(); |
657 case IrOpcode::kNumberLessThan: | 664 case IrOpcode::kNumberLessThan: |
| 665 case IrOpcode::kSpeculativeNumberLessThan: |
658 return machine()->Float64LessThan(); | 666 return machine()->Float64LessThan(); |
659 case IrOpcode::kNumberLessThanOrEqual: | 667 case IrOpcode::kNumberLessThanOrEqual: |
| 668 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
660 return machine()->Float64LessThanOrEqual(); | 669 return machine()->Float64LessThanOrEqual(); |
661 case IrOpcode::kNumberAtan: | 670 case IrOpcode::kNumberAtan: |
662 return machine()->Float64Atan(); | 671 return machine()->Float64Atan(); |
663 case IrOpcode::kNumberAtan2: | 672 case IrOpcode::kNumberAtan2: |
664 return machine()->Float64Atan2(); | 673 return machine()->Float64Atan2(); |
665 case IrOpcode::kNumberFround: | 674 case IrOpcode::kNumberFround: |
666 return machine()->TruncateFloat64ToFloat32(); | 675 return machine()->TruncateFloat64ToFloat32(); |
667 case IrOpcode::kNumberLog: | 676 case IrOpcode::kNumberLog: |
668 return machine()->Float64Log(); | 677 return machine()->Float64Log(); |
669 case IrOpcode::kNumberLog1p: | 678 case IrOpcode::kNumberLog1p: |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 } | 730 } |
722 | 731 |
723 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { | 732 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { |
724 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), | 733 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), |
725 node); | 734 node); |
726 } | 735 } |
727 | 736 |
728 } // namespace compiler | 737 } // namespace compiler |
729 } // namespace internal | 738 } // namespace internal |
730 } // namespace v8 | 739 } // namespace v8 |
OLD | NEW |