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 23 matching lines...) Expand all Loading... |
34 #include "safepoint-table.h" | 34 #include "safepoint-table.h" |
35 | 35 |
36 namespace v8 { | 36 namespace v8 { |
37 namespace internal { | 37 namespace internal { |
38 | 38 |
39 // Forward declarations. | 39 // Forward declarations. |
40 class LCodeGen; | 40 class LCodeGen; |
41 | 41 |
42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
43 V(ControlInstruction) \ | 43 V(ControlInstruction) \ |
44 V(Constant) \ | |
45 V(Call) \ | 44 V(Call) \ |
46 V(StoreKeyed) \ | 45 V(StoreKeyed) \ |
47 V(StoreNamed) \ | 46 V(StoreNamed) \ |
48 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 47 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) |
49 | 48 |
50 | 49 |
51 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 50 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
52 V(AccessArgumentsAt) \ | 51 V(AccessArgumentsAt) \ |
53 V(AddI) \ | 52 V(AddI) \ |
54 V(ApplyArguments) \ | 53 V(ApplyArguments) \ |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 V(InstanceOf) \ | 104 V(InstanceOf) \ |
106 V(InstanceOfAndBranch) \ | 105 V(InstanceOfAndBranch) \ |
107 V(InstanceOfKnownGlobal) \ | 106 V(InstanceOfKnownGlobal) \ |
108 V(Integer32ToDouble) \ | 107 V(Integer32ToDouble) \ |
109 V(IsNull) \ | 108 V(IsNull) \ |
110 V(IsNullAndBranch) \ | 109 V(IsNullAndBranch) \ |
111 V(IsObject) \ | 110 V(IsObject) \ |
112 V(IsObjectAndBranch) \ | 111 V(IsObjectAndBranch) \ |
113 V(IsSmi) \ | 112 V(IsSmi) \ |
114 V(IsSmiAndBranch) \ | 113 V(IsSmiAndBranch) \ |
| 114 V(IsConstructCall) \ |
| 115 V(IsConstructCallAndBranch) \ |
115 V(JSArrayLength) \ | 116 V(JSArrayLength) \ |
116 V(Label) \ | 117 V(Label) \ |
117 V(LazyBailout) \ | 118 V(LazyBailout) \ |
118 V(LoadContextSlot) \ | 119 V(LoadContextSlot) \ |
119 V(LoadElements) \ | 120 V(LoadElements) \ |
120 V(LoadFunctionPrototype) \ | 121 V(LoadFunctionPrototype) \ |
121 V(LoadGlobal) \ | 122 V(LoadGlobal) \ |
122 V(LoadKeyedFastElement) \ | 123 V(LoadKeyedFastElement) \ |
123 V(LoadKeyedGeneric) \ | 124 V(LoadKeyedGeneric) \ |
124 V(LoadNamedField) \ | 125 V(LoadNamedField) \ |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
748 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { | 749 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { |
749 inputs_[0] = value; | 750 inputs_[0] = value; |
750 } | 751 } |
751 | 752 |
752 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 753 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, |
753 "has-cached-array-index-and-branch") | 754 "has-cached-array-index-and-branch") |
754 virtual void PrintDataTo(StringStream* stream); | 755 virtual void PrintDataTo(StringStream* stream); |
755 }; | 756 }; |
756 | 757 |
757 | 758 |
| 759 class LIsConstructCall: public LTemplateInstruction<1, 0, 0> { |
| 760 public: |
| 761 DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call") |
| 762 DECLARE_HYDROGEN_ACCESSOR(IsConstructCall) |
| 763 }; |
| 764 |
| 765 |
| 766 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { |
| 767 public: |
| 768 explicit LIsConstructCallAndBranch(LOperand* temp) { |
| 769 temps_[0] = temp; |
| 770 } |
| 771 |
| 772 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, |
| 773 "is-construct-call-and-branch") |
| 774 }; |
| 775 |
| 776 |
758 class LClassOfTest: public LTemplateInstruction<1, 1, 1> { | 777 class LClassOfTest: public LTemplateInstruction<1, 1, 1> { |
759 public: | 778 public: |
760 LClassOfTest(LOperand* value, LOperand* temp) { | 779 LClassOfTest(LOperand* value, LOperand* temp) { |
761 inputs_[0] = value; | 780 inputs_[0] = value; |
762 temps_[0] = temp; | 781 temps_[0] = temp; |
763 } | 782 } |
764 | 783 |
765 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") | 784 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") |
766 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | 785 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) |
767 | 786 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 LSubI(LOperand* left, LOperand* right) { | 925 LSubI(LOperand* left, LOperand* right) { |
907 inputs_[0] = left; | 926 inputs_[0] = left; |
908 inputs_[1] = right; | 927 inputs_[1] = right; |
909 } | 928 } |
910 | 929 |
911 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") | 930 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") |
912 DECLARE_HYDROGEN_ACCESSOR(Sub) | 931 DECLARE_HYDROGEN_ACCESSOR(Sub) |
913 }; | 932 }; |
914 | 933 |
915 | 934 |
916 class LConstant: public LTemplateInstruction<1, 0, 0> { | 935 class LConstantI: public LTemplateInstruction<1, 0, 0> { |
917 DECLARE_INSTRUCTION(Constant) | 936 public: |
| 937 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") |
| 938 DECLARE_HYDROGEN_ACCESSOR(Constant) |
| 939 |
| 940 int32_t value() const { return hydrogen()->Integer32Value(); } |
918 }; | 941 }; |
919 | 942 |
920 | 943 |
921 class LConstantI: public LConstant { | 944 class LConstantD: public LTemplateInstruction<1, 0, 1> { |
922 public: | 945 public: |
923 explicit LConstantI(int32_t value) : value_(value) { } | 946 explicit LConstantD(LOperand* temp) { |
924 int32_t value() const { return value_; } | 947 temps_[0] = temp; |
| 948 } |
925 | 949 |
926 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") | 950 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") |
| 951 DECLARE_HYDROGEN_ACCESSOR(Constant) |
927 | 952 |
928 private: | 953 double value() const { return hydrogen()->DoubleValue(); } |
929 int32_t value_; | |
930 }; | 954 }; |
931 | 955 |
932 | 956 |
933 class LConstantD: public LConstant { | 957 class LConstantT: public LTemplateInstruction<1, 0, 0> { |
934 public: | 958 public: |
935 explicit LConstantD(double value) : value_(value) { } | 959 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
936 double value() const { return value_; } | 960 DECLARE_HYDROGEN_ACCESSOR(Constant) |
937 | 961 |
938 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 962 Handle<Object> value() const { return hydrogen()->handle(); } |
939 | |
940 private: | |
941 double value_; | |
942 }; | 963 }; |
943 | 964 |
944 | 965 |
945 class LConstantT: public LConstant { | |
946 public: | |
947 explicit LConstantT(Handle<Object> value) : value_(value) { } | |
948 Handle<Object> value() const { return value_; } | |
949 | |
950 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | |
951 | |
952 private: | |
953 Handle<Object> value_; | |
954 }; | |
955 | |
956 | |
957 class LBranch: public LControlInstruction<1, 0> { | 966 class LBranch: public LControlInstruction<1, 0> { |
958 public: | 967 public: |
959 explicit LBranch(LOperand* value) { | 968 explicit LBranch(LOperand* value) { |
960 inputs_[0] = value; | 969 inputs_[0] = value; |
961 } | 970 } |
962 | 971 |
963 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 972 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
964 DECLARE_HYDROGEN_ACCESSOR(Value) | 973 DECLARE_HYDROGEN_ACCESSOR(Value) |
965 | 974 |
966 virtual void PrintDataTo(StringStream* stream); | 975 virtual void PrintDataTo(StringStream* stream); |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2006 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
1998 }; | 2007 }; |
1999 | 2008 |
2000 #undef DECLARE_HYDROGEN_ACCESSOR | 2009 #undef DECLARE_HYDROGEN_ACCESSOR |
2001 #undef DECLARE_INSTRUCTION | 2010 #undef DECLARE_INSTRUCTION |
2002 #undef DECLARE_CONCRETE_INSTRUCTION | 2011 #undef DECLARE_CONCRETE_INSTRUCTION |
2003 | 2012 |
2004 } } // namespace v8::internal | 2013 } } // namespace v8::internal |
2005 | 2014 |
2006 #endif // V8_IA32_LITHIUM_IA32_H_ | 2015 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |