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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 | 359 |
360 template<typename T> | 360 template<typename T> |
361 class OperandContainer<T, 0> { | 361 class OperandContainer<T, 0> { |
362 public: | 362 public: |
363 int length() { return 0; } | 363 int length() { return 0; } |
364 void PrintOperandsTo(StringStream* stream) { } | 364 void PrintOperandsTo(StringStream* stream) { } |
365 }; | 365 }; |
366 | 366 |
367 | 367 |
368 template<int R, int I, int T = 0> | 368 template<int R, int I, int T> |
369 class LTemplateInstruction: public LInstruction { | 369 class LTemplateInstruction: public LInstruction { |
370 public: | 370 public: |
371 // Allow 0 or 1 output operands. | 371 // Allow 0 or 1 output operands. |
372 STATIC_ASSERT(R == 0 || R == 1); | 372 STATIC_ASSERT(R == 0 || R == 1); |
373 virtual bool HasResult() const { return R != 0; } | 373 virtual bool HasResult() const { return R != 0; } |
374 void set_result(LOperand* operand) { results_[0] = operand; } | 374 void set_result(LOperand* operand) { results_[0] = operand; } |
375 LOperand* result() { return results_[0]; } | 375 LOperand* result() { return results_[0]; } |
376 | 376 |
377 int InputCount() { return I; } | 377 int InputCount() { return I; } |
378 LOperand* InputAt(int i) { return inputs_[i]; } | 378 LOperand* InputAt(int i) { return inputs_[i]; } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
509 } | 509 } |
510 }; | 510 }; |
511 | 511 |
512 | 512 |
513 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 513 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
514 public: | 514 public: |
515 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 515 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
516 }; | 516 }; |
517 | 517 |
518 | 518 |
519 template<int I, int T = 0> | 519 template<int I, int T> |
520 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 520 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
521 public: | 521 public: |
522 DECLARE_INSTRUCTION(ControlInstruction) | 522 DECLARE_INSTRUCTION(ControlInstruction) |
523 virtual bool IsControl() const { return true; } | 523 virtual bool IsControl() const { return true; } |
524 | 524 |
525 int true_block_id() const { return true_block_id_; } | 525 int true_block_id() const { return true_block_id_; } |
526 int false_block_id() const { return false_block_id_; } | 526 int false_block_id() const { return false_block_id_; } |
527 void SetBranchTargets(int true_block_id, int false_block_id) { | 527 void SetBranchTargets(int true_block_id, int false_block_id) { |
528 true_block_id_ = true_block_id; | 528 true_block_id_ = true_block_id; |
529 false_block_id_ = false_block_id; | 529 false_block_id_ = false_block_id; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") | 567 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") |
568 | 568 |
569 LOperand* arguments() { return inputs_[0]; } | 569 LOperand* arguments() { return inputs_[0]; } |
570 LOperand* length() { return inputs_[1]; } | 570 LOperand* length() { return inputs_[1]; } |
571 LOperand* index() { return inputs_[2]; } | 571 LOperand* index() { return inputs_[2]; } |
572 | 572 |
573 virtual void PrintDataTo(StringStream* stream); | 573 virtual void PrintDataTo(StringStream* stream); |
574 }; | 574 }; |
575 | 575 |
576 | 576 |
577 class LArgumentsLength: public LTemplateInstruction<1, 1> { | 577 class LArgumentsLength: public LTemplateInstruction<1, 1, 0> { |
578 public: | 578 public: |
579 explicit LArgumentsLength(LOperand* elements) { | 579 explicit LArgumentsLength(LOperand* elements) { |
580 inputs_[0] = elements; | 580 inputs_[0] = elements; |
581 } | 581 } |
582 | 582 |
583 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") | 583 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") |
584 }; | 584 }; |
585 | 585 |
586 | 586 |
587 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { | 587 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 inputs_[0] = left; | 624 inputs_[0] = left; |
625 inputs_[1] = right; | 625 inputs_[1] = right; |
626 temps_[0] = temp; | 626 temps_[0] = temp; |
627 } | 627 } |
628 | 628 |
629 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") | 629 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") |
630 DECLARE_HYDROGEN_ACCESSOR(Mul) | 630 DECLARE_HYDROGEN_ACCESSOR(Mul) |
631 }; | 631 }; |
632 | 632 |
633 | 633 |
634 class LCmpID: public LTemplateInstruction<1, 2> { | 634 class LCmpID: public LTemplateInstruction<1, 2, 0> { |
635 public: | 635 public: |
636 LCmpID(LOperand* left, LOperand* right) { | 636 LCmpID(LOperand* left, LOperand* right) { |
637 inputs_[0] = left; | 637 inputs_[0] = left; |
638 inputs_[1] = right; | 638 inputs_[1] = right; |
639 } | 639 } |
640 | 640 |
641 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") | 641 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") |
642 DECLARE_HYDROGEN_ACCESSOR(Compare) | 642 DECLARE_HYDROGEN_ACCESSOR(Compare) |
643 | 643 |
644 Token::Value op() const { return hydrogen()->token(); } | 644 Token::Value op() const { return hydrogen()->token(); } |
645 bool is_double() const { | 645 bool is_double() const { |
646 return hydrogen()->GetInputRepresentation().IsDouble(); | 646 return hydrogen()->GetInputRepresentation().IsDouble(); |
647 } | 647 } |
648 }; | 648 }; |
649 | 649 |
650 | 650 |
651 class LCmpIDAndBranch: public LControlInstruction<2> { | 651 class LCmpIDAndBranch: public LControlInstruction<2, 0> { |
652 public: | 652 public: |
653 LCmpIDAndBranch(LOperand* left, LOperand* right) { | 653 LCmpIDAndBranch(LOperand* left, LOperand* right) { |
654 inputs_[0] = left; | 654 inputs_[0] = left; |
655 inputs_[1] = right; | 655 inputs_[1] = right; |
656 } | 656 } |
657 | 657 |
658 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") | 658 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") |
659 DECLARE_HYDROGEN_ACCESSOR(Compare) | 659 DECLARE_HYDROGEN_ACCESSOR(Compare) |
660 | 660 |
661 Token::Value op() const { return hydrogen()->token(); } | 661 Token::Value op() const { return hydrogen()->token(); } |
662 bool is_double() const { | 662 bool is_double() const { |
663 return hydrogen()->GetInputRepresentation().IsDouble(); | 663 return hydrogen()->GetInputRepresentation().IsDouble(); |
664 } | 664 } |
665 | 665 |
666 virtual void PrintDataTo(StringStream* stream); | 666 virtual void PrintDataTo(StringStream* stream); |
667 }; | 667 }; |
668 | 668 |
669 | 669 |
670 class LUnaryMathOperation: public LTemplateInstruction<1, 1> { | 670 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { |
671 public: | 671 public: |
672 explicit LUnaryMathOperation(LOperand* value) { | 672 explicit LUnaryMathOperation(LOperand* value) { |
673 inputs_[0] = value; | 673 inputs_[0] = value; |
674 } | 674 } |
675 | 675 |
676 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 676 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") |
677 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 677 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
678 | 678 |
679 virtual void PrintDataTo(StringStream* stream); | 679 virtual void PrintDataTo(StringStream* stream); |
680 BuiltinFunctionId op() const { return hydrogen()->op(); } | 680 BuiltinFunctionId op() const { return hydrogen()->op(); } |
681 }; | 681 }; |
682 | 682 |
683 | 683 |
684 class LCmpJSObjectEq: public LTemplateInstruction<1, 2> { | 684 class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> { |
685 public: | 685 public: |
686 LCmpJSObjectEq(LOperand* left, LOperand* right) { | 686 LCmpJSObjectEq(LOperand* left, LOperand* right) { |
687 inputs_[0] = left; | 687 inputs_[0] = left; |
688 inputs_[1] = right; | 688 inputs_[1] = right; |
689 } | 689 } |
690 | 690 |
691 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") | 691 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") |
692 }; | 692 }; |
693 | 693 |
694 | 694 |
695 class LCmpJSObjectEqAndBranch: public LControlInstruction<2> { | 695 class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> { |
696 public: | 696 public: |
697 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) { | 697 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) { |
698 inputs_[0] = left; | 698 inputs_[0] = left; |
699 inputs_[1] = right; | 699 inputs_[1] = right; |
700 } | 700 } |
701 | 701 |
702 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, | 702 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, |
703 "cmp-jsobject-eq-and-branch") | 703 "cmp-jsobject-eq-and-branch") |
704 }; | 704 }; |
705 | 705 |
706 | 706 |
707 class LIsNull: public LTemplateInstruction<1, 1> { | 707 class LIsNull: public LTemplateInstruction<1, 1, 0> { |
708 public: | 708 public: |
709 explicit LIsNull(LOperand* value) { | 709 explicit LIsNull(LOperand* value) { |
710 inputs_[0] = value; | 710 inputs_[0] = value; |
711 } | 711 } |
712 | 712 |
713 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") | 713 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") |
714 DECLARE_HYDROGEN_ACCESSOR(IsNull) | 714 DECLARE_HYDROGEN_ACCESSOR(IsNull) |
715 | 715 |
716 bool is_strict() const { return hydrogen()->is_strict(); } | 716 bool is_strict() const { return hydrogen()->is_strict(); } |
717 }; | 717 }; |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 temps_[0] = temp; | 751 temps_[0] = temp; |
752 temps_[1] = temp2; | 752 temps_[1] = temp2; |
753 } | 753 } |
754 | 754 |
755 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") | 755 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") |
756 | 756 |
757 virtual void PrintDataTo(StringStream* stream); | 757 virtual void PrintDataTo(StringStream* stream); |
758 }; | 758 }; |
759 | 759 |
760 | 760 |
761 class LIsSmi: public LTemplateInstruction<1, 1> { | 761 class LIsSmi: public LTemplateInstruction<1, 1, 0> { |
762 public: | 762 public: |
763 explicit LIsSmi(LOperand* value) { | 763 explicit LIsSmi(LOperand* value) { |
764 inputs_[0] = value; | 764 inputs_[0] = value; |
765 } | 765 } |
766 | 766 |
767 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") | 767 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") |
768 DECLARE_HYDROGEN_ACCESSOR(IsSmi) | 768 DECLARE_HYDROGEN_ACCESSOR(IsSmi) |
769 }; | 769 }; |
770 | 770 |
771 | 771 |
772 class LIsSmiAndBranch: public LControlInstruction<1> { | 772 class LIsSmiAndBranch: public LControlInstruction<1, 0> { |
773 public: | 773 public: |
774 explicit LIsSmiAndBranch(LOperand* value) { | 774 explicit LIsSmiAndBranch(LOperand* value) { |
775 inputs_[0] = value; | 775 inputs_[0] = value; |
776 } | 776 } |
777 | 777 |
778 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 778 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
779 | 779 |
780 virtual void PrintDataTo(StringStream* stream); | 780 virtual void PrintDataTo(StringStream* stream); |
781 }; | 781 }; |
782 | 782 |
783 | 783 |
784 class LHasInstanceType: public LTemplateInstruction<1, 1> { | 784 class LHasInstanceType: public LTemplateInstruction<1, 1, 0> { |
785 public: | 785 public: |
786 explicit LHasInstanceType(LOperand* value) { | 786 explicit LHasInstanceType(LOperand* value) { |
787 inputs_[0] = value; | 787 inputs_[0] = value; |
788 } | 788 } |
789 | 789 |
790 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") | 790 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") |
791 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 791 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) |
792 }; | 792 }; |
793 | 793 |
794 | 794 |
795 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> { | 795 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> { |
796 public: | 796 public: |
797 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) { | 797 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) { |
798 inputs_[0] = value; | 798 inputs_[0] = value; |
799 temps_[0] = temp; | 799 temps_[0] = temp; |
800 } | 800 } |
801 | 801 |
802 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 802 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, |
803 "has-instance-type-and-branch") | 803 "has-instance-type-and-branch") |
804 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 804 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) |
805 | 805 |
806 virtual void PrintDataTo(StringStream* stream); | 806 virtual void PrintDataTo(StringStream* stream); |
807 }; | 807 }; |
808 | 808 |
809 | 809 |
810 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1> { | 810 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { |
811 public: | 811 public: |
812 explicit LHasCachedArrayIndex(LOperand* value) { | 812 explicit LHasCachedArrayIndex(LOperand* value) { |
813 inputs_[0] = value; | 813 inputs_[0] = value; |
814 } | 814 } |
815 | 815 |
816 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") | 816 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") |
817 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) | 817 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) |
818 }; | 818 }; |
819 | 819 |
820 | 820 |
821 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1> { | 821 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { |
822 public: | 822 public: |
823 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { | 823 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { |
824 inputs_[0] = value; | 824 inputs_[0] = value; |
825 } | 825 } |
826 | 826 |
827 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 827 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
828 "has-cached-array-index-and-branch") | 828 "has-cached-array-index-and-branch") |
829 virtual void PrintDataTo(StringStream* stream); | 829 virtual void PrintDataTo(StringStream* stream); |
830 }; | 830 }; |
831 | 831 |
(...skipping 21 matching lines...) Expand all Loading... |
853 } | 853 } |
854 | 854 |
855 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 855 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
856 "class-of-test-and-branch") | 856 "class-of-test-and-branch") |
857 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | 857 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) |
858 | 858 |
859 virtual void PrintDataTo(StringStream* stream); | 859 virtual void PrintDataTo(StringStream* stream); |
860 }; | 860 }; |
861 | 861 |
862 | 862 |
863 class LCmpT: public LTemplateInstruction<1, 2> { | 863 class LCmpT: public LTemplateInstruction<1, 2, 0> { |
864 public: | 864 public: |
865 LCmpT(LOperand* left, LOperand* right) { | 865 LCmpT(LOperand* left, LOperand* right) { |
866 inputs_[0] = left; | 866 inputs_[0] = left; |
867 inputs_[1] = right; | 867 inputs_[1] = right; |
868 } | 868 } |
869 | 869 |
870 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 870 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") |
871 DECLARE_HYDROGEN_ACCESSOR(Compare) | 871 DECLARE_HYDROGEN_ACCESSOR(Compare) |
872 | 872 |
873 Token::Value op() const { return hydrogen()->token(); } | 873 Token::Value op() const { return hydrogen()->token(); } |
874 }; | 874 }; |
875 | 875 |
876 | 876 |
877 class LCmpTAndBranch: public LControlInstruction<2> { | 877 class LCmpTAndBranch: public LControlInstruction<2, 0> { |
878 public: | 878 public: |
879 LCmpTAndBranch(LOperand* left, LOperand* right) { | 879 LCmpTAndBranch(LOperand* left, LOperand* right) { |
880 inputs_[0] = left; | 880 inputs_[0] = left; |
881 inputs_[1] = right; | 881 inputs_[1] = right; |
882 } | 882 } |
883 | 883 |
884 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") | 884 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") |
885 DECLARE_HYDROGEN_ACCESSOR(Compare) | 885 DECLARE_HYDROGEN_ACCESSOR(Compare) |
886 | 886 |
887 Token::Value op() const { return hydrogen()->token(); } | 887 Token::Value op() const { return hydrogen()->token(); } |
888 }; | 888 }; |
889 | 889 |
890 | 890 |
891 class LInstanceOf: public LTemplateInstruction<1, 2> { | 891 class LInstanceOf: public LTemplateInstruction<1, 2, 0> { |
892 public: | 892 public: |
893 LInstanceOf(LOperand* left, LOperand* right) { | 893 LInstanceOf(LOperand* left, LOperand* right) { |
894 inputs_[0] = left; | 894 inputs_[0] = left; |
895 inputs_[1] = right; | 895 inputs_[1] = right; |
896 } | 896 } |
897 | 897 |
898 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 898 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") |
899 }; | 899 }; |
900 | 900 |
901 | 901 |
902 class LInstanceOfAndBranch: public LControlInstruction<2> { | 902 class LInstanceOfAndBranch: public LControlInstruction<2, 0> { |
903 public: | 903 public: |
904 LInstanceOfAndBranch(LOperand* left, LOperand* right) { | 904 LInstanceOfAndBranch(LOperand* left, LOperand* right) { |
905 inputs_[0] = left; | 905 inputs_[0] = left; |
906 inputs_[1] = right; | 906 inputs_[1] = right; |
907 } | 907 } |
908 | 908 |
909 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") | 909 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") |
910 }; | 910 }; |
911 | 911 |
912 | 912 |
(...skipping 19 matching lines...) Expand all Loading... |
932 inputs_[1] = length; | 932 inputs_[1] = length; |
933 } | 933 } |
934 | 934 |
935 LOperand* index() { return inputs_[0]; } | 935 LOperand* index() { return inputs_[0]; } |
936 LOperand* length() { return inputs_[1]; } | 936 LOperand* length() { return inputs_[1]; } |
937 | 937 |
938 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") | 938 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") |
939 }; | 939 }; |
940 | 940 |
941 | 941 |
942 class LBitI: public LTemplateInstruction<1, 2> { | 942 class LBitI: public LTemplateInstruction<1, 2, 0> { |
943 public: | 943 public: |
944 LBitI(Token::Value op, LOperand* left, LOperand* right) | 944 LBitI(Token::Value op, LOperand* left, LOperand* right) |
945 : op_(op) { | 945 : op_(op) { |
946 inputs_[0] = left; | 946 inputs_[0] = left; |
947 inputs_[1] = right; | 947 inputs_[1] = right; |
948 } | 948 } |
949 | 949 |
950 Token::Value op() const { return op_; } | 950 Token::Value op() const { return op_; } |
951 | 951 |
952 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") | 952 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") |
953 | 953 |
954 private: | 954 private: |
955 Token::Value op_; | 955 Token::Value op_; |
956 }; | 956 }; |
957 | 957 |
958 | 958 |
959 class LShiftI: public LTemplateInstruction<1, 2> { | 959 class LShiftI: public LTemplateInstruction<1, 2, 0> { |
960 public: | 960 public: |
961 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) | 961 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) |
962 : op_(op), can_deopt_(can_deopt) { | 962 : op_(op), can_deopt_(can_deopt) { |
963 inputs_[0] = left; | 963 inputs_[0] = left; |
964 inputs_[1] = right; | 964 inputs_[1] = right; |
965 } | 965 } |
966 | 966 |
967 Token::Value op() const { return op_; } | 967 Token::Value op() const { return op_; } |
968 | 968 |
969 bool can_deopt() const { return can_deopt_; } | 969 bool can_deopt() const { return can_deopt_; } |
970 | 970 |
971 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") | 971 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") |
972 | 972 |
973 private: | 973 private: |
974 Token::Value op_; | 974 Token::Value op_; |
975 bool can_deopt_; | 975 bool can_deopt_; |
976 }; | 976 }; |
977 | 977 |
978 | 978 |
979 class LSubI: public LTemplateInstruction<1, 2> { | 979 class LSubI: public LTemplateInstruction<1, 2, 0> { |
980 public: | 980 public: |
981 LSubI(LOperand* left, LOperand* right) { | 981 LSubI(LOperand* left, LOperand* right) { |
982 inputs_[0] = left; | 982 inputs_[0] = left; |
983 inputs_[1] = right; | 983 inputs_[1] = right; |
984 } | 984 } |
985 | 985 |
986 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") | 986 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") |
987 DECLARE_HYDROGEN_ACCESSOR(Sub) | 987 DECLARE_HYDROGEN_ACCESSOR(Sub) |
988 }; | 988 }; |
989 | 989 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 explicit LConstantT(Handle<Object> value) : value_(value) { } | 1022 explicit LConstantT(Handle<Object> value) : value_(value) { } |
1023 Handle<Object> value() const { return value_; } | 1023 Handle<Object> value() const { return value_; } |
1024 | 1024 |
1025 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1025 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
1026 | 1026 |
1027 private: | 1027 private: |
1028 Handle<Object> value_; | 1028 Handle<Object> value_; |
1029 }; | 1029 }; |
1030 | 1030 |
1031 | 1031 |
1032 class LBranch: public LControlInstruction<1> { | 1032 class LBranch: public LControlInstruction<1, 0> { |
1033 public: | 1033 public: |
1034 explicit LBranch(LOperand* value) { | 1034 explicit LBranch(LOperand* value) { |
1035 inputs_[0] = value; | 1035 inputs_[0] = value; |
1036 } | 1036 } |
1037 | 1037 |
1038 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 1038 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
1039 DECLARE_HYDROGEN_ACCESSOR(Value) | 1039 DECLARE_HYDROGEN_ACCESSOR(Value) |
1040 | 1040 |
1041 virtual void PrintDataTo(StringStream* stream); | 1041 virtual void PrintDataTo(StringStream* stream); |
1042 }; | 1042 }; |
1043 | 1043 |
1044 | 1044 |
1045 class LCmpMapAndBranch: public LTemplateInstruction<0, 1> { | 1045 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { |
1046 public: | 1046 public: |
1047 explicit LCmpMapAndBranch(LOperand* value) { | 1047 explicit LCmpMapAndBranch(LOperand* value) { |
1048 inputs_[0] = value; | 1048 inputs_[0] = value; |
1049 } | 1049 } |
1050 | 1050 |
1051 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 1051 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") |
1052 DECLARE_HYDROGEN_ACCESSOR(CompareMap) | 1052 DECLARE_HYDROGEN_ACCESSOR(CompareMap) |
1053 | 1053 |
1054 virtual bool IsControl() const { return true; } | 1054 virtual bool IsControl() const { return true; } |
1055 | 1055 |
1056 Handle<Map> map() const { return hydrogen()->map(); } | 1056 Handle<Map> map() const { return hydrogen()->map(); } |
1057 int true_block_id() const { | 1057 int true_block_id() const { |
1058 return hydrogen()->FirstSuccessor()->block_id(); | 1058 return hydrogen()->FirstSuccessor()->block_id(); |
1059 } | 1059 } |
1060 int false_block_id() const { | 1060 int false_block_id() const { |
1061 return hydrogen()->SecondSuccessor()->block_id(); | 1061 return hydrogen()->SecondSuccessor()->block_id(); |
1062 } | 1062 } |
1063 }; | 1063 }; |
1064 | 1064 |
1065 | 1065 |
1066 class LJSArrayLength: public LTemplateInstruction<1, 1> { | 1066 class LJSArrayLength: public LTemplateInstruction<1, 1, 0> { |
1067 public: | 1067 public: |
1068 explicit LJSArrayLength(LOperand* value) { | 1068 explicit LJSArrayLength(LOperand* value) { |
1069 inputs_[0] = value; | 1069 inputs_[0] = value; |
1070 } | 1070 } |
1071 | 1071 |
1072 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") | 1072 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") |
1073 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) | 1073 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) |
1074 }; | 1074 }; |
1075 | 1075 |
1076 | 1076 |
1077 class LFixedArrayLength: public LTemplateInstruction<1, 1> { | 1077 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> { |
1078 public: | 1078 public: |
1079 explicit LFixedArrayLength(LOperand* value) { | 1079 explicit LFixedArrayLength(LOperand* value) { |
1080 inputs_[0] = value; | 1080 inputs_[0] = value; |
1081 } | 1081 } |
1082 | 1082 |
1083 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") | 1083 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") |
1084 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) | 1084 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) |
1085 }; | 1085 }; |
1086 | 1086 |
1087 | 1087 |
1088 class LValueOf: public LTemplateInstruction<1, 1, 1> { | 1088 class LValueOf: public LTemplateInstruction<1, 1, 1> { |
1089 public: | 1089 public: |
1090 LValueOf(LOperand* value, LOperand* temp) { | 1090 LValueOf(LOperand* value, LOperand* temp) { |
1091 inputs_[0] = value; | 1091 inputs_[0] = value; |
1092 temps_[0] = temp; | 1092 temps_[0] = temp; |
1093 } | 1093 } |
1094 | 1094 |
1095 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") | 1095 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") |
1096 DECLARE_HYDROGEN_ACCESSOR(ValueOf) | 1096 DECLARE_HYDROGEN_ACCESSOR(ValueOf) |
1097 }; | 1097 }; |
1098 | 1098 |
1099 | 1099 |
1100 class LThrow: public LTemplateInstruction<0, 1> { | 1100 class LThrow: public LTemplateInstruction<0, 1, 0> { |
1101 public: | 1101 public: |
1102 explicit LThrow(LOperand* value) { | 1102 explicit LThrow(LOperand* value) { |
1103 inputs_[0] = value; | 1103 inputs_[0] = value; |
1104 } | 1104 } |
1105 | 1105 |
1106 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") | 1106 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") |
1107 }; | 1107 }; |
1108 | 1108 |
1109 | 1109 |
1110 class LBitNotI: public LTemplateInstruction<1, 1> { | 1110 class LBitNotI: public LTemplateInstruction<1, 1, 0> { |
1111 public: | 1111 public: |
1112 explicit LBitNotI(LOperand* value) { | 1112 explicit LBitNotI(LOperand* value) { |
1113 inputs_[0] = value; | 1113 inputs_[0] = value; |
1114 } | 1114 } |
1115 | 1115 |
1116 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") | 1116 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") |
1117 }; | 1117 }; |
1118 | 1118 |
1119 | 1119 |
1120 class LAddI: public LTemplateInstruction<1, 2> { | 1120 class LAddI: public LTemplateInstruction<1, 2, 0> { |
1121 public: | 1121 public: |
1122 LAddI(LOperand* left, LOperand* right) { | 1122 LAddI(LOperand* left, LOperand* right) { |
1123 inputs_[0] = left; | 1123 inputs_[0] = left; |
1124 inputs_[1] = right; | 1124 inputs_[1] = right; |
1125 } | 1125 } |
1126 | 1126 |
1127 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") | 1127 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") |
1128 DECLARE_HYDROGEN_ACCESSOR(Add) | 1128 DECLARE_HYDROGEN_ACCESSOR(Add) |
1129 }; | 1129 }; |
1130 | 1130 |
1131 | 1131 |
1132 class LPower: public LTemplateInstruction<1, 2> { | 1132 class LPower: public LTemplateInstruction<1, 2, 0> { |
1133 public: | 1133 public: |
1134 LPower(LOperand* left, LOperand* right) { | 1134 LPower(LOperand* left, LOperand* right) { |
1135 inputs_[0] = left; | 1135 inputs_[0] = left; |
1136 inputs_[1] = right; | 1136 inputs_[1] = right; |
1137 } | 1137 } |
1138 | 1138 |
1139 DECLARE_CONCRETE_INSTRUCTION(Power, "power") | 1139 DECLARE_CONCRETE_INSTRUCTION(Power, "power") |
1140 DECLARE_HYDROGEN_ACCESSOR(Power) | 1140 DECLARE_HYDROGEN_ACCESSOR(Power) |
1141 }; | 1141 }; |
1142 | 1142 |
1143 | 1143 |
1144 class LArithmeticD: public LTemplateInstruction<1, 2> { | 1144 class LArithmeticD: public LTemplateInstruction<1, 2, 0> { |
1145 public: | 1145 public: |
1146 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) | 1146 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) |
1147 : op_(op) { | 1147 : op_(op) { |
1148 inputs_[0] = left; | 1148 inputs_[0] = left; |
1149 inputs_[1] = right; | 1149 inputs_[1] = right; |
1150 } | 1150 } |
1151 | 1151 |
1152 Token::Value op() const { return op_; } | 1152 Token::Value op() const { return op_; } |
1153 | 1153 |
1154 virtual void CompileToNative(LCodeGen* generator); | 1154 virtual void CompileToNative(LCodeGen* generator); |
1155 virtual const char* Mnemonic() const; | 1155 virtual const char* Mnemonic() const; |
1156 | 1156 |
1157 private: | 1157 private: |
1158 Token::Value op_; | 1158 Token::Value op_; |
1159 }; | 1159 }; |
1160 | 1160 |
1161 | 1161 |
1162 class LArithmeticT: public LTemplateInstruction<1, 2> { | 1162 class LArithmeticT: public LTemplateInstruction<1, 2, 0> { |
1163 public: | 1163 public: |
1164 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) | 1164 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) |
1165 : op_(op) { | 1165 : op_(op) { |
1166 inputs_[0] = left; | 1166 inputs_[0] = left; |
1167 inputs_[1] = right; | 1167 inputs_[1] = right; |
1168 } | 1168 } |
1169 | 1169 |
1170 virtual void CompileToNative(LCodeGen* generator); | 1170 virtual void CompileToNative(LCodeGen* generator); |
1171 virtual const char* Mnemonic() const; | 1171 virtual const char* Mnemonic() const; |
1172 | 1172 |
1173 Token::Value op() const { return op_; } | 1173 Token::Value op() const { return op_; } |
1174 | 1174 |
1175 private: | 1175 private: |
1176 Token::Value op_; | 1176 Token::Value op_; |
1177 }; | 1177 }; |
1178 | 1178 |
1179 | 1179 |
1180 class LReturn: public LTemplateInstruction<0, 1> { | 1180 class LReturn: public LTemplateInstruction<0, 1, 0> { |
1181 public: | 1181 public: |
1182 explicit LReturn(LOperand* value) { | 1182 explicit LReturn(LOperand* value) { |
1183 inputs_[0] = value; | 1183 inputs_[0] = value; |
1184 } | 1184 } |
1185 | 1185 |
1186 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 1186 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
1187 }; | 1187 }; |
1188 | 1188 |
1189 | 1189 |
1190 class LLoadNamedField: public LTemplateInstruction<1, 1> { | 1190 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { |
1191 public: | 1191 public: |
1192 explicit LLoadNamedField(LOperand* object) { | 1192 explicit LLoadNamedField(LOperand* object) { |
1193 inputs_[0] = object; | 1193 inputs_[0] = object; |
1194 } | 1194 } |
1195 | 1195 |
1196 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1196 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
1197 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1197 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
1198 }; | 1198 }; |
1199 | 1199 |
1200 | 1200 |
1201 class LLoadNamedGeneric: public LTemplateInstruction<1, 1> { | 1201 class LLoadNamedGeneric: public LTemplateInstruction<1, 1, 0> { |
1202 public: | 1202 public: |
1203 explicit LLoadNamedGeneric(LOperand* object) { | 1203 explicit LLoadNamedGeneric(LOperand* object) { |
1204 inputs_[0] = object; | 1204 inputs_[0] = object; |
1205 } | 1205 } |
1206 | 1206 |
1207 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 1207 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") |
1208 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 1208 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) |
1209 | 1209 |
1210 LOperand* object() { return inputs_[0]; } | 1210 LOperand* object() { return inputs_[0]; } |
1211 Handle<Object> name() const { return hydrogen()->name(); } | 1211 Handle<Object> name() const { return hydrogen()->name(); } |
1212 }; | 1212 }; |
1213 | 1213 |
1214 | 1214 |
1215 class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> { | 1215 class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> { |
1216 public: | 1216 public: |
1217 LLoadFunctionPrototype(LOperand* function, LOperand* temp) { | 1217 LLoadFunctionPrototype(LOperand* function, LOperand* temp) { |
1218 inputs_[0] = function; | 1218 inputs_[0] = function; |
1219 temps_[0] = temp; | 1219 temps_[0] = temp; |
1220 } | 1220 } |
1221 | 1221 |
1222 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 1222 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") |
1223 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 1223 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) |
1224 | 1224 |
1225 LOperand* function() { return inputs_[0]; } | 1225 LOperand* function() { return inputs_[0]; } |
1226 }; | 1226 }; |
1227 | 1227 |
1228 | 1228 |
1229 class LLoadElements: public LTemplateInstruction<1, 1> { | 1229 class LLoadElements: public LTemplateInstruction<1, 1, 0> { |
1230 public: | 1230 public: |
1231 explicit LLoadElements(LOperand* object) { | 1231 explicit LLoadElements(LOperand* object) { |
1232 inputs_[0] = object; | 1232 inputs_[0] = object; |
1233 } | 1233 } |
1234 | 1234 |
1235 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") | 1235 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") |
1236 }; | 1236 }; |
1237 | 1237 |
1238 | 1238 |
1239 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2> { | 1239 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { |
1240 public: | 1240 public: |
1241 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { | 1241 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { |
1242 inputs_[0] = elements; | 1242 inputs_[0] = elements; |
1243 inputs_[1] = key; | 1243 inputs_[1] = key; |
1244 } | 1244 } |
1245 | 1245 |
1246 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") | 1246 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") |
1247 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) | 1247 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) |
1248 | 1248 |
1249 LOperand* elements() { return inputs_[0]; } | 1249 LOperand* elements() { return inputs_[0]; } |
1250 LOperand* key() { return inputs_[1]; } | 1250 LOperand* key() { return inputs_[1]; } |
1251 }; | 1251 }; |
1252 | 1252 |
1253 | 1253 |
1254 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2> { | 1254 class LLoadKeyedGeneric: public LTemplateInstruction<1, 2, 0> { |
1255 public: | 1255 public: |
1256 LLoadKeyedGeneric(LOperand* obj, LOperand* key) { | 1256 LLoadKeyedGeneric(LOperand* obj, LOperand* key) { |
1257 inputs_[0] = obj; | 1257 inputs_[0] = obj; |
1258 inputs_[1] = key; | 1258 inputs_[1] = key; |
1259 } | 1259 } |
1260 | 1260 |
1261 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") | 1261 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") |
1262 | 1262 |
1263 LOperand* object() { return inputs_[0]; } | 1263 LOperand* object() { return inputs_[0]; } |
1264 LOperand* key() { return inputs_[1]; } | 1264 LOperand* key() { return inputs_[1]; } |
1265 }; | 1265 }; |
1266 | 1266 |
1267 | 1267 |
1268 class LLoadGlobal: public LTemplateInstruction<1, 0, 0> { | 1268 class LLoadGlobal: public LTemplateInstruction<1, 0, 0> { |
1269 public: | 1269 public: |
1270 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") | 1270 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") |
1271 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) | 1271 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) |
1272 }; | 1272 }; |
1273 | 1273 |
1274 | 1274 |
1275 class LStoreGlobal: public LTemplateInstruction<0, 1> { | 1275 class LStoreGlobal: public LTemplateInstruction<0, 1, 0> { |
1276 public: | 1276 public: |
1277 explicit LStoreGlobal(LOperand* value) { | 1277 explicit LStoreGlobal(LOperand* value) { |
1278 inputs_[0] = value; | 1278 inputs_[0] = value; |
1279 } | 1279 } |
1280 | 1280 |
1281 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") | 1281 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") |
1282 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) | 1282 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) |
1283 }; | 1283 }; |
1284 | 1284 |
1285 | 1285 |
1286 class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> { | 1286 class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> { |
1287 public: | 1287 public: |
1288 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") | 1288 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") |
1289 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) | 1289 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) |
1290 | 1290 |
1291 int context_chain_length() { return hydrogen()->context_chain_length(); } | 1291 int context_chain_length() { return hydrogen()->context_chain_length(); } |
1292 int slot_index() { return hydrogen()->slot_index(); } | 1292 int slot_index() { return hydrogen()->slot_index(); } |
1293 | 1293 |
1294 virtual void PrintDataTo(StringStream* stream); | 1294 virtual void PrintDataTo(StringStream* stream); |
1295 }; | 1295 }; |
1296 | 1296 |
1297 | 1297 |
1298 class LPushArgument: public LTemplateInstruction<0, 1> { | 1298 class LPushArgument: public LTemplateInstruction<0, 1, 0> { |
1299 public: | 1299 public: |
1300 explicit LPushArgument(LOperand* value) { | 1300 explicit LPushArgument(LOperand* value) { |
1301 inputs_[0] = value; | 1301 inputs_[0] = value; |
1302 } | 1302 } |
1303 | 1303 |
1304 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") | 1304 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") |
1305 }; | 1305 }; |
1306 | 1306 |
1307 | 1307 |
1308 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { | 1308 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1382 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") | 1382 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") |
1383 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) | 1383 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) |
1384 | 1384 |
1385 virtual void PrintDataTo(StringStream* stream); | 1385 virtual void PrintDataTo(StringStream* stream); |
1386 | 1386 |
1387 Handle<JSFunction> target() const { return hydrogen()->target(); } | 1387 Handle<JSFunction> target() const { return hydrogen()->target(); } |
1388 int arity() const { return hydrogen()->argument_count() - 1; } | 1388 int arity() const { return hydrogen()->argument_count() - 1; } |
1389 }; | 1389 }; |
1390 | 1390 |
1391 | 1391 |
1392 class LCallNew: public LTemplateInstruction<1, 1> { | 1392 class LCallNew: public LTemplateInstruction<1, 1, 0> { |
1393 public: | 1393 public: |
1394 explicit LCallNew(LOperand* constructor) { | 1394 explicit LCallNew(LOperand* constructor) { |
1395 inputs_[0] = constructor; | 1395 inputs_[0] = constructor; |
1396 } | 1396 } |
1397 | 1397 |
1398 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") | 1398 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") |
1399 DECLARE_HYDROGEN_ACCESSOR(CallNew) | 1399 DECLARE_HYDROGEN_ACCESSOR(CallNew) |
1400 | 1400 |
1401 virtual void PrintDataTo(StringStream* stream); | 1401 virtual void PrintDataTo(StringStream* stream); |
1402 | 1402 |
1403 int arity() const { return hydrogen()->argument_count() - 1; } | 1403 int arity() const { return hydrogen()->argument_count() - 1; } |
1404 }; | 1404 }; |
1405 | 1405 |
1406 | 1406 |
1407 class LCallRuntime: public LTemplateInstruction<1, 0, 0> { | 1407 class LCallRuntime: public LTemplateInstruction<1, 0, 0> { |
1408 public: | 1408 public: |
1409 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1409 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
1410 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1410 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
1411 | 1411 |
1412 Runtime::Function* function() const { return hydrogen()->function(); } | 1412 Runtime::Function* function() const { return hydrogen()->function(); } |
1413 int arity() const { return hydrogen()->argument_count(); } | 1413 int arity() const { return hydrogen()->argument_count(); } |
1414 }; | 1414 }; |
1415 | 1415 |
1416 | 1416 |
1417 class LInteger32ToDouble: public LTemplateInstruction<1, 1> { | 1417 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { |
1418 public: | 1418 public: |
1419 explicit LInteger32ToDouble(LOperand* value) { | 1419 explicit LInteger32ToDouble(LOperand* value) { |
1420 inputs_[0] = value; | 1420 inputs_[0] = value; |
1421 } | 1421 } |
1422 | 1422 |
1423 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") | 1423 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") |
1424 }; | 1424 }; |
1425 | 1425 |
1426 | 1426 |
1427 class LNumberTagI: public LTemplateInstruction<1, 1> { | 1427 class LNumberTagI: public LTemplateInstruction<1, 1, 0> { |
1428 public: | 1428 public: |
1429 explicit LNumberTagI(LOperand* value) { | 1429 explicit LNumberTagI(LOperand* value) { |
1430 inputs_[0] = value; | 1430 inputs_[0] = value; |
1431 } | 1431 } |
1432 | 1432 |
1433 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 1433 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") |
1434 }; | 1434 }; |
1435 | 1435 |
1436 | 1436 |
1437 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { | 1437 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { |
(...skipping 30 matching lines...) Expand all Loading... |
1468 temps_[0] = temp; | 1468 temps_[0] = temp; |
1469 } | 1469 } |
1470 | 1470 |
1471 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 1471 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") |
1472 DECLARE_HYDROGEN_ACCESSOR(Change) | 1472 DECLARE_HYDROGEN_ACCESSOR(Change) |
1473 | 1473 |
1474 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1474 bool truncating() { return hydrogen()->CanTruncateToInt32(); } |
1475 }; | 1475 }; |
1476 | 1476 |
1477 | 1477 |
1478 class LSmiTag: public LTemplateInstruction<1, 1> { | 1478 class LSmiTag: public LTemplateInstruction<1, 1, 0> { |
1479 public: | 1479 public: |
1480 explicit LSmiTag(LOperand* value) { | 1480 explicit LSmiTag(LOperand* value) { |
1481 inputs_[0] = value; | 1481 inputs_[0] = value; |
1482 } | 1482 } |
1483 | 1483 |
1484 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 1484 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") |
1485 }; | 1485 }; |
1486 | 1486 |
1487 | 1487 |
1488 class LNumberUntagD: public LTemplateInstruction<1, 1> { | 1488 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { |
1489 public: | 1489 public: |
1490 explicit LNumberUntagD(LOperand* value) { | 1490 explicit LNumberUntagD(LOperand* value) { |
1491 inputs_[0] = value; | 1491 inputs_[0] = value; |
1492 } | 1492 } |
1493 | 1493 |
1494 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") | 1494 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") |
1495 }; | 1495 }; |
1496 | 1496 |
1497 | 1497 |
1498 class LSmiUntag: public LTemplateInstruction<1, 1> { | 1498 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { |
1499 public: | 1499 public: |
1500 LSmiUntag(LOperand* value, bool needs_check) | 1500 LSmiUntag(LOperand* value, bool needs_check) |
1501 : needs_check_(needs_check) { | 1501 : needs_check_(needs_check) { |
1502 inputs_[0] = value; | 1502 inputs_[0] = value; |
1503 } | 1503 } |
1504 | 1504 |
1505 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 1505 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") |
1506 | 1506 |
1507 bool needs_check() const { return needs_check_; } | 1507 bool needs_check() const { return needs_check_; } |
1508 | 1508 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 inputs_[0] = string; | 1615 inputs_[0] = string; |
1616 } | 1616 } |
1617 | 1617 |
1618 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") | 1618 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") |
1619 DECLARE_HYDROGEN_ACCESSOR(StringLength) | 1619 DECLARE_HYDROGEN_ACCESSOR(StringLength) |
1620 | 1620 |
1621 LOperand* string() { return inputs_[0]; } | 1621 LOperand* string() { return inputs_[0]; } |
1622 }; | 1622 }; |
1623 | 1623 |
1624 | 1624 |
1625 class LCheckFunction: public LTemplateInstruction<0, 1> { | 1625 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { |
1626 public: | 1626 public: |
1627 explicit LCheckFunction(LOperand* value) { | 1627 explicit LCheckFunction(LOperand* value) { |
1628 inputs_[0] = value; | 1628 inputs_[0] = value; |
1629 } | 1629 } |
1630 | 1630 |
1631 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") | 1631 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") |
1632 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) | 1632 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) |
1633 }; | 1633 }; |
1634 | 1634 |
1635 | 1635 |
1636 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> { | 1636 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> { |
1637 public: | 1637 public: |
1638 LCheckInstanceType(LOperand* value, LOperand* temp) { | 1638 LCheckInstanceType(LOperand* value, LOperand* temp) { |
1639 inputs_[0] = value; | 1639 inputs_[0] = value; |
1640 temps_[0] = temp; | 1640 temps_[0] = temp; |
1641 } | 1641 } |
1642 | 1642 |
1643 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 1643 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") |
1644 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 1644 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) |
1645 }; | 1645 }; |
1646 | 1646 |
1647 | 1647 |
1648 class LCheckMap: public LTemplateInstruction<0, 1> { | 1648 class LCheckMap: public LTemplateInstruction<0, 1, 0> { |
1649 public: | 1649 public: |
1650 explicit LCheckMap(LOperand* value) { | 1650 explicit LCheckMap(LOperand* value) { |
1651 inputs_[0] = value; | 1651 inputs_[0] = value; |
1652 } | 1652 } |
1653 | 1653 |
1654 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") | 1654 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") |
1655 DECLARE_HYDROGEN_ACCESSOR(CheckMap) | 1655 DECLARE_HYDROGEN_ACCESSOR(CheckMap) |
1656 }; | 1656 }; |
1657 | 1657 |
1658 | 1658 |
1659 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> { | 1659 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> { |
1660 public: | 1660 public: |
1661 explicit LCheckPrototypeMaps(LOperand* temp) { | 1661 explicit LCheckPrototypeMaps(LOperand* temp) { |
1662 temps_[0] = temp; | 1662 temps_[0] = temp; |
1663 } | 1663 } |
1664 | 1664 |
1665 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") | 1665 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") |
1666 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) | 1666 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) |
1667 | 1667 |
1668 Handle<JSObject> prototype() const { return hydrogen()->prototype(); } | 1668 Handle<JSObject> prototype() const { return hydrogen()->prototype(); } |
1669 Handle<JSObject> holder() const { return hydrogen()->holder(); } | 1669 Handle<JSObject> holder() const { return hydrogen()->holder(); } |
1670 }; | 1670 }; |
1671 | 1671 |
1672 | 1672 |
1673 class LCheckSmi: public LTemplateInstruction<0, 1> { | 1673 class LCheckSmi: public LTemplateInstruction<0, 1, 0> { |
1674 public: | 1674 public: |
1675 LCheckSmi(LOperand* value, Condition condition) | 1675 LCheckSmi(LOperand* value, Condition condition) |
1676 : condition_(condition) { | 1676 : condition_(condition) { |
1677 inputs_[0] = value; | 1677 inputs_[0] = value; |
1678 } | 1678 } |
1679 | 1679 |
1680 Condition condition() const { return condition_; } | 1680 Condition condition() const { return condition_; } |
1681 | 1681 |
1682 virtual void CompileToNative(LCodeGen* generator); | 1682 virtual void CompileToNative(LCodeGen* generator); |
1683 virtual const char* Mnemonic() const { | 1683 virtual const char* Mnemonic() const { |
(...skipping 28 matching lines...) Expand all Loading... |
1712 | 1712 |
1713 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> { | 1713 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> { |
1714 public: | 1714 public: |
1715 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") | 1715 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
1716 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) | 1716 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
1717 | 1717 |
1718 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } | 1718 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } |
1719 }; | 1719 }; |
1720 | 1720 |
1721 | 1721 |
1722 class LTypeof: public LTemplateInstruction<1, 1> { | 1722 class LTypeof: public LTemplateInstruction<1, 1, 0> { |
1723 public: | 1723 public: |
1724 explicit LTypeof(LOperand* value) { | 1724 explicit LTypeof(LOperand* value) { |
1725 inputs_[0] = value; | 1725 inputs_[0] = value; |
1726 } | 1726 } |
1727 | 1727 |
1728 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 1728 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
1729 }; | 1729 }; |
1730 | 1730 |
1731 | 1731 |
1732 class LTypeofIs: public LTemplateInstruction<1, 1> { | 1732 class LTypeofIs: public LTemplateInstruction<1, 1, 0> { |
1733 public: | 1733 public: |
1734 explicit LTypeofIs(LOperand* value) { | 1734 explicit LTypeofIs(LOperand* value) { |
1735 inputs_[0] = value; | 1735 inputs_[0] = value; |
1736 } | 1736 } |
1737 | 1737 |
1738 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") | 1738 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") |
1739 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 1739 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) |
1740 | 1740 |
1741 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1741 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
1742 | 1742 |
1743 virtual void PrintDataTo(StringStream* stream); | 1743 virtual void PrintDataTo(StringStream* stream); |
1744 }; | 1744 }; |
1745 | 1745 |
1746 | 1746 |
1747 class LTypeofIsAndBranch: public LControlInstruction<1> { | 1747 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { |
1748 public: | 1748 public: |
1749 explicit LTypeofIsAndBranch(LOperand* value) { | 1749 explicit LTypeofIsAndBranch(LOperand* value) { |
1750 inputs_[0] = value; | 1750 inputs_[0] = value; |
1751 } | 1751 } |
1752 | 1752 |
1753 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 1753 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
1754 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 1754 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) |
1755 | 1755 |
1756 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1756 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
1757 | 1757 |
1758 virtual void PrintDataTo(StringStream* stream); | 1758 virtual void PrintDataTo(StringStream* stream); |
1759 }; | 1759 }; |
1760 | 1760 |
1761 | 1761 |
1762 class LDeleteProperty: public LTemplateInstruction<1, 2> { | 1762 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { |
1763 public: | 1763 public: |
1764 LDeleteProperty(LOperand* obj, LOperand* key) { | 1764 LDeleteProperty(LOperand* obj, LOperand* key) { |
1765 inputs_[0] = obj; | 1765 inputs_[0] = obj; |
1766 inputs_[1] = key; | 1766 inputs_[1] = key; |
1767 } | 1767 } |
1768 | 1768 |
1769 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 1769 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
1770 | 1770 |
1771 LOperand* object() { return inputs_[0]; } | 1771 LOperand* object() { return inputs_[0]; } |
1772 LOperand* key() { return inputs_[1]; } | 1772 LOperand* key() { return inputs_[1]; } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2018 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2018 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2019 }; | 2019 }; |
2020 | 2020 |
2021 #undef DECLARE_HYDROGEN_ACCESSOR | 2021 #undef DECLARE_HYDROGEN_ACCESSOR |
2022 #undef DECLARE_INSTRUCTION | 2022 #undef DECLARE_INSTRUCTION |
2023 #undef DECLARE_CONCRETE_INSTRUCTION | 2023 #undef DECLARE_CONCRETE_INSTRUCTION |
2024 | 2024 |
2025 } } // namespace v8::internal | 2025 } } // namespace v8::internal |
2026 | 2026 |
2027 #endif // V8_IA32_LITHIUM_IA32_H_ | 2027 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |