OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 | 354 |
355 | 355 |
356 template<typename T> | 356 template<typename T> |
357 class OperandContainer<T, 0> { | 357 class OperandContainer<T, 0> { |
358 public: | 358 public: |
359 int length() { return 0; } | 359 int length() { return 0; } |
360 void PrintOperandsTo(StringStream* stream) { } | 360 void PrintOperandsTo(StringStream* stream) { } |
361 }; | 361 }; |
362 | 362 |
363 | 363 |
364 template<int R, int I, int T = 0> | 364 template<int R, int I, int T> |
365 class LTemplateInstruction: public LInstruction { | 365 class LTemplateInstruction: public LInstruction { |
366 public: | 366 public: |
367 // Allow 0 or 1 output operands. | 367 // Allow 0 or 1 output operands. |
368 STATIC_ASSERT(R == 0 || R == 1); | 368 STATIC_ASSERT(R == 0 || R == 1); |
369 virtual bool HasResult() const { return R != 0; } | 369 virtual bool HasResult() const { return R != 0; } |
370 void set_result(LOperand* operand) { results_[0] = operand; } | 370 void set_result(LOperand* operand) { results_[0] = operand; } |
371 LOperand* result() { return results_[0]; } | 371 LOperand* result() { return results_[0]; } |
372 | 372 |
373 int InputCount() { return I; } | 373 int InputCount() { return I; } |
374 LOperand* InputAt(int i) { return inputs_[i]; } | 374 LOperand* InputAt(int i) { return inputs_[i]; } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 } | 505 } |
506 }; | 506 }; |
507 | 507 |
508 | 508 |
509 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 509 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
510 public: | 510 public: |
511 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 511 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
512 }; | 512 }; |
513 | 513 |
514 | 514 |
515 template<int I, int T = 0> | 515 template<int I, int T> |
516 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 516 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
517 public: | 517 public: |
518 DECLARE_INSTRUCTION(ControlInstruction) | 518 DECLARE_INSTRUCTION(ControlInstruction) |
519 virtual bool IsControl() const { return true; } | 519 virtual bool IsControl() const { return true; } |
520 | 520 |
521 int true_block_id() const { return true_block_id_; } | 521 int true_block_id() const { return true_block_id_; } |
522 int false_block_id() const { return false_block_id_; } | 522 int false_block_id() const { return false_block_id_; } |
523 void SetBranchTargets(int true_block_id, int false_block_id) { | 523 void SetBranchTargets(int true_block_id, int false_block_id) { |
524 true_block_id_ = true_block_id; | 524 true_block_id_ = true_block_id; |
525 false_block_id_ = false_block_id; | 525 false_block_id_ = false_block_id; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") | 563 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") |
564 | 564 |
565 LOperand* arguments() { return inputs_[0]; } | 565 LOperand* arguments() { return inputs_[0]; } |
566 LOperand* length() { return inputs_[1]; } | 566 LOperand* length() { return inputs_[1]; } |
567 LOperand* index() { return inputs_[2]; } | 567 LOperand* index() { return inputs_[2]; } |
568 | 568 |
569 virtual void PrintDataTo(StringStream* stream); | 569 virtual void PrintDataTo(StringStream* stream); |
570 }; | 570 }; |
571 | 571 |
572 | 572 |
573 class LArgumentsLength: public LTemplateInstruction<1, 1> { | 573 class LArgumentsLength: public LTemplateInstruction<1, 1, 0> { |
574 public: | 574 public: |
575 explicit LArgumentsLength(LOperand* elements) { | 575 explicit LArgumentsLength(LOperand* elements) { |
576 inputs_[0] = elements; | 576 inputs_[0] = elements; |
577 } | 577 } |
578 | 578 |
579 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") | 579 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
580 }; | 580 }; |
581 | 581 |
582 | 582 |
583 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { | 583 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
620 inputs_[0] = left; | 620 inputs_[0] = left; |
621 inputs_[1] = right; | 621 inputs_[1] = right; |
622 temps_[0] = temp; | 622 temps_[0] = temp; |
623 } | 623 } |
624 | 624 |
625 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") | 625 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") |
626 DECLARE_HYDROGEN_ACCESSOR(Mul) | 626 DECLARE_HYDROGEN_ACCESSOR(Mul) |
627 }; | 627 }; |
628 | 628 |
629 | 629 |
630 class LCmpID: public LTemplateInstruction<1, 2> { | 630 class LCmpID: public LTemplateInstruction<1, 2, 0> { |
631 public: | 631 public: |
632 LCmpID(LOperand* left, LOperand* right) { | 632 LCmpID(LOperand* left, LOperand* right) { |
633 inputs_[0] = left; | 633 inputs_[0] = left; |
634 inputs_[1] = right; | 634 inputs_[1] = right; |
635 } | 635 } |
636 | 636 |
637 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") | 637 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") |
638 DECLARE_HYDROGEN_ACCESSOR(Compare) | 638 DECLARE_HYDROGEN_ACCESSOR(Compare) |
639 | 639 |
640 Token::Value op() const { return hydrogen()->token(); } | 640 Token::Value op() const { return hydrogen()->token(); } |
641 bool is_double() const { | 641 bool is_double() const { |
642 return hydrogen()->GetInputRepresentation().IsDouble(); | 642 return hydrogen()->GetInputRepresentation().IsDouble(); |
643 } | 643 } |
644 }; | 644 }; |
645 | 645 |
646 | 646 |
647 class LCmpIDAndBranch: public LControlInstruction<2> { | 647 class LCmpIDAndBranch: public LControlInstruction<2, 0> { |
648 public: | 648 public: |
649 LCmpIDAndBranch(LOperand* left, LOperand* right) { | 649 LCmpIDAndBranch(LOperand* left, LOperand* right) { |
650 inputs_[0] = left; | 650 inputs_[0] = left; |
651 inputs_[1] = right; | 651 inputs_[1] = right; |
652 } | 652 } |
653 | 653 |
654 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") | 654 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") |
655 DECLARE_HYDROGEN_ACCESSOR(Compare) | 655 DECLARE_HYDROGEN_ACCESSOR(Compare) |
656 | 656 |
657 Token::Value op() const { return hydrogen()->token(); } | 657 Token::Value op() const { return hydrogen()->token(); } |
658 bool is_double() const { | 658 bool is_double() const { |
659 return hydrogen()->GetInputRepresentation().IsDouble(); | 659 return hydrogen()->GetInputRepresentation().IsDouble(); |
660 } | 660 } |
661 | 661 |
662 virtual void PrintDataTo(StringStream* stream); | 662 virtual void PrintDataTo(StringStream* stream); |
663 }; | 663 }; |
664 | 664 |
665 | 665 |
666 class LUnaryMathOperation: public LTemplateInstruction<1, 1> { | 666 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { |
667 public: | 667 public: |
668 explicit LUnaryMathOperation(LOperand* value) { | 668 explicit LUnaryMathOperation(LOperand* value) { |
669 inputs_[0] = value; | 669 inputs_[0] = value; |
670 } | 670 } |
671 | 671 |
672 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 672 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") |
673 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 673 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
674 | 674 |
675 virtual void PrintDataTo(StringStream* stream); | 675 virtual void PrintDataTo(StringStream* stream); |
676 BuiltinFunctionId op() const { return hydrogen()->op(); } | 676 BuiltinFunctionId op() const { return hydrogen()->op(); } |
677 }; | 677 }; |
678 | 678 |
679 | 679 |
680 class LCmpJSObjectEq: public LTemplateInstruction<1, 2> { | 680 class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> { |
681 public: | 681 public: |
682 LCmpJSObjectEq(LOperand* left, LOperand* right) { | 682 LCmpJSObjectEq(LOperand* left, LOperand* right) { |
683 inputs_[0] = left; | 683 inputs_[0] = left; |
684 inputs_[1] = right; | 684 inputs_[1] = right; |
685 } | 685 } |
686 | 686 |
687 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") | 687 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") |
688 }; | 688 }; |
689 | 689 |
690 | 690 |
691 class LCmpJSObjectEqAndBranch: public LControlInstruction<2> { | 691 class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> { |
692 public: | 692 public: |
693 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) { | 693 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) { |
694 inputs_[0] = left; | 694 inputs_[0] = left; |
695 inputs_[1] = right; | 695 inputs_[1] = right; |
696 } | 696 } |
697 | 697 |
698 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, | 698 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, |
699 "cmp-jsobject-eq-and-branch") | 699 "cmp-jsobject-eq-and-branch") |
700 }; | 700 }; |
701 | 701 |
702 | 702 |
703 class LIsNull: public LTemplateInstruction<1, 1> { | 703 class LIsNull: public LTemplateInstruction<1, 1, 0> { |
704 public: | 704 public: |
705 explicit LIsNull(LOperand* value) { | 705 explicit LIsNull(LOperand* value) { |
706 inputs_[0] = value; | 706 inputs_[0] = value; |
707 } | 707 } |
708 | 708 |
709 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") | 709 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") |
710 DECLARE_HYDROGEN_ACCESSOR(IsNull) | 710 DECLARE_HYDROGEN_ACCESSOR(IsNull) |
711 | 711 |
712 bool is_strict() const { return hydrogen()->is_strict(); } | 712 bool is_strict() const { return hydrogen()->is_strict(); } |
713 }; | 713 }; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
747 temps_[0] = temp; | 747 temps_[0] = temp; |
748 temps_[1] = temp2; | 748 temps_[1] = temp2; |
749 } | 749 } |
750 | 750 |
751 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") | 751 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") |
752 | 752 |
753 virtual void PrintDataTo(StringStream* stream); | 753 virtual void PrintDataTo(StringStream* stream); |
754 }; | 754 }; |
755 | 755 |
756 | 756 |
757 class LIsSmi: public LTemplateInstruction<1, 1> { | 757 class LIsSmi: public LTemplateInstruction<1, 1, 0> { |
758 public: | 758 public: |
759 explicit LIsSmi(LOperand* value) { | 759 explicit LIsSmi(LOperand* value) { |
760 inputs_[0] = value; | 760 inputs_[0] = value; |
761 } | 761 } |
762 | 762 |
763 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") | 763 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") |
764 DECLARE_HYDROGEN_ACCESSOR(IsSmi) | 764 DECLARE_HYDROGEN_ACCESSOR(IsSmi) |
765 }; | 765 }; |
766 | 766 |
767 | 767 |
768 class LIsSmiAndBranch: public LControlInstruction<1> { | 768 class LIsSmiAndBranch: public LControlInstruction<1, 0> { |
769 public: | 769 public: |
770 explicit LIsSmiAndBranch(LOperand* value) { | 770 explicit LIsSmiAndBranch(LOperand* value) { |
771 inputs_[0] = value; | 771 inputs_[0] = value; |
772 } | 772 } |
773 | 773 |
774 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 774 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
775 | 775 |
776 virtual void PrintDataTo(StringStream* stream); | 776 virtual void PrintDataTo(StringStream* stream); |
777 }; | 777 }; |
778 | 778 |
779 | 779 |
780 class LHasInstanceType: public LTemplateInstruction<1, 1> { | 780 class LHasInstanceType: public LTemplateInstruction<1, 1, 0> { |
781 public: | 781 public: |
782 explicit LHasInstanceType(LOperand* value) { | 782 explicit LHasInstanceType(LOperand* value) { |
783 inputs_[0] = value; | 783 inputs_[0] = value; |
784 } | 784 } |
785 | 785 |
786 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") | 786 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") |
787 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 787 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) |
788 }; | 788 }; |
789 | 789 |
790 | 790 |
791 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { | 791 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { |
792 public: | 792 public: |
793 explicit LHasInstanceTypeAndBranch(LOperand* value) { | 793 explicit LHasInstanceTypeAndBranch(LOperand* value) { |
794 inputs_[0] = value; | 794 inputs_[0] = value; |
795 } | 795 } |
796 | 796 |
797 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 797 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
798 "has-instance-type-and-branch") | 798 "has-instance-type-and-branch") |
799 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 799 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) |
800 | 800 |
801 virtual void PrintDataTo(StringStream* stream); | 801 virtual void PrintDataTo(StringStream* stream); |
802 }; | 802 }; |
803 | 803 |
804 | 804 |
805 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1> { | 805 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { |
806 public: | 806 public: |
807 explicit LHasCachedArrayIndex(LOperand* value) { | 807 explicit LHasCachedArrayIndex(LOperand* value) { |
808 inputs_[0] = value; | 808 inputs_[0] = value; |
809 } | 809 } |
810 | 810 |
811 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") | 811 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") |
812 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) | 812 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) |
813 }; | 813 }; |
814 | 814 |
815 | 815 |
816 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1> { | 816 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { |
817 public: | 817 public: |
818 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { | 818 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { |
819 inputs_[0] = value; | 819 inputs_[0] = value; |
820 } | 820 } |
821 | 821 |
822 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 822 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
823 "has-cached-array-index-and-branch") | 823 "has-cached-array-index-and-branch") |
824 virtual void PrintDataTo(StringStream* stream); | 824 virtual void PrintDataTo(StringStream* stream); |
825 }; | 825 }; |
826 | 826 |
(...skipping 20 matching lines...) Expand all Loading... |
847 } | 847 } |
848 | 848 |
849 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 849 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
850 "class-of-test-and-branch") | 850 "class-of-test-and-branch") |
851 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | 851 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) |
852 | 852 |
853 virtual void PrintDataTo(StringStream* stream); | 853 virtual void PrintDataTo(StringStream* stream); |
854 }; | 854 }; |
855 | 855 |
856 | 856 |
857 class LCmpT: public LTemplateInstruction<1, 2> { | 857 class LCmpT: public LTemplateInstruction<1, 2, 0> { |
858 public: | 858 public: |
859 LCmpT(LOperand* left, LOperand* right) { | 859 LCmpT(LOperand* left, LOperand* right) { |
860 inputs_[0] = left; | 860 inputs_[0] = left; |
861 inputs_[1] = right; | 861 inputs_[1] = right; |
862 } | 862 } |
863 | 863 |
864 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 864 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") |
865 DECLARE_HYDROGEN_ACCESSOR(Compare) | 865 DECLARE_HYDROGEN_ACCESSOR(Compare) |
866 | 866 |
867 Token::Value op() const { return hydrogen()->token(); } | 867 Token::Value op() const { return hydrogen()->token(); } |
868 }; | 868 }; |
869 | 869 |
870 | 870 |
871 class LCmpTAndBranch: public LControlInstruction<2> { | 871 class LCmpTAndBranch: public LControlInstruction<2, 0> { |
872 public: | 872 public: |
873 LCmpTAndBranch(LOperand* left, LOperand* right) { | 873 LCmpTAndBranch(LOperand* left, LOperand* right) { |
874 inputs_[0] = left; | 874 inputs_[0] = left; |
875 inputs_[1] = right; | 875 inputs_[1] = right; |
876 } | 876 } |
877 | 877 |
878 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") | 878 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") |
879 DECLARE_HYDROGEN_ACCESSOR(Compare) | 879 DECLARE_HYDROGEN_ACCESSOR(Compare) |
880 | 880 |
881 Token::Value op() const { return hydrogen()->token(); } | 881 Token::Value op() const { return hydrogen()->token(); } |
882 }; | 882 }; |
883 | 883 |
884 | 884 |
885 class LInstanceOf: public LTemplateInstruction<1, 2> { | 885 class LInstanceOf: public LTemplateInstruction<1, 2, 0> { |
886 public: | 886 public: |
887 LInstanceOf(LOperand* left, LOperand* right) { | 887 LInstanceOf(LOperand* left, LOperand* right) { |
888 inputs_[0] = left; | 888 inputs_[0] = left; |
889 inputs_[1] = right; | 889 inputs_[1] = right; |
890 } | 890 } |
891 | 891 |
892 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 892 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") |
893 }; | 893 }; |
894 | 894 |
895 | 895 |
896 class LInstanceOfAndBranch: public LControlInstruction<2> { | 896 class LInstanceOfAndBranch: public LControlInstruction<2, 0> { |
897 public: | 897 public: |
898 LInstanceOfAndBranch(LOperand* left, LOperand* right) { | 898 LInstanceOfAndBranch(LOperand* left, LOperand* right) { |
899 inputs_[0] = left; | 899 inputs_[0] = left; |
900 inputs_[1] = right; | 900 inputs_[1] = right; |
901 } | 901 } |
902 | 902 |
903 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") | 903 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") |
904 }; | 904 }; |
905 | 905 |
906 | 906 |
(...skipping 19 matching lines...) Expand all Loading... |
926 inputs_[1] = length; | 926 inputs_[1] = length; |
927 } | 927 } |
928 | 928 |
929 LOperand* index() { return inputs_[0]; } | 929 LOperand* index() { return inputs_[0]; } |
930 LOperand* length() { return inputs_[1]; } | 930 LOperand* length() { return inputs_[1]; } |
931 | 931 |
932 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") | 932 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") |
933 }; | 933 }; |
934 | 934 |
935 | 935 |
936 class LBitI: public LTemplateInstruction<1, 2> { | 936 class LBitI: public LTemplateInstruction<1, 2, 0> { |
937 public: | 937 public: |
938 LBitI(Token::Value op, LOperand* left, LOperand* right) | 938 LBitI(Token::Value op, LOperand* left, LOperand* right) |
939 : op_(op) { | 939 : op_(op) { |
940 inputs_[0] = left; | 940 inputs_[0] = left; |
941 inputs_[1] = right; | 941 inputs_[1] = right; |
942 } | 942 } |
943 | 943 |
944 Token::Value op() const { return op_; } | 944 Token::Value op() const { return op_; } |
945 | 945 |
946 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") | 946 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") |
947 | 947 |
948 private: | 948 private: |
949 Token::Value op_; | 949 Token::Value op_; |
950 }; | 950 }; |
951 | 951 |
952 | 952 |
953 class LShiftI: public LTemplateInstruction<1, 2> { | 953 class LShiftI: public LTemplateInstruction<1, 2, 0> { |
954 public: | 954 public: |
955 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) | 955 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) |
956 : op_(op), can_deopt_(can_deopt) { | 956 : op_(op), can_deopt_(can_deopt) { |
957 inputs_[0] = left; | 957 inputs_[0] = left; |
958 inputs_[1] = right; | 958 inputs_[1] = right; |
959 } | 959 } |
960 | 960 |
961 Token::Value op() const { return op_; } | 961 Token::Value op() const { return op_; } |
962 | 962 |
963 bool can_deopt() const { return can_deopt_; } | 963 bool can_deopt() const { return can_deopt_; } |
964 | 964 |
965 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") | 965 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") |
966 | 966 |
967 private: | 967 private: |
968 Token::Value op_; | 968 Token::Value op_; |
969 bool can_deopt_; | 969 bool can_deopt_; |
970 }; | 970 }; |
971 | 971 |
972 | 972 |
973 class LSubI: public LTemplateInstruction<1, 2> { | 973 class LSubI: public LTemplateInstruction<1, 2, 0> { |
974 public: | 974 public: |
975 LSubI(LOperand* left, LOperand* right) { | 975 LSubI(LOperand* left, LOperand* right) { |
976 inputs_[0] = left; | 976 inputs_[0] = left; |
977 inputs_[1] = right; | 977 inputs_[1] = right; |
978 } | 978 } |
979 | 979 |
980 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") | 980 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") |
981 DECLARE_HYDROGEN_ACCESSOR(Sub) | 981 DECLARE_HYDROGEN_ACCESSOR(Sub) |
982 }; | 982 }; |
983 | 983 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 explicit LConstantT(Handle<Object> value) : value_(value) { } | 1019 explicit LConstantT(Handle<Object> value) : value_(value) { } |
1020 Handle<Object> value() const { return value_; } | 1020 Handle<Object> value() const { return value_; } |
1021 | 1021 |
1022 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1022 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
1023 | 1023 |
1024 private: | 1024 private: |
1025 Handle<Object> value_; | 1025 Handle<Object> value_; |
1026 }; | 1026 }; |
1027 | 1027 |
1028 | 1028 |
1029 class LBranch: public LControlInstruction<1> { | 1029 class LBranch: public LControlInstruction<1, 0> { |
1030 public: | 1030 public: |
1031 explicit LBranch(LOperand* value) { | 1031 explicit LBranch(LOperand* value) { |
1032 inputs_[0] = value; | 1032 inputs_[0] = value; |
1033 } | 1033 } |
1034 | 1034 |
1035 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 1035 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
1036 DECLARE_HYDROGEN_ACCESSOR(Value) | 1036 DECLARE_HYDROGEN_ACCESSOR(Value) |
1037 | 1037 |
1038 virtual void PrintDataTo(StringStream* stream); | 1038 virtual void PrintDataTo(StringStream* stream); |
1039 }; | 1039 }; |
1040 | 1040 |
1041 | 1041 |
1042 class LCmpMapAndBranch: public LTemplateInstruction<0, 1> { | 1042 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { |
1043 public: | 1043 public: |
1044 explicit LCmpMapAndBranch(LOperand* value) { | 1044 explicit LCmpMapAndBranch(LOperand* value) { |
1045 inputs_[0] = value; | 1045 inputs_[0] = value; |
1046 } | 1046 } |
1047 | 1047 |
1048 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 1048 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
1049 DECLARE_HYDROGEN_ACCESSOR(CompareMap) | 1049 DECLARE_HYDROGEN_ACCESSOR(CompareMap) |
1050 | 1050 |
1051 virtual bool IsControl() const { return true; } | 1051 virtual bool IsControl() const { return true; } |
1052 | 1052 |
1053 Handle<Map> map() const { return hydrogen()->map(); } | 1053 Handle<Map> map() const { return hydrogen()->map(); } |
1054 int true_block_id() const { | 1054 int true_block_id() const { |
1055 return hydrogen()->FirstSuccessor()->block_id(); | 1055 return hydrogen()->FirstSuccessor()->block_id(); |
1056 } | 1056 } |
1057 int false_block_id() const { | 1057 int false_block_id() const { |
1058 return hydrogen()->SecondSuccessor()->block_id(); | 1058 return hydrogen()->SecondSuccessor()->block_id(); |
1059 } | 1059 } |
1060 }; | 1060 }; |
1061 | 1061 |
1062 | 1062 |
1063 class LJSArrayLength: public LTemplateInstruction<1, 1> { | 1063 class LJSArrayLength: public LTemplateInstruction<1, 1, 0> { |
1064 public: | 1064 public: |
1065 explicit LJSArrayLength(LOperand* value) { | 1065 explicit LJSArrayLength(LOperand* value) { |
1066 inputs_[0] = value; | 1066 inputs_[0] = value; |
1067 } | 1067 } |
1068 | 1068 |
1069 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") | 1069 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") |
1070 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) | 1070 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) |
1071 }; | 1071 }; |
1072 | 1072 |
1073 | 1073 |
1074 class LFixedArrayLength: public LTemplateInstruction<1, 1> { | 1074 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> { |
1075 public: | 1075 public: |
1076 explicit LFixedArrayLength(LOperand* value) { | 1076 explicit LFixedArrayLength(LOperand* value) { |
1077 inputs_[0] = value; | 1077 inputs_[0] = value; |
1078 } | 1078 } |
1079 | 1079 |
1080 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") | 1080 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") |
1081 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) | 1081 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) |
1082 }; | 1082 }; |
1083 | 1083 |
1084 | 1084 |
1085 class LValueOf: public LTemplateInstruction<1, 1, 1> { | 1085 class LValueOf: public LTemplateInstruction<1, 1, 1> { |
1086 public: | 1086 public: |
1087 LValueOf(LOperand* value, LOperand* temp) { | 1087 LValueOf(LOperand* value, LOperand* temp) { |
1088 inputs_[0] = value; | 1088 inputs_[0] = value; |
1089 temps_[0] = temp; | 1089 temps_[0] = temp; |
1090 } | 1090 } |
1091 | 1091 |
1092 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") | 1092 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") |
1093 DECLARE_HYDROGEN_ACCESSOR(ValueOf) | 1093 DECLARE_HYDROGEN_ACCESSOR(ValueOf) |
1094 }; | 1094 }; |
1095 | 1095 |
1096 | 1096 |
1097 class LThrow: public LTemplateInstruction<0, 1> { | 1097 class LThrow: public LTemplateInstruction<0, 1, 0> { |
1098 public: | 1098 public: |
1099 explicit LThrow(LOperand* value) { | 1099 explicit LThrow(LOperand* value) { |
1100 inputs_[0] = value; | 1100 inputs_[0] = value; |
1101 } | 1101 } |
1102 | 1102 |
1103 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") | 1103 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") |
1104 }; | 1104 }; |
1105 | 1105 |
1106 | 1106 |
1107 class LBitNotI: public LTemplateInstruction<1, 1> { | 1107 class LBitNotI: public LTemplateInstruction<1, 1, 0> { |
1108 public: | 1108 public: |
1109 explicit LBitNotI(LOperand* value) { | 1109 explicit LBitNotI(LOperand* value) { |
1110 inputs_[0] = value; | 1110 inputs_[0] = value; |
1111 } | 1111 } |
1112 | 1112 |
1113 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") | 1113 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") |
1114 }; | 1114 }; |
1115 | 1115 |
1116 | 1116 |
1117 class LAddI: public LTemplateInstruction<1, 2> { | 1117 class LAddI: public LTemplateInstruction<1, 2, 0> { |
1118 public: | 1118 public: |
1119 LAddI(LOperand* left, LOperand* right) { | 1119 LAddI(LOperand* left, LOperand* right) { |
1120 inputs_[0] = left; | 1120 inputs_[0] = left; |
1121 inputs_[1] = right; | 1121 inputs_[1] = right; |
1122 } | 1122 } |
1123 | 1123 |
1124 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") | 1124 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") |
1125 DECLARE_HYDROGEN_ACCESSOR(Add) | 1125 DECLARE_HYDROGEN_ACCESSOR(Add) |
1126 }; | 1126 }; |
1127 | 1127 |
1128 | 1128 |
1129 class LPower: public LTemplateInstruction<1, 2> { | 1129 class LPower: public LTemplateInstruction<1, 2, 0> { |
1130 public: | 1130 public: |
1131 LPower(LOperand* left, LOperand* right) { | 1131 LPower(LOperand* left, LOperand* right) { |
1132 inputs_[0] = left; | 1132 inputs_[0] = left; |
1133 inputs_[1] = right; | 1133 inputs_[1] = right; |
1134 } | 1134 } |
1135 | 1135 |
1136 DECLARE_CONCRETE_INSTRUCTION(Power, "power") | 1136 DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
1137 DECLARE_HYDROGEN_ACCESSOR(Power) | 1137 DECLARE_HYDROGEN_ACCESSOR(Power) |
1138 }; | 1138 }; |
1139 | 1139 |
1140 | 1140 |
1141 class LArithmeticD: public LTemplateInstruction<1, 2> { | 1141 class LArithmeticD: public LTemplateInstruction<1, 2, 0> { |
1142 public: | 1142 public: |
1143 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) | 1143 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) |
1144 : op_(op) { | 1144 : op_(op) { |
1145 inputs_[0] = left; | 1145 inputs_[0] = left; |
1146 inputs_[1] = right; | 1146 inputs_[1] = right; |
1147 } | 1147 } |
1148 | 1148 |
1149 Token::Value op() const { return op_; } | 1149 Token::Value op() const { return op_; } |
1150 | 1150 |
1151 virtual void CompileToNative(LCodeGen* generator); | 1151 virtual void CompileToNative(LCodeGen* generator); |
1152 virtual const char* Mnemonic() const; | 1152 virtual const char* Mnemonic() const; |
1153 | 1153 |
1154 private: | 1154 private: |
1155 Token::Value op_; | 1155 Token::Value op_; |
1156 }; | 1156 }; |
1157 | 1157 |
1158 | 1158 |
1159 class LArithmeticT: public LTemplateInstruction<1, 2> { | 1159 class LArithmeticT: public LTemplateInstruction<1, 2, 0> { |
1160 public: | 1160 public: |
1161 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) | 1161 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) |
1162 : op_(op) { | 1162 : op_(op) { |
1163 inputs_[0] = left; | 1163 inputs_[0] = left; |
1164 inputs_[1] = right; | 1164 inputs_[1] = right; |
1165 } | 1165 } |
1166 | 1166 |
1167 virtual void CompileToNative(LCodeGen* generator); | 1167 virtual void CompileToNative(LCodeGen* generator); |
1168 virtual const char* Mnemonic() const; | 1168 virtual const char* Mnemonic() const; |
1169 | 1169 |
1170 Token::Value op() const { return op_; } | 1170 Token::Value op() const { return op_; } |
1171 | 1171 |
1172 private: | 1172 private: |
1173 Token::Value op_; | 1173 Token::Value op_; |
1174 }; | 1174 }; |
1175 | 1175 |
1176 | 1176 |
1177 class LReturn: public LTemplateInstruction<0, 1> { | 1177 class LReturn: public LTemplateInstruction<0, 1, 0> { |
1178 public: | 1178 public: |
1179 explicit LReturn(LOperand* value) { | 1179 explicit LReturn(LOperand* value) { |
1180 inputs_[0] = value; | 1180 inputs_[0] = value; |
1181 } | 1181 } |
1182 | 1182 |
1183 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 1183 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
1184 }; | 1184 }; |
1185 | 1185 |
1186 | 1186 |
1187 class LLoadNamedField: public LTemplateInstruction<1, 1> { | 1187 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { |
1188 public: | 1188 public: |
1189 explicit LLoadNamedField(LOperand* object) { | 1189 explicit LLoadNamedField(LOperand* object) { |
1190 inputs_[0] = object; | 1190 inputs_[0] = object; |
1191 } | 1191 } |
1192 | 1192 |
1193 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1193 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
1194 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1194 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
1195 }; | 1195 }; |
1196 | 1196 |
1197 | 1197 |
1198 class LLoadNamedGeneric: public LTemplateInstruction<1, 1> { | 1198 class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> { |
1199 public: | 1199 public: |
1200 explicit LLoadNamedGeneric(LOperand* object) { | 1200 explicit LLoadNamedGeneric(LOperand* object) { |
1201 inputs_[0] = object; | 1201 inputs_[0] = object; |
1202 } | 1202 } |
1203 | 1203 |
1204 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 1204 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
1205 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 1205 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
1206 | 1206 |
1207 LOperand* object() { return inputs_[0]; } | 1207 LOperand* object() { return inputs_[0]; } |
1208 Handle<Object> name() const { return hydrogen()->name(); } | 1208 Handle<Object> name() const { return hydrogen()->name(); } |
1209 }; | 1209 }; |
1210 | 1210 |
1211 | 1211 |
1212 class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> { | 1212 class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> { |
1213 public: | 1213 public: |
1214 LLoadFunctionPrototype(LOperand* function, LOperand* temp) { | 1214 LLoadFunctionPrototype(LOperand* function, LOperand* temp) { |
1215 inputs_[0] = function; | 1215 inputs_[0] = function; |
1216 temps_[0] = temp; | 1216 temps_[0] = temp; |
1217 } | 1217 } |
1218 | 1218 |
1219 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 1219 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
1220 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 1220 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
1221 | 1221 |
1222 LOperand* function() { return inputs_[0]; } | 1222 LOperand* function() { return inputs_[0]; } |
1223 }; | 1223 }; |
1224 | 1224 |
1225 | 1225 |
1226 class LLoadElements: public LTemplateInstruction<1, 1> { | 1226 class LLoadElements: public LTemplateInstruction<1, 1, 0> { |
1227 public: | 1227 public: |
1228 explicit LLoadElements(LOperand* object) { | 1228 explicit LLoadElements(LOperand* object) { |
1229 inputs_[0] = object; | 1229 inputs_[0] = object; |
1230 } | 1230 } |
1231 | 1231 |
1232 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") | 1232 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") |
1233 }; | 1233 }; |
1234 | 1234 |
1235 | 1235 |
1236 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2> { | 1236 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { |
1237 public: | 1237 public: |
1238 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { | 1238 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { |
1239 inputs_[0] = elements; | 1239 inputs_[0] = elements; |
1240 inputs_[1] = key; | 1240 inputs_[1] = key; |
1241 } | 1241 } |
1242 | 1242 |
1243 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") | 1243 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") |
1244 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) | 1244 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) |
1245 | 1245 |
1246 LOperand* elements() { return inputs_[0]; } | 1246 LOperand* elements() { return inputs_[0]; } |
1247 LOperand* key() { return inputs_[1]; } | 1247 LOperand* key() { return inputs_[1]; } |
1248 }; | 1248 }; |
1249 | 1249 |
1250 | 1250 |
1251 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2> { | 1251 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> { |
1252 public: | 1252 public: |
1253 LLoadKeyedGeneric(LOperand* obj, LOperand* key) { | 1253 LLoadKeyedGeneric(LOperand* obj, LOperand* key) { |
1254 inputs_[0] = obj; | 1254 inputs_[0] = obj; |
1255 inputs_[1] = key; | 1255 inputs_[1] = key; |
1256 } | 1256 } |
1257 | 1257 |
1258 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") | 1258 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") |
1259 | 1259 |
1260 LOperand* object() { return inputs_[0]; } | 1260 LOperand* object() { return inputs_[0]; } |
1261 LOperand* key() { return inputs_[1]; } | 1261 LOperand* key() { return inputs_[1]; } |
1262 }; | 1262 }; |
1263 | 1263 |
1264 | 1264 |
1265 class LLoadGlobal: public LTemplateInstruction<1, 0, 0> { | 1265 class LLoadGlobal: public LTemplateInstruction<1, 0, 0> { |
1266 public: | 1266 public: |
1267 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") | 1267 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") |
1268 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) | 1268 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) |
1269 }; | 1269 }; |
1270 | 1270 |
1271 | 1271 |
1272 class LStoreGlobal: public LTemplateInstruction<0, 1> { | 1272 class LStoreGlobal: public LTemplateInstruction<0, 1, 0> { |
1273 public: | 1273 public: |
1274 explicit LStoreGlobal(LOperand* value) { | 1274 explicit LStoreGlobal(LOperand* value) { |
1275 inputs_[0] = value; | 1275 inputs_[0] = value; |
1276 } | 1276 } |
1277 | 1277 |
1278 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") | 1278 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") |
1279 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) | 1279 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) |
1280 }; | 1280 }; |
1281 | 1281 |
1282 | 1282 |
1283 class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> { | 1283 class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> { |
1284 public: | 1284 public: |
1285 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1285 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
1286 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1286 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
1287 | 1287 |
1288 int context_chain_length() { return hydrogen()->context_chain_length(); } | 1288 int context_chain_length() { return hydrogen()->context_chain_length(); } |
1289 int slot_index() { return hydrogen()->slot_index(); } | 1289 int slot_index() { return hydrogen()->slot_index(); } |
1290 | 1290 |
1291 virtual void PrintDataTo(StringStream* stream); | 1291 virtual void PrintDataTo(StringStream* stream); |
1292 }; | 1292 }; |
1293 | 1293 |
1294 | 1294 |
1295 class LPushArgument: public LTemplateInstruction<0, 1> { | 1295 class LPushArgument: public LTemplateInstruction<0, 1, 0> { |
1296 public: | 1296 public: |
1297 explicit LPushArgument(LOperand* value) { | 1297 explicit LPushArgument(LOperand* value) { |
1298 inputs_[0] = value; | 1298 inputs_[0] = value; |
1299 } | 1299 } |
1300 | 1300 |
1301 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 1301 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
1302 }; | 1302 }; |
1303 | 1303 |
1304 | 1304 |
1305 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { | 1305 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1379 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") | 1379 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") |
1380 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) | 1380 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) |
1381 | 1381 |
1382 virtual void PrintDataTo(StringStream* stream); | 1382 virtual void PrintDataTo(StringStream* stream); |
1383 | 1383 |
1384 Handle<JSFunction> target() const { return hydrogen()->target(); } | 1384 Handle<JSFunction> target() const { return hydrogen()->target(); } |
1385 int arity() const { return hydrogen()->argument_count() - 1; } | 1385 int arity() const { return hydrogen()->argument_count() - 1; } |
1386 }; | 1386 }; |
1387 | 1387 |
1388 | 1388 |
1389 class LCallNew: public LTemplateInstruction<1, 1> { | 1389 class LCallNew: public LTemplateInstruction<1, 1, 0> { |
1390 public: | 1390 public: |
1391 explicit LCallNew(LOperand* constructor) { | 1391 explicit LCallNew(LOperand* constructor) { |
1392 inputs_[0] = constructor; | 1392 inputs_[0] = constructor; |
1393 } | 1393 } |
1394 | 1394 |
1395 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") | 1395 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") |
1396 DECLARE_HYDROGEN_ACCESSOR(CallNew) | 1396 DECLARE_HYDROGEN_ACCESSOR(CallNew) |
1397 | 1397 |
1398 virtual void PrintDataTo(StringStream* stream); | 1398 virtual void PrintDataTo(StringStream* stream); |
1399 | 1399 |
1400 int arity() const { return hydrogen()->argument_count() - 1; } | 1400 int arity() const { return hydrogen()->argument_count() - 1; } |
1401 }; | 1401 }; |
1402 | 1402 |
1403 | 1403 |
1404 class LCallRuntime: public LTemplateInstruction<1, 0, 0> { | 1404 class LCallRuntime: public LTemplateInstruction<1, 0, 0> { |
1405 public: | 1405 public: |
1406 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1406 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
1407 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1407 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
1408 | 1408 |
1409 Runtime::Function* function() const { return hydrogen()->function(); } | 1409 Runtime::Function* function() const { return hydrogen()->function(); } |
1410 int arity() const { return hydrogen()->argument_count(); } | 1410 int arity() const { return hydrogen()->argument_count(); } |
1411 }; | 1411 }; |
1412 | 1412 |
1413 | 1413 |
1414 class LInteger32ToDouble: public LTemplateInstruction<1, 1> { | 1414 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { |
1415 public: | 1415 public: |
1416 explicit LInteger32ToDouble(LOperand* value) { | 1416 explicit LInteger32ToDouble(LOperand* value) { |
1417 inputs_[0] = value; | 1417 inputs_[0] = value; |
1418 } | 1418 } |
1419 | 1419 |
1420 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 1420 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
1421 }; | 1421 }; |
1422 | 1422 |
1423 | 1423 |
1424 class LNumberTagI: public LTemplateInstruction<1, 1> { | 1424 class LNumberTagI: public LTemplateInstruction<1, 1, 0> { |
1425 public: | 1425 public: |
1426 explicit LNumberTagI(LOperand* value) { | 1426 explicit LNumberTagI(LOperand* value) { |
1427 inputs_[0] = value; | 1427 inputs_[0] = value; |
1428 } | 1428 } |
1429 | 1429 |
1430 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 1430 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
1431 }; | 1431 }; |
1432 | 1432 |
1433 | 1433 |
1434 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { | 1434 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { |
(...skipping 30 matching lines...) Expand all Loading... |
1465 temps_[0] = temp; | 1465 temps_[0] = temp; |
1466 } | 1466 } |
1467 | 1467 |
1468 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 1468 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
1469 DECLARE_HYDROGEN_ACCESSOR(Change) | 1469 DECLARE_HYDROGEN_ACCESSOR(Change) |
1470 | 1470 |
1471 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1471 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
1472 }; | 1472 }; |
1473 | 1473 |
1474 | 1474 |
1475 class LSmiTag: public LTemplateInstruction<1, 1> { | 1475 class LSmiTag: public LTemplateInstruction<1, 1, 0> { |
1476 public: | 1476 public: |
1477 explicit LSmiTag(LOperand* value) { | 1477 explicit LSmiTag(LOperand* value) { |
1478 inputs_[0] = value; | 1478 inputs_[0] = value; |
1479 } | 1479 } |
1480 | 1480 |
1481 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 1481 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
1482 }; | 1482 }; |
1483 | 1483 |
1484 | 1484 |
1485 class LNumberUntagD: public LTemplateInstruction<1, 1> { | 1485 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { |
1486 public: | 1486 public: |
1487 explicit LNumberUntagD(LOperand* value) { | 1487 explicit LNumberUntagD(LOperand* value) { |
1488 inputs_[0] = value; | 1488 inputs_[0] = value; |
1489 } | 1489 } |
1490 | 1490 |
1491 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 1491 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
1492 }; | 1492 }; |
1493 | 1493 |
1494 | 1494 |
1495 class LSmiUntag: public LTemplateInstruction<1, 1> { | 1495 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { |
1496 public: | 1496 public: |
1497 LSmiUntag(LOperand* value, bool needs_check) | 1497 LSmiUntag(LOperand* value, bool needs_check) |
1498 : needs_check_(needs_check) { | 1498 : needs_check_(needs_check) { |
1499 inputs_[0] = value; | 1499 inputs_[0] = value; |
1500 } | 1500 } |
1501 | 1501 |
1502 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 1502 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
1503 | 1503 |
1504 bool needs_check() const { return needs_check_; } | 1504 bool needs_check() const { return needs_check_; } |
1505 | 1505 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1584 | 1584 |
1585 class LStoreKeyedGeneric: public LStoreKeyed { | 1585 class LStoreKeyedGeneric: public LStoreKeyed { |
1586 public: | 1586 public: |
1587 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) | 1587 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) |
1588 : LStoreKeyed(obj, key, val) { } | 1588 : LStoreKeyed(obj, key, val) { } |
1589 | 1589 |
1590 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") | 1590 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") |
1591 }; | 1591 }; |
1592 | 1592 |
1593 | 1593 |
1594 class LCheckFunction: public LTemplateInstruction<0, 1> { | 1594 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { |
1595 public: | 1595 public: |
1596 explicit LCheckFunction(LOperand* value) { | 1596 explicit LCheckFunction(LOperand* value) { |
1597 inputs_[0] = value; | 1597 inputs_[0] = value; |
1598 } | 1598 } |
1599 | 1599 |
1600 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") | 1600 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") |
1601 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) | 1601 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) |
1602 }; | 1602 }; |
1603 | 1603 |
1604 | 1604 |
1605 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> { | 1605 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> { |
1606 public: | 1606 public: |
1607 LCheckInstanceType(LOperand* value, LOperand* temp) { | 1607 LCheckInstanceType(LOperand* value, LOperand* temp) { |
1608 inputs_[0] = value; | 1608 inputs_[0] = value; |
1609 temps_[0] = temp; | 1609 temps_[0] = temp; |
1610 } | 1610 } |
1611 | 1611 |
1612 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 1612 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
1613 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 1613 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
1614 }; | 1614 }; |
1615 | 1615 |
1616 | 1616 |
1617 class LCheckMap: public LTemplateInstruction<0, 1> { | 1617 class LCheckMap: public LTemplateInstruction<0, 1, 0> { |
1618 public: | 1618 public: |
1619 explicit LCheckMap(LOperand* value) { | 1619 explicit LCheckMap(LOperand* value) { |
1620 inputs_[0] = value; | 1620 inputs_[0] = value; |
1621 } | 1621 } |
1622 | 1622 |
1623 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") | 1623 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") |
1624 DECLARE_HYDROGEN_ACCESSOR(CheckMap) | 1624 DECLARE_HYDROGEN_ACCESSOR(CheckMap) |
1625 }; | 1625 }; |
1626 | 1626 |
1627 | 1627 |
1628 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> { | 1628 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> { |
1629 public: | 1629 public: |
1630 explicit LCheckPrototypeMaps(LOperand* temp) { | 1630 explicit LCheckPrototypeMaps(LOperand* temp) { |
1631 temps_[0] = temp; | 1631 temps_[0] = temp; |
1632 } | 1632 } |
1633 | 1633 |
1634 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") | 1634 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") |
1635 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) | 1635 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) |
1636 | 1636 |
1637 Handle<JSObject> prototype() const { return hydrogen()->prototype(); } | 1637 Handle<JSObject> prototype() const { return hydrogen()->prototype(); } |
1638 Handle<JSObject> holder() const { return hydrogen()->holder(); } | 1638 Handle<JSObject> holder() const { return hydrogen()->holder(); } |
1639 }; | 1639 }; |
1640 | 1640 |
1641 | 1641 |
1642 class LCheckSmi: public LTemplateInstruction<0, 1> { | 1642 class LCheckSmi: public LTemplateInstruction<0, 1, 0> { |
1643 public: | 1643 public: |
1644 LCheckSmi(LOperand* value, Condition condition) | 1644 LCheckSmi(LOperand* value, Condition condition) |
1645 : condition_(condition) { | 1645 : condition_(condition) { |
1646 inputs_[0] = value; | 1646 inputs_[0] = value; |
1647 } | 1647 } |
1648 | 1648 |
1649 Condition condition() const { return condition_; } | 1649 Condition condition() const { return condition_; } |
1650 | 1650 |
1651 virtual void CompileToNative(LCodeGen* generator); | 1651 virtual void CompileToNative(LCodeGen* generator); |
1652 virtual const char* Mnemonic() const { | 1652 virtual const char* Mnemonic() const { |
(...skipping 28 matching lines...) Expand all Loading... |
1681 | 1681 |
1682 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> { | 1682 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> { |
1683 public: | 1683 public: |
1684 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") | 1684 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
1685 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) | 1685 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
1686 | 1686 |
1687 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } | 1687 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } |
1688 }; | 1688 }; |
1689 | 1689 |
1690 | 1690 |
1691 class LTypeof: public LTemplateInstruction<1, 1> { | 1691 class LTypeof: public LTemplateInstruction<1, 1, 0> { |
1692 public: | 1692 public: |
1693 explicit LTypeof(LOperand* value) { | 1693 explicit LTypeof(LOperand* value) { |
1694 inputs_[0] = value; | 1694 inputs_[0] = value; |
1695 } | 1695 } |
1696 | 1696 |
1697 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 1697 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
1698 }; | 1698 }; |
1699 | 1699 |
1700 | 1700 |
1701 class LTypeofIs: public LTemplateInstruction<1, 1> { | 1701 class LTypeofIs: public LTemplateInstruction<1, 1, 0> { |
1702 public: | 1702 public: |
1703 explicit LTypeofIs(LOperand* value) { | 1703 explicit LTypeofIs(LOperand* value) { |
1704 inputs_[0] = value; | 1704 inputs_[0] = value; |
1705 } | 1705 } |
1706 | 1706 |
1707 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") | 1707 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") |
1708 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 1708 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) |
1709 | 1709 |
1710 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1710 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
1711 | 1711 |
1712 virtual void PrintDataTo(StringStream* stream); | 1712 virtual void PrintDataTo(StringStream* stream); |
1713 }; | 1713 }; |
1714 | 1714 |
1715 | 1715 |
1716 class LTypeofIsAndBranch: public LControlInstruction<1> { | 1716 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { |
1717 public: | 1717 public: |
1718 explicit LTypeofIsAndBranch(LOperand* value) { | 1718 explicit LTypeofIsAndBranch(LOperand* value) { |
1719 inputs_[0] = value; | 1719 inputs_[0] = value; |
1720 } | 1720 } |
1721 | 1721 |
1722 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 1722 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
1723 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 1723 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) |
1724 | 1724 |
1725 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1725 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
1726 | 1726 |
1727 virtual void PrintDataTo(StringStream* stream); | 1727 virtual void PrintDataTo(StringStream* stream); |
1728 }; | 1728 }; |
1729 | 1729 |
1730 | 1730 |
1731 class LDeleteProperty: public LTemplateInstruction<1, 2> { | 1731 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { |
1732 public: | 1732 public: |
1733 LDeleteProperty(LOperand* obj, LOperand* key) { | 1733 LDeleteProperty(LOperand* obj, LOperand* key) { |
1734 inputs_[0] = obj; | 1734 inputs_[0] = obj; |
1735 inputs_[1] = key; | 1735 inputs_[1] = key; |
1736 } | 1736 } |
1737 | 1737 |
1738 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 1738 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
1739 | 1739 |
1740 LOperand* object() { return inputs_[0]; } | 1740 LOperand* object() { return inputs_[0]; } |
1741 LOperand* key() { return inputs_[1]; } | 1741 LOperand* key() { return inputs_[1]; } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1987 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 1987 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
1988 }; | 1988 }; |
1989 | 1989 |
1990 #undef DECLARE_HYDROGEN_ACCESSOR | 1990 #undef DECLARE_HYDROGEN_ACCESSOR |
1991 #undef DECLARE_INSTRUCTION | 1991 #undef DECLARE_INSTRUCTION |
1992 #undef DECLARE_CONCRETE_INSTRUCTION | 1992 #undef DECLARE_CONCRETE_INSTRUCTION |
1993 | 1993 |
1994 } } // namespace v8::int | 1994 } } // namespace v8::int |
1995 | 1995 |
1996 #endif // V8_X64_LITHIUM_X64_H_ | 1996 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |