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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 | 565 |
566 Token::Value op() const { return hydrogen()->token(); } | 566 Token::Value op() const { return hydrogen()->token(); } |
567 bool is_double() const { | 567 bool is_double() const { |
568 return hydrogen()->GetInputRepresentation().IsDouble(); | 568 return hydrogen()->GetInputRepresentation().IsDouble(); |
569 } | 569 } |
570 | 570 |
571 virtual void PrintDataTo(StringStream* stream); | 571 virtual void PrintDataTo(StringStream* stream); |
572 }; | 572 }; |
573 | 573 |
574 | 574 |
575 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { | 575 class LUnaryMathOperation: public LTemplateInstruction<1, 2, 0> { |
576 public: | 576 public: |
577 explicit LUnaryMathOperation(LOperand* value) { | 577 LUnaryMathOperation(LOperand* context, LOperand* value) { |
| 578 inputs_[1] = context; |
578 inputs_[0] = value; | 579 inputs_[0] = value; |
579 } | 580 } |
580 | 581 |
| 582 LOperand* context() { return inputs_[1]; } |
| 583 LOperand* value() { return inputs_[0]; } |
| 584 |
581 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 585 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") |
582 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 586 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) |
583 | 587 |
584 virtual void PrintDataTo(StringStream* stream); | 588 virtual void PrintDataTo(StringStream* stream); |
585 BuiltinFunctionId op() const { return hydrogen()->op(); } | 589 BuiltinFunctionId op() const { return hydrogen()->op(); } |
586 }; | 590 }; |
587 | 591 |
588 | 592 |
589 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { | 593 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { |
590 public: | 594 public: |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 | 651 |
648 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 652 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") |
649 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) | 653 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) |
650 | 654 |
651 virtual void PrintDataTo(StringStream* stream); | 655 virtual void PrintDataTo(StringStream* stream); |
652 }; | 656 }; |
653 | 657 |
654 | 658 |
655 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { | 659 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { |
656 public: | 660 public: |
657 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { | 661 LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { |
658 inputs_[0] = value; | 662 inputs_[0] = value; |
659 temps_[0] = temp; | 663 temps_[0] = temp; |
660 } | 664 } |
661 | 665 |
662 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, | 666 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, |
663 "is-undetectable-and-branch") | 667 "is-undetectable-and-branch") |
664 | 668 |
665 virtual void PrintDataTo(StringStream* stream); | 669 virtual void PrintDataTo(StringStream* stream); |
666 }; | 670 }; |
667 | 671 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 } | 728 } |
725 | 729 |
726 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 730 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, |
727 "class-of-test-and-branch") | 731 "class-of-test-and-branch") |
728 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) | 732 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) |
729 | 733 |
730 virtual void PrintDataTo(StringStream* stream); | 734 virtual void PrintDataTo(StringStream* stream); |
731 }; | 735 }; |
732 | 736 |
733 | 737 |
734 class LCmpT: public LTemplateInstruction<1, 2, 0> { | 738 class LCmpT: public LTemplateInstruction<1, 3, 0> { |
735 public: | 739 public: |
736 LCmpT(LOperand* left, LOperand* right) { | 740 LCmpT(LOperand* context, LOperand* left, LOperand* right) { |
737 inputs_[0] = left; | 741 inputs_[0] = context; |
738 inputs_[1] = right; | 742 inputs_[1] = left; |
| 743 inputs_[2] = right; |
739 } | 744 } |
740 | 745 |
741 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 746 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") |
742 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) | 747 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) |
743 | 748 |
744 Token::Value op() const { return hydrogen()->token(); } | 749 Token::Value op() const { return hydrogen()->token(); } |
745 }; | 750 }; |
746 | 751 |
747 | 752 |
748 class LInstanceOf: public LTemplateInstruction<1, 3, 0> { | 753 class LInstanceOf: public LTemplateInstruction<1, 3, 0> { |
749 public: | 754 public: |
750 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { | 755 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { |
751 inputs_[0] = context; | 756 inputs_[0] = context; |
752 inputs_[1] = left; | 757 inputs_[1] = left; |
753 inputs_[2] = right; | 758 inputs_[2] = right; |
754 } | 759 } |
755 | 760 |
756 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 761 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") |
757 | 762 |
758 LOperand* context() { return inputs_[0]; } | 763 LOperand* context() { return inputs_[0]; } |
759 }; | 764 }; |
760 | 765 |
761 | 766 |
762 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> { | 767 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 2, 1> { |
763 public: | 768 public: |
764 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) { | 769 LInstanceOfKnownGlobal(LOperand* context, LOperand* value, LOperand* temp) { |
765 inputs_[0] = value; | 770 inputs_[0] = context; |
| 771 inputs_[1] = value; |
766 temps_[0] = temp; | 772 temps_[0] = temp; |
767 } | 773 } |
768 | 774 |
769 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 775 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, |
770 "instance-of-known-global") | 776 "instance-of-known-global") |
771 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) | 777 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) |
772 | 778 |
773 Handle<JSFunction> function() const { return hydrogen()->function(); } | 779 Handle<JSFunction> function() const { return hydrogen()->function(); } |
774 }; | 780 }; |
775 | 781 |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 LValueOf(LOperand* value, LOperand* temp) { | 957 LValueOf(LOperand* value, LOperand* temp) { |
952 inputs_[0] = value; | 958 inputs_[0] = value; |
953 temps_[0] = temp; | 959 temps_[0] = temp; |
954 } | 960 } |
955 | 961 |
956 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") | 962 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") |
957 DECLARE_HYDROGEN_ACCESSOR(ValueOf) | 963 DECLARE_HYDROGEN_ACCESSOR(ValueOf) |
958 }; | 964 }; |
959 | 965 |
960 | 966 |
961 class LThrow: public LTemplateInstruction<0, 1, 0> { | 967 class LThrow: public LTemplateInstruction<0, 2, 0> { |
962 public: | 968 public: |
963 explicit LThrow(LOperand* value) { | 969 LThrow(LOperand* context, LOperand* value) { |
964 inputs_[0] = value; | 970 inputs_[0] = context; |
| 971 inputs_[1] = value; |
965 } | 972 } |
966 | 973 |
| 974 LOperand* context() { return inputs_[0]; } |
| 975 LOperand* value() { return inputs_[1]; } |
| 976 |
967 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") | 977 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") |
968 }; | 978 }; |
969 | 979 |
970 | 980 |
971 class LBitNotI: public LTemplateInstruction<1, 1, 0> { | 981 class LBitNotI: public LTemplateInstruction<1, 1, 0> { |
972 public: | 982 public: |
973 explicit LBitNotI(LOperand* value) { | 983 explicit LBitNotI(LOperand* value) { |
974 inputs_[0] = value; | 984 inputs_[0] = value; |
975 } | 985 } |
976 | 986 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1014 | 1024 |
1015 virtual Opcode opcode() const { return LInstruction::kArithmeticD; } | 1025 virtual Opcode opcode() const { return LInstruction::kArithmeticD; } |
1016 virtual void CompileToNative(LCodeGen* generator); | 1026 virtual void CompileToNative(LCodeGen* generator); |
1017 virtual const char* Mnemonic() const; | 1027 virtual const char* Mnemonic() const; |
1018 | 1028 |
1019 private: | 1029 private: |
1020 Token::Value op_; | 1030 Token::Value op_; |
1021 }; | 1031 }; |
1022 | 1032 |
1023 | 1033 |
1024 class LArithmeticT: public LTemplateInstruction<1, 2, 0> { | 1034 class LArithmeticT: public LTemplateInstruction<1, 3, 0> { |
1025 public: | 1035 public: |
1026 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) | 1036 LArithmeticT(Token::Value op, |
| 1037 LOperand* context, |
| 1038 LOperand* left, |
| 1039 LOperand* right) |
1027 : op_(op) { | 1040 : op_(op) { |
1028 inputs_[0] = left; | 1041 inputs_[0] = context; |
1029 inputs_[1] = right; | 1042 inputs_[1] = left; |
| 1043 inputs_[2] = right; |
1030 } | 1044 } |
1031 | 1045 |
1032 virtual Opcode opcode() const { return LInstruction::kArithmeticT; } | 1046 virtual Opcode opcode() const { return LInstruction::kArithmeticT; } |
1033 virtual void CompileToNative(LCodeGen* generator); | 1047 virtual void CompileToNative(LCodeGen* generator); |
1034 virtual const char* Mnemonic() const; | 1048 virtual const char* Mnemonic() const; |
1035 | 1049 |
1036 Token::Value op() const { return op_; } | 1050 Token::Value op() const { return op_; } |
| 1051 LOperand* context() { return inputs_[0]; } |
| 1052 LOperand* left() { return inputs_[1]; } |
| 1053 LOperand* right() { return inputs_[2]; } |
1037 | 1054 |
1038 private: | 1055 private: |
1039 Token::Value op_; | 1056 Token::Value op_; |
1040 }; | 1057 }; |
1041 | 1058 |
1042 | 1059 |
1043 class LReturn: public LTemplateInstruction<0, 1, 0> { | 1060 class LReturn: public LTemplateInstruction<0, 1, 0> { |
1044 public: | 1061 public: |
1045 explicit LReturn(LOperand* value) { | 1062 explicit LReturn(LOperand* value) { |
1046 inputs_[0] = value; | 1063 inputs_[0] = value; |
1047 } | 1064 } |
1048 | 1065 |
1049 DECLARE_CONCRETE_INSTRUCTION(Return, "return") | 1066 DECLARE_CONCRETE_INSTRUCTION(Return, "return") |
1050 }; | 1067 }; |
1051 | 1068 |
1052 | 1069 |
1053 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { | 1070 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { |
1054 public: | 1071 public: |
1055 explicit LLoadNamedField(LOperand* object) { | 1072 explicit LLoadNamedField(LOperand* object) { |
1056 inputs_[0] = object; | 1073 inputs_[0] = object; |
1057 } | 1074 } |
1058 | 1075 |
1059 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") | 1076 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") |
1060 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) | 1077 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) |
1061 | 1078 |
1062 LOperand* object() { return inputs_[0]; } | 1079 LOperand* object() { return inputs_[0]; } |
1063 }; | 1080 }; |
1064 | 1081 |
1065 | 1082 |
1066 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> { | 1083 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 2, 0> { |
1067 public: | 1084 public: |
1068 explicit LLoadNamedFieldPolymorphic(LOperand* object) { | 1085 LLoadNamedFieldPolymorphic(LOperand* context, LOperand* object) { |
1069 inputs_[0] = object; | 1086 inputs_[0] = context; |
| 1087 inputs_[1] = object; |
1070 } | 1088 } |
1071 | 1089 |
1072 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic") | 1090 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field-polymorphic") |
1073 DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic) | 1091 DECLARE_HYDROGEN_ACCESSOR(LoadNamedFieldPolymorphic) |
1074 | 1092 |
1075 LOperand* object() { return inputs_[0]; } | 1093 LOperand* context() { return inputs_[0]; } |
| 1094 LOperand* object() { return inputs_[1]; } |
1076 }; | 1095 }; |
1077 | 1096 |
1078 | 1097 |
1079 class LLoadNamedGeneric: public LTemplateInstruction<1, 2, 0> { | 1098 class LLoadNamedGeneric: public LTemplateInstruction<1, 2, 0> { |
1080 public: | 1099 public: |
1081 LLoadNamedGeneric(LOperand* context, LOperand* object) { | 1100 LLoadNamedGeneric(LOperand* context, LOperand* object) { |
1082 inputs_[0] = context; | 1101 inputs_[0] = context; |
1083 inputs_[1] = object; | 1102 inputs_[1] = object; |
1084 } | 1103 } |
1085 | 1104 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 inputs_[0] = value; | 1227 inputs_[0] = value; |
1209 } | 1228 } |
1210 | 1229 |
1211 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") | 1230 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") |
1212 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) | 1231 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) |
1213 }; | 1232 }; |
1214 | 1233 |
1215 | 1234 |
1216 class LStoreGlobalGeneric: public LTemplateInstruction<0, 3, 0> { | 1235 class LStoreGlobalGeneric: public LTemplateInstruction<0, 3, 0> { |
1217 public: | 1236 public: |
1218 explicit LStoreGlobalGeneric(LOperand* context, | 1237 LStoreGlobalGeneric(LOperand* context, |
1219 LOperand* global_object, | 1238 LOperand* global_object, |
1220 LOperand* value) { | 1239 LOperand* value) { |
1221 inputs_[0] = context; | 1240 inputs_[0] = context; |
1222 inputs_[1] = global_object; | 1241 inputs_[1] = global_object; |
1223 inputs_[2] = value; | 1242 inputs_[2] = value; |
1224 } | 1243 } |
1225 | 1244 |
1226 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") | 1245 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") |
1227 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) | 1246 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) |
1228 | 1247 |
1229 LOperand* context() { return InputAt(0); } | 1248 LOperand* context() { return InputAt(0); } |
1230 LOperand* global_object() { return InputAt(1); } | 1249 LOperand* global_object() { return InputAt(1); } |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1448 DECLARE_HYDROGEN_ACCESSOR(CallNew) | 1467 DECLARE_HYDROGEN_ACCESSOR(CallNew) |
1449 | 1468 |
1450 virtual void PrintDataTo(StringStream* stream); | 1469 virtual void PrintDataTo(StringStream* stream); |
1451 | 1470 |
1452 LOperand* context() { return inputs_[0]; } | 1471 LOperand* context() { return inputs_[0]; } |
1453 LOperand* constructor() { return inputs_[1]; } | 1472 LOperand* constructor() { return inputs_[1]; } |
1454 int arity() const { return hydrogen()->argument_count() - 1; } | 1473 int arity() const { return hydrogen()->argument_count() - 1; } |
1455 }; | 1474 }; |
1456 | 1475 |
1457 | 1476 |
1458 class LCallRuntime: public LTemplateInstruction<1, 0, 0> { | 1477 class LCallRuntime: public LTemplateInstruction<1, 1, 0> { |
1459 public: | 1478 public: |
| 1479 explicit LCallRuntime(LOperand* context) { |
| 1480 inputs_[0] = context; |
| 1481 } |
1460 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") | 1482 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") |
1461 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) | 1483 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) |
1462 | 1484 |
| 1485 LOperand* context() { return inputs_[0]; } |
1463 const Runtime::Function* function() const { return hydrogen()->function(); } | 1486 const Runtime::Function* function() const { return hydrogen()->function(); } |
1464 int arity() const { return hydrogen()->argument_count(); } | 1487 int arity() const { return hydrogen()->argument_count(); } |
1465 }; | 1488 }; |
1466 | 1489 |
1467 | 1490 |
1468 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { | 1491 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { |
1469 public: | 1492 public: |
1470 explicit LInteger32ToDouble(LOperand* value) { | 1493 explicit LInteger32ToDouble(LOperand* value) { |
1471 inputs_[0] = value; | 1494 inputs_[0] = value; |
1472 } | 1495 } |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1669 virtual void PrintDataTo(StringStream* stream); | 1692 virtual void PrintDataTo(StringStream* stream); |
1670 | 1693 |
1671 LOperand* context() { return inputs_[0]; } | 1694 LOperand* context() { return inputs_[0]; } |
1672 LOperand* object() { return inputs_[1]; } | 1695 LOperand* object() { return inputs_[1]; } |
1673 LOperand* key() { return inputs_[2]; } | 1696 LOperand* key() { return inputs_[2]; } |
1674 LOperand* value() { return inputs_[3]; } | 1697 LOperand* value() { return inputs_[3]; } |
1675 bool strict_mode() { return hydrogen()->strict_mode(); } | 1698 bool strict_mode() { return hydrogen()->strict_mode(); } |
1676 }; | 1699 }; |
1677 | 1700 |
1678 | 1701 |
1679 class LStringAdd: public LTemplateInstruction<1, 2, 0> { | 1702 class LStringAdd: public LTemplateInstruction<1, 3, 0> { |
1680 public: | 1703 public: |
1681 LStringAdd(LOperand* left, LOperand* right) { | 1704 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { |
1682 inputs_[0] = left; | 1705 inputs_[0] = context; |
1683 inputs_[1] = right; | 1706 inputs_[1] = left; |
| 1707 inputs_[2] = right; |
1684 } | 1708 } |
1685 | 1709 |
1686 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") | 1710 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") |
1687 DECLARE_HYDROGEN_ACCESSOR(StringAdd) | 1711 DECLARE_HYDROGEN_ACCESSOR(StringAdd) |
1688 | 1712 |
1689 LOperand* left() { return inputs_[0]; } | 1713 LOperand* context() { return inputs_[0]; } |
1690 LOperand* right() { return inputs_[1]; } | 1714 LOperand* left() { return inputs_[1]; } |
| 1715 LOperand* right() { return inputs_[2]; } |
1691 }; | 1716 }; |
1692 | 1717 |
1693 | 1718 |
1694 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { | 1719 class LStringCharCodeAt: public LTemplateInstruction<1, 3, 0> { |
1695 public: | 1720 public: |
1696 LStringCharCodeAt(LOperand* string, LOperand* index) { | 1721 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { |
1697 inputs_[0] = string; | 1722 inputs_[0] = context; |
1698 inputs_[1] = index; | 1723 inputs_[1] = string; |
| 1724 inputs_[2] = index; |
1699 } | 1725 } |
1700 | 1726 |
1701 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") | 1727 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") |
1702 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) | 1728 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) |
1703 | 1729 |
1704 LOperand* string() { return inputs_[0]; } | 1730 LOperand* context() { return inputs_[0]; } |
1705 LOperand* index() { return inputs_[1]; } | 1731 LOperand* string() { return inputs_[1]; } |
| 1732 LOperand* index() { return inputs_[2]; } |
1706 }; | 1733 }; |
1707 | 1734 |
1708 | 1735 |
1709 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> { | 1736 class LStringCharFromCode: public LTemplateInstruction<1, 2, 0> { |
1710 public: | 1737 public: |
1711 explicit LStringCharFromCode(LOperand* char_code) { | 1738 LStringCharFromCode(LOperand* context, LOperand* char_code) { |
1712 inputs_[0] = char_code; | 1739 inputs_[0] = context; |
| 1740 inputs_[1] = char_code; |
1713 } | 1741 } |
1714 | 1742 |
1715 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") | 1743 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") |
1716 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) | 1744 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) |
1717 | 1745 |
1718 LOperand* char_code() { return inputs_[0]; } | 1746 LOperand* context() { return inputs_[0]; } |
| 1747 LOperand* char_code() { return inputs_[1]; } |
1719 }; | 1748 }; |
1720 | 1749 |
1721 | 1750 |
1722 class LStringLength: public LTemplateInstruction<1, 1, 0> { | 1751 class LStringLength: public LTemplateInstruction<1, 1, 0> { |
1723 public: | 1752 public: |
1724 explicit LStringLength(LOperand* string) { | 1753 explicit LStringLength(LOperand* string) { |
1725 inputs_[0] = string; | 1754 inputs_[0] = string; |
1726 } | 1755 } |
1727 | 1756 |
1728 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") | 1757 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { | 1859 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { |
1831 public: | 1860 public: |
1832 explicit LCheckNonSmi(LOperand* value) { | 1861 explicit LCheckNonSmi(LOperand* value) { |
1833 inputs_[0] = value; | 1862 inputs_[0] = value; |
1834 } | 1863 } |
1835 | 1864 |
1836 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") | 1865 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") |
1837 }; | 1866 }; |
1838 | 1867 |
1839 | 1868 |
1840 class LArrayLiteral: public LTemplateInstruction<1, 0, 0> { | 1869 class LArrayLiteral: public LTemplateInstruction<1, 1, 0> { |
1841 public: | 1870 public: |
| 1871 explicit LArrayLiteral(LOperand* context) { |
| 1872 inputs_[0] = context; |
| 1873 } |
| 1874 |
| 1875 LOperand* context() { return inputs_[0]; } |
| 1876 |
1842 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal") | 1877 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal") |
1843 DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral) | 1878 DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral) |
1844 }; | 1879 }; |
1845 | 1880 |
1846 | 1881 |
1847 class LObjectLiteral: public LTemplateInstruction<1, 1, 0> { | 1882 class LObjectLiteral: public LTemplateInstruction<1, 1, 0> { |
1848 public: | 1883 public: |
1849 explicit LObjectLiteral(LOperand* context) { | 1884 explicit LObjectLiteral(LOperand* context) { |
1850 inputs_[0] = context; | 1885 inputs_[0] = context; |
1851 } | 1886 } |
1852 | 1887 |
| 1888 LOperand* context() { return inputs_[0]; } |
| 1889 |
1853 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal") | 1890 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal") |
1854 DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral) | 1891 DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral) |
1855 | |
1856 LOperand* context() { return inputs_[0]; } | |
1857 }; | 1892 }; |
1858 | 1893 |
1859 | 1894 |
1860 class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> { | 1895 class LRegExpLiteral: public LTemplateInstruction<1, 1, 0> { |
1861 public: | 1896 public: |
| 1897 explicit LRegExpLiteral(LOperand* context) { |
| 1898 inputs_[0] = context; |
| 1899 } |
| 1900 |
| 1901 LOperand* context() { return inputs_[0]; } |
| 1902 |
1862 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") | 1903 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") |
1863 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) | 1904 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) |
1864 }; | 1905 }; |
1865 | 1906 |
1866 | 1907 |
1867 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> { | 1908 class LFunctionLiteral: public LTemplateInstruction<1, 1, 0> { |
1868 public: | 1909 public: |
| 1910 explicit LFunctionLiteral(LOperand* context) { |
| 1911 inputs_[0] = context; |
| 1912 } |
| 1913 |
| 1914 LOperand* context() { return inputs_[0]; } |
| 1915 |
1869 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") | 1916 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") |
1870 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) | 1917 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) |
1871 | 1918 |
1872 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } | 1919 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } |
1873 }; | 1920 }; |
1874 | 1921 |
1875 | 1922 |
1876 class LToFastProperties: public LTemplateInstruction<1, 1, 0> { | 1923 class LToFastProperties: public LTemplateInstruction<1, 1, 0> { |
1877 public: | 1924 public: |
1878 explicit LToFastProperties(LOperand* value) { | 1925 explicit LToFastProperties(LOperand* value) { |
1879 inputs_[0] = value; | 1926 inputs_[0] = value; |
1880 } | 1927 } |
1881 | 1928 |
1882 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") | 1929 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") |
1883 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) | 1930 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) |
1884 }; | 1931 }; |
1885 | 1932 |
1886 | 1933 |
1887 class LTypeof: public LTemplateInstruction<1, 1, 0> { | 1934 class LTypeof: public LTemplateInstruction<1, 2, 0> { |
1888 public: | 1935 public: |
1889 explicit LTypeof(LOperand* value) { | 1936 LTypeof(LOperand* context, LOperand* value) { |
1890 inputs_[0] = value; | 1937 inputs_[0] = context; |
| 1938 inputs_[1] = value; |
1891 } | 1939 } |
1892 | 1940 |
1893 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 1941 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") |
1894 }; | 1942 }; |
1895 | 1943 |
1896 | 1944 |
1897 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { | 1945 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { |
1898 public: | 1946 public: |
1899 explicit LTypeofIsAndBranch(LOperand* value) { | 1947 explicit LTypeofIsAndBranch(LOperand* value) { |
1900 inputs_[0] = value; | 1948 inputs_[0] = value; |
1901 } | 1949 } |
1902 | 1950 |
1903 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 1951 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") |
1904 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) | 1952 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) |
1905 | 1953 |
1906 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1954 Handle<String> type_literal() { return hydrogen()->type_literal(); } |
1907 | 1955 |
1908 virtual void PrintDataTo(StringStream* stream); | 1956 virtual void PrintDataTo(StringStream* stream); |
1909 }; | 1957 }; |
1910 | 1958 |
1911 | 1959 |
1912 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { | 1960 class LDeleteProperty: public LTemplateInstruction<1, 3, 0> { |
1913 public: | 1961 public: |
1914 LDeleteProperty(LOperand* obj, LOperand* key) { | 1962 LDeleteProperty(LOperand* context, LOperand* obj, LOperand* key) { |
1915 inputs_[0] = obj; | 1963 inputs_[0] = context; |
1916 inputs_[1] = key; | 1964 inputs_[1] = obj; |
| 1965 inputs_[2] = key; |
1917 } | 1966 } |
1918 | 1967 |
1919 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 1968 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
1920 | 1969 |
1921 LOperand* object() { return inputs_[0]; } | 1970 LOperand* context() { return inputs_[0]; } |
1922 LOperand* key() { return inputs_[1]; } | 1971 LOperand* object() { return inputs_[1]; } |
| 1972 LOperand* key() { return inputs_[2]; } |
1923 }; | 1973 }; |
1924 | 1974 |
1925 | 1975 |
1926 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 1976 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
1927 public: | 1977 public: |
1928 LOsrEntry(); | 1978 LOsrEntry(); |
1929 | 1979 |
1930 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 1980 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
1931 | 1981 |
1932 LOperand** SpilledRegisterArray() { return register_spills_; } | 1982 LOperand** SpilledRegisterArray() { return register_spills_; } |
1933 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 1983 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
1934 | 1984 |
1935 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 1985 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
1936 void MarkSpilledDoubleRegister(int allocation_index, | 1986 void MarkSpilledDoubleRegister(int allocation_index, |
1937 LOperand* spill_operand); | 1987 LOperand* spill_operand); |
1938 | 1988 |
1939 private: | 1989 private: |
1940 // Arrays of spill slot operands for registers with an assigned spill | 1990 // Arrays of spill slot operands for registers with an assigned spill |
1941 // slot, i.e., that must also be restored to the spill slot on OSR entry. | 1991 // slot, i.e., that must also be restored to the spill slot on OSR entry. |
1942 // NULL if the register has no assigned spill slot. Indexed by allocation | 1992 // NULL if the register has no assigned spill slot. Indexed by allocation |
1943 // index. | 1993 // index. |
1944 LOperand* register_spills_[Register::kNumAllocatableRegisters]; | 1994 LOperand* register_spills_[Register::kNumAllocatableRegisters]; |
1945 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; | 1995 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; |
1946 }; | 1996 }; |
1947 | 1997 |
1948 | 1998 |
1949 class LStackCheck: public LTemplateInstruction<0, 0, 0> { | 1999 class LStackCheck: public LTemplateInstruction<0, 1, 0> { |
1950 public: | 2000 public: |
| 2001 explicit LStackCheck(LOperand* context) { |
| 2002 inputs_[0] = context; |
| 2003 } |
| 2004 |
| 2005 LOperand* context() { return inputs_[0]; } |
| 2006 |
1951 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") | 2007 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") |
1952 DECLARE_HYDROGEN_ACCESSOR(StackCheck) | 2008 DECLARE_HYDROGEN_ACCESSOR(StackCheck) |
1953 | 2009 |
1954 Label* done_label() { return &done_label_; } | 2010 Label* done_label() { return &done_label_; } |
1955 | 2011 |
1956 private: | 2012 private: |
1957 Label done_label_; | 2013 Label done_label_; |
1958 }; | 2014 }; |
1959 | 2015 |
1960 | 2016 |
1961 class LIn: public LTemplateInstruction<1, 2, 0> { | 2017 class LIn: public LTemplateInstruction<1, 3, 0> { |
1962 public: | 2018 public: |
1963 LIn(LOperand* key, LOperand* object) { | 2019 LIn(LOperand* context, LOperand* key, LOperand* object) { |
1964 inputs_[0] = key; | 2020 inputs_[0] = context; |
1965 inputs_[1] = object; | 2021 inputs_[1] = key; |
| 2022 inputs_[2] = object; |
1966 } | 2023 } |
1967 | 2024 |
1968 LOperand* key() { return inputs_[0]; } | 2025 LOperand* context() { return inputs_[0]; } |
1969 LOperand* object() { return inputs_[1]; } | 2026 LOperand* key() { return inputs_[1]; } |
| 2027 LOperand* object() { return inputs_[2]; } |
1970 | 2028 |
1971 DECLARE_CONCRETE_INSTRUCTION(In, "in") | 2029 DECLARE_CONCRETE_INSTRUCTION(In, "in") |
1972 }; | 2030 }; |
1973 | 2031 |
1974 | 2032 |
1975 class LChunkBuilder; | 2033 class LChunkBuilder; |
1976 class LChunk: public ZoneObject { | 2034 class LChunk: public ZoneObject { |
1977 public: | 2035 public: |
1978 explicit LChunk(CompilationInfo* info, HGraph* graph) | 2036 LChunk(CompilationInfo* info, HGraph* graph) |
1979 : spill_slot_count_(0), | 2037 : spill_slot_count_(0), |
1980 info_(info), | 2038 info_(info), |
1981 graph_(graph), | 2039 graph_(graph), |
1982 instructions_(32), | 2040 instructions_(32), |
1983 pointer_maps_(8), | 2041 pointer_maps_(8), |
1984 inlined_closures_(1) { } | 2042 inlined_closures_(1) { } |
1985 | 2043 |
1986 void AddInstruction(LInstruction* instruction, HBasicBlock* block); | 2044 void AddInstruction(LInstruction* instruction, HBasicBlock* block); |
1987 LConstantOperand* DefineConstantOperand(HConstant* constant); | 2045 LConstantOperand* DefineConstantOperand(HConstant* constant); |
1988 Handle<Object> LookupLiteral(LConstantOperand* operand) const; | 2046 Handle<Object> LookupLiteral(LConstantOperand* operand) const; |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2193 | 2251 |
2194 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2252 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2195 }; | 2253 }; |
2196 | 2254 |
2197 #undef DECLARE_HYDROGEN_ACCESSOR | 2255 #undef DECLARE_HYDROGEN_ACCESSOR |
2198 #undef DECLARE_CONCRETE_INSTRUCTION | 2256 #undef DECLARE_CONCRETE_INSTRUCTION |
2199 | 2257 |
2200 } } // namespace v8::internal | 2258 } } // namespace v8::internal |
2201 | 2259 |
2202 #endif // V8_IA32_LITHIUM_IA32_H_ | 2260 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |