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 21 matching lines...) Expand all Loading... | |
32 #include "lithium-allocator.h" | 32 #include "lithium-allocator.h" |
33 #include "lithium.h" | 33 #include "lithium.h" |
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 | |
43 // Type hierarchy: | |
Kevin Millikin (Chromium)
2011/02/08 10:34:44
Yay!
| |
44 // | |
45 // LInstruction | |
46 // LTemplateInstruction | |
47 // LControlInstruction | |
48 // LBranch | |
49 // LClassOfTestAndBranch | |
50 // LCmpJSObjectEqAndBranch | |
51 // LCmpIDAndBranch | |
52 // LHasCachedArrayIndexAndBranch | |
53 // LHasInstanceTypeAndBranch | |
54 // LInstanceOfAndBranch | |
55 // LIsNullAndBranch | |
56 // LIsObjectAndBranch | |
57 // LIsSmiAndBranch | |
58 // LTypeofIsAndBranch | |
59 // LAccessArgumentsAt | |
60 // LArgumentsElements | |
61 // LArgumentsLength | |
62 // LAddI | |
63 // LApplyArguments | |
64 // LArithmeticD | |
65 // LArithmeticT | |
66 // LBitI | |
67 // LBoundsCheck | |
68 // LCmpID | |
69 // LCmpJSObjectEq | |
70 // LCmpT | |
71 // LDivI | |
72 // LInstanceOf | |
73 // LInstanceOfKnownGlobal | |
74 // LLoadKeyedFastElement | |
75 // LLoadKeyedGeneric | |
76 // LModI | |
77 // LMulI | |
78 // LPower | |
79 // LShiftI | |
80 // LSubI | |
81 // LCallConstantFunction | |
82 // LCallFunction | |
83 // LCallGlobal | |
84 // LCallKeyed | |
85 // LCallKnownGlobal | |
86 // LCallNamed | |
87 // LCallRuntime | |
88 // LCallStub | |
89 // LConstant | |
90 // LConstantD | |
91 // LConstantI | |
92 // LConstantT | |
93 // LDeoptimize | |
94 // LFunctionLiteral | |
95 // LGap | |
96 // LLabel | |
97 // LGlobalObject | |
98 // LGlobalReceiver | |
99 // LGoto | |
100 // LLazyBailout | |
101 // LLoadGlobal | |
102 // LCheckPrototypeMaps | |
103 // LLoadContextSlot | |
104 // LArrayLiteral | |
105 // LObjectLiteral | |
106 // LRegExpLiteral | |
107 // LOsrEntry | |
108 // LParameter | |
109 // LRegExpConstructResult | |
110 // LStackCheck | |
111 // LStoreKeyed | |
112 // LStoreKeyedFastElement | |
113 // LStoreKeyedGeneric | |
114 // LStoreNamed | |
115 // LStoreNamedField | |
116 // LStoreNamedGeneric | |
117 // LBitNotI | |
118 // LCallNew | |
119 // LCheckFunction | |
120 // LCheckPrototypeMaps | |
121 // LCheckInstanceType | |
122 // LCheckMap | |
123 // LCheckSmi | |
124 // LClassOfTest | |
125 // LDeleteProperty | |
126 // LDoubleToI | |
127 // LFixedArrayLength | |
128 // LHasCachedArrayIndex | |
129 // LHasInstanceType | |
130 // LInteger32ToDouble | |
131 // LIsNull | |
132 // LIsObject | |
133 // LIsSmi | |
134 // LJSArrayLength | |
135 // LLoadNamedField | |
136 // LLoadNamedGeneric | |
137 // LLoadFunctionPrototype | |
138 // LNumberTagD | |
139 // LNumberTagI | |
140 // LPushArgument | |
141 // LReturn | |
142 // LSmiTag | |
143 // LStoreGlobal | |
144 // LTaggedToI | |
145 // LThrow | |
146 // LTypeof | |
147 // LTypeofIs | |
148 // LUnaryMathOperation | |
149 // LValueOf | |
150 // LUnknownOSRValue | |
151 | |
152 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ |
153 V(ControlInstruction) \ | 43 V(ControlInstruction) \ |
154 V(Constant) \ | |
155 V(Call) \ | 44 V(Call) \ |
156 V(StoreKeyed) \ | 45 V(StoreKeyed) \ |
157 V(StoreNamed) \ | 46 V(StoreNamed) \ |
158 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 47 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) |
159 | 48 |
160 | 49 |
161 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 50 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ |
162 V(AccessArgumentsAt) \ | 51 V(AccessArgumentsAt) \ |
163 V(AddI) \ | 52 V(AddI) \ |
164 V(ApplyArguments) \ | 53 V(ApplyArguments) \ |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1006 LSubI(LOperand* left, LOperand* right) { | 895 LSubI(LOperand* left, LOperand* right) { |
1007 inputs_[0] = left; | 896 inputs_[0] = left; |
1008 inputs_[1] = right; | 897 inputs_[1] = right; |
1009 } | 898 } |
1010 | 899 |
1011 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") | 900 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") |
1012 DECLARE_HYDROGEN_ACCESSOR(Sub) | 901 DECLARE_HYDROGEN_ACCESSOR(Sub) |
1013 }; | 902 }; |
1014 | 903 |
1015 | 904 |
1016 template <int temp_count> | 905 class LConstantI: public LTemplateInstruction<1, 0, 0> { |
1017 class LConstant: public LTemplateInstruction<1, 0, temp_count> { | 906 public: |
1018 DECLARE_INSTRUCTION(Constant) | 907 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") |
908 DECLARE_HYDROGEN_ACCESSOR(Constant) | |
909 | |
910 int32_t value() const { return hydrogen()->Integer32Value(); } | |
1019 }; | 911 }; |
1020 | 912 |
1021 | 913 |
1022 class LConstantI: public LConstant<0> { | 914 class LConstantD: public LTemplateInstruction<1, 0, 1> { |
1023 public: | 915 public: |
1024 explicit LConstantI(int32_t value) : value_(value) { } | 916 explicit LConstantD(LOperand* temp) { |
1025 int32_t value() const { return value_; } | 917 temps_[0] = temp; |
918 } | |
919 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | |
920 DECLARE_HYDROGEN_ACCESSOR(Constant) | |
1026 | 921 |
1027 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") | 922 double value() const { return hydrogen()->DoubleValue(); } |
1028 | |
1029 private: | |
1030 int32_t value_; | |
1031 }; | 923 }; |
1032 | 924 |
1033 | 925 |
1034 class LConstantD: public LConstant<1> { | 926 class LConstantT: public LTemplateInstruction<1, 0, 0> { |
1035 public: | 927 public: |
1036 explicit LConstantD(double value, LOperand* temp) : value_(value) { | 928 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") |
1037 temps_[0] = temp; | 929 DECLARE_HYDROGEN_ACCESSOR(Constant) |
1038 } | |
1039 double value() const { return value_; } | |
1040 | 930 |
1041 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") | 931 Handle<Object> value() const { return hydrogen()->handle(); } |
1042 | |
1043 private: | |
1044 double value_; | |
1045 }; | 932 }; |
1046 | 933 |
1047 | 934 |
1048 class LConstantT: public LConstant<0> { | |
1049 public: | |
1050 explicit LConstantT(Handle<Object> value) : value_(value) { } | |
1051 Handle<Object> value() const { return value_; } | |
1052 | |
1053 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | |
1054 | |
1055 private: | |
1056 Handle<Object> value_; | |
1057 }; | |
1058 | |
1059 | |
1060 class LBranch: public LControlInstruction<1, 0> { | 935 class LBranch: public LControlInstruction<1, 0> { |
1061 public: | 936 public: |
1062 explicit LBranch(LOperand* value) { | 937 explicit LBranch(LOperand* value) { |
1063 inputs_[0] = value; | 938 inputs_[0] = value; |
1064 } | 939 } |
1065 | 940 |
1066 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 941 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") |
1067 DECLARE_HYDROGEN_ACCESSOR(Value) | 942 DECLARE_HYDROGEN_ACCESSOR(Value) |
1068 | 943 |
1069 virtual void PrintDataTo(StringStream* stream); | 944 virtual void PrintDataTo(StringStream* stream); |
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2022 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 1897 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2023 }; | 1898 }; |
2024 | 1899 |
2025 #undef DECLARE_HYDROGEN_ACCESSOR | 1900 #undef DECLARE_HYDROGEN_ACCESSOR |
2026 #undef DECLARE_INSTRUCTION | 1901 #undef DECLARE_INSTRUCTION |
2027 #undef DECLARE_CONCRETE_INSTRUCTION | 1902 #undef DECLARE_CONCRETE_INSTRUCTION |
2028 | 1903 |
2029 } } // namespace v8::int | 1904 } } // namespace v8::int |
2030 | 1905 |
2031 #endif // V8_X64_LITHIUM_X64_H_ | 1906 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |