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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 | 563 |
564 const Operator* RepresentationChanger::Int32OperatorFor( | 564 const Operator* RepresentationChanger::Int32OperatorFor( |
565 IrOpcode::Value opcode) { | 565 IrOpcode::Value opcode) { |
566 switch (opcode) { | 566 switch (opcode) { |
567 case IrOpcode::kSpeculativeNumberAdd: // Fall through. | 567 case IrOpcode::kSpeculativeNumberAdd: // Fall through. |
568 case IrOpcode::kNumberAdd: | 568 case IrOpcode::kNumberAdd: |
569 return machine()->Int32Add(); | 569 return machine()->Int32Add(); |
570 case IrOpcode::kSpeculativeNumberSubtract: // Fall through. | 570 case IrOpcode::kSpeculativeNumberSubtract: // Fall through. |
571 case IrOpcode::kNumberSubtract: | 571 case IrOpcode::kNumberSubtract: |
572 return machine()->Int32Sub(); | 572 return machine()->Int32Sub(); |
| 573 case IrOpcode::kSpeculativeNumberMultiply: |
573 case IrOpcode::kNumberMultiply: | 574 case IrOpcode::kNumberMultiply: |
574 return machine()->Int32Mul(); | 575 return machine()->Int32Mul(); |
| 576 case IrOpcode::kSpeculativeNumberDivide: |
575 case IrOpcode::kNumberDivide: | 577 case IrOpcode::kNumberDivide: |
576 return machine()->Int32Div(); | 578 return machine()->Int32Div(); |
| 579 case IrOpcode::kSpeculativeNumberModulus: |
577 case IrOpcode::kNumberModulus: | 580 case IrOpcode::kNumberModulus: |
578 return machine()->Int32Mod(); | 581 return machine()->Int32Mod(); |
579 case IrOpcode::kNumberBitwiseOr: | 582 case IrOpcode::kNumberBitwiseOr: |
580 return machine()->Word32Or(); | 583 return machine()->Word32Or(); |
581 case IrOpcode::kNumberBitwiseXor: | 584 case IrOpcode::kNumberBitwiseXor: |
582 return machine()->Word32Xor(); | 585 return machine()->Word32Xor(); |
583 case IrOpcode::kNumberBitwiseAnd: | 586 case IrOpcode::kNumberBitwiseAnd: |
584 return machine()->Word32And(); | 587 return machine()->Word32And(); |
585 case IrOpcode::kNumberEqual: | 588 case IrOpcode::kNumberEqual: |
586 case IrOpcode::kSpeculativeNumberEqual: | 589 case IrOpcode::kSpeculativeNumberEqual: |
(...skipping 23 matching lines...) Expand all Loading... |
610 } | 613 } |
611 } | 614 } |
612 | 615 |
613 const Operator* RepresentationChanger::Uint32OperatorFor( | 616 const Operator* RepresentationChanger::Uint32OperatorFor( |
614 IrOpcode::Value opcode) { | 617 IrOpcode::Value opcode) { |
615 switch (opcode) { | 618 switch (opcode) { |
616 case IrOpcode::kNumberAdd: | 619 case IrOpcode::kNumberAdd: |
617 return machine()->Int32Add(); | 620 return machine()->Int32Add(); |
618 case IrOpcode::kNumberSubtract: | 621 case IrOpcode::kNumberSubtract: |
619 return machine()->Int32Sub(); | 622 return machine()->Int32Sub(); |
| 623 case IrOpcode::kSpeculativeNumberMultiply: |
620 case IrOpcode::kNumberMultiply: | 624 case IrOpcode::kNumberMultiply: |
621 return machine()->Int32Mul(); | 625 return machine()->Int32Mul(); |
| 626 case IrOpcode::kSpeculativeNumberDivide: |
622 case IrOpcode::kNumberDivide: | 627 case IrOpcode::kNumberDivide: |
623 return machine()->Uint32Div(); | 628 return machine()->Uint32Div(); |
| 629 case IrOpcode::kSpeculativeNumberModulus: |
624 case IrOpcode::kNumberModulus: | 630 case IrOpcode::kNumberModulus: |
625 return machine()->Uint32Mod(); | 631 return machine()->Uint32Mod(); |
626 case IrOpcode::kNumberEqual: | 632 case IrOpcode::kNumberEqual: |
627 case IrOpcode::kSpeculativeNumberEqual: | 633 case IrOpcode::kSpeculativeNumberEqual: |
628 return machine()->Word32Equal(); | 634 return machine()->Word32Equal(); |
629 case IrOpcode::kNumberLessThan: | 635 case IrOpcode::kNumberLessThan: |
630 case IrOpcode::kSpeculativeNumberLessThan: | 636 case IrOpcode::kSpeculativeNumberLessThan: |
631 return machine()->Uint32LessThan(); | 637 return machine()->Uint32LessThan(); |
632 case IrOpcode::kNumberLessThanOrEqual: | 638 case IrOpcode::kNumberLessThanOrEqual: |
633 case IrOpcode::kSpeculativeNumberLessThanOrEqual: | 639 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
(...skipping 11 matching lines...) Expand all Loading... |
645 | 651 |
646 const Operator* RepresentationChanger::Float64OperatorFor( | 652 const Operator* RepresentationChanger::Float64OperatorFor( |
647 IrOpcode::Value opcode) { | 653 IrOpcode::Value opcode) { |
648 switch (opcode) { | 654 switch (opcode) { |
649 case IrOpcode::kSpeculativeNumberAdd: | 655 case IrOpcode::kSpeculativeNumberAdd: |
650 case IrOpcode::kNumberAdd: | 656 case IrOpcode::kNumberAdd: |
651 return machine()->Float64Add(); | 657 return machine()->Float64Add(); |
652 case IrOpcode::kSpeculativeNumberSubtract: | 658 case IrOpcode::kSpeculativeNumberSubtract: |
653 case IrOpcode::kNumberSubtract: | 659 case IrOpcode::kNumberSubtract: |
654 return machine()->Float64Sub(); | 660 return machine()->Float64Sub(); |
| 661 case IrOpcode::kSpeculativeNumberMultiply: |
655 case IrOpcode::kNumberMultiply: | 662 case IrOpcode::kNumberMultiply: |
656 return machine()->Float64Mul(); | 663 return machine()->Float64Mul(); |
| 664 case IrOpcode::kSpeculativeNumberDivide: |
657 case IrOpcode::kNumberDivide: | 665 case IrOpcode::kNumberDivide: |
658 return machine()->Float64Div(); | 666 return machine()->Float64Div(); |
| 667 case IrOpcode::kSpeculativeNumberModulus: |
659 case IrOpcode::kNumberModulus: | 668 case IrOpcode::kNumberModulus: |
660 return machine()->Float64Mod(); | 669 return machine()->Float64Mod(); |
661 case IrOpcode::kNumberEqual: | 670 case IrOpcode::kNumberEqual: |
662 case IrOpcode::kSpeculativeNumberEqual: | 671 case IrOpcode::kSpeculativeNumberEqual: |
663 return machine()->Float64Equal(); | 672 return machine()->Float64Equal(); |
664 case IrOpcode::kNumberLessThan: | 673 case IrOpcode::kNumberLessThan: |
665 case IrOpcode::kSpeculativeNumberLessThan: | 674 case IrOpcode::kSpeculativeNumberLessThan: |
666 return machine()->Float64LessThan(); | 675 return machine()->Float64LessThan(); |
667 case IrOpcode::kNumberLessThanOrEqual: | 676 case IrOpcode::kNumberLessThanOrEqual: |
668 case IrOpcode::kSpeculativeNumberLessThanOrEqual: | 677 case IrOpcode::kSpeculativeNumberLessThanOrEqual: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 } | 751 } |
743 | 752 |
744 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { | 753 Node* RepresentationChanger::InsertChangeTaggedToFloat64(Node* node) { |
745 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), | 754 return jsgraph()->graph()->NewNode(simplified()->ChangeTaggedToFloat64(), |
746 node); | 755 node); |
747 } | 756 } |
748 | 757 |
749 } // namespace compiler | 758 } // namespace compiler |
750 } // namespace internal | 759 } // namespace internal |
751 } // namespace v8 | 760 } // namespace v8 |
OLD | NEW |