Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: src/ia32/lithium-ia32.h

Issue 6390003: Introduce a hydrogen value for contexts, support context slot assignment. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Sorted Lithium instructions names. Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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:
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 // LStringCharCodeAt
118 // LBitNotI
119 // LCallNew
120 // LCheckFunction
121 // LCheckPrototypeMaps
122 // LCheckInstanceType
123 // LCheckMap
124 // LCheckSmi
125 // LClassOfTest
126 // LDeleteProperty
127 // LDoubleToI
128 // LFixedArrayLength
129 // LHasCachedArrayIndex
130 // LHasInstanceType
131 // LInteger32ToDouble
132 // LIsNull
133 // LIsObject
134 // LIsSmi
135 // LJSArrayLength
136 // LLoadNamedField
137 // LLoadNamedGeneric
138 // LLoadFunctionPrototype
139 // LNumberTagD
140 // LNumberTagI
141 // LPushArgument
142 // LReturn
143 // LSmiTag
144 // LStoreGlobal
145 // LStringLength
146 // LTaggedToI
147 // LThrow
148 // LTypeof
149 // LTypeofIs
150 // LUnaryMathOperation
151 // LValueOf
152 // LUnknownOSRValue
153
154 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
155 V(ControlInstruction) \ 43 V(ControlInstruction) \
156 V(Constant) \ 44 V(Constant) \
157 V(Call) \ 45 V(Call) \
158 V(StoreKeyed) \ 46 V(StoreKeyed) \
159 V(StoreNamed) \ 47 V(StoreNamed) \
160 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) 48 LITHIUM_CONCRETE_INSTRUCTION_LIST(V)
161 49
162 50
163 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ 51 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \
(...skipping 16 matching lines...) Expand all
180 V(CallKnownGlobal) \ 68 V(CallKnownGlobal) \
181 V(CallNamed) \ 69 V(CallNamed) \
182 V(CallNew) \ 70 V(CallNew) \
183 V(CallRuntime) \ 71 V(CallRuntime) \
184 V(CallStub) \ 72 V(CallStub) \
185 V(CheckFunction) \ 73 V(CheckFunction) \
186 V(CheckInstanceType) \ 74 V(CheckInstanceType) \
187 V(CheckMap) \ 75 V(CheckMap) \
188 V(CheckPrototypeMaps) \ 76 V(CheckPrototypeMaps) \
189 V(CheckSmi) \ 77 V(CheckSmi) \
78 V(ClassOfTest) \
79 V(ClassOfTestAndBranch) \
190 V(CmpID) \ 80 V(CmpID) \
191 V(CmpIDAndBranch) \ 81 V(CmpIDAndBranch) \
192 V(CmpJSObjectEq) \ 82 V(CmpJSObjectEq) \
193 V(CmpJSObjectEqAndBranch) \ 83 V(CmpJSObjectEqAndBranch) \
194 V(CmpMapAndBranch) \ 84 V(CmpMapAndBranch) \
195 V(CmpT) \ 85 V(CmpT) \
196 V(CmpTAndBranch) \ 86 V(CmpTAndBranch) \
197 V(ConstantD) \ 87 V(ConstantD) \
198 V(ConstantI) \ 88 V(ConstantI) \
199 V(ConstantT) \ 89 V(ConstantT) \
90 V(Context) \
200 V(DeleteProperty) \ 91 V(DeleteProperty) \
201 V(Deoptimize) \ 92 V(Deoptimize) \
202 V(DivI) \ 93 V(DivI) \
203 V(DoubleToI) \ 94 V(DoubleToI) \
95 V(FixedArrayLength) \
204 V(FunctionLiteral) \ 96 V(FunctionLiteral) \
205 V(Gap) \ 97 V(Gap) \
206 V(GlobalObject) \ 98 V(GlobalObject) \
207 V(GlobalReceiver) \ 99 V(GlobalReceiver) \
208 V(Goto) \ 100 V(Goto) \
209 V(FixedArrayLength) \ 101 V(HasCachedArrayIndex) \
102 V(HasCachedArrayIndexAndBranch) \
103 V(HasInstanceType) \
104 V(HasInstanceTypeAndBranch) \
210 V(InstanceOf) \ 105 V(InstanceOf) \
211 V(InstanceOfAndBranch) \ 106 V(InstanceOfAndBranch) \
212 V(InstanceOfKnownGlobal) \ 107 V(InstanceOfKnownGlobal) \
213 V(Integer32ToDouble) \ 108 V(Integer32ToDouble) \
214 V(IsNull) \ 109 V(IsNull) \
215 V(IsNullAndBranch) \ 110 V(IsNullAndBranch) \
216 V(IsObject) \ 111 V(IsObject) \
217 V(IsObjectAndBranch) \ 112 V(IsObjectAndBranch) \
218 V(IsSmi) \ 113 V(IsSmi) \
219 V(IsSmiAndBranch) \ 114 V(IsSmiAndBranch) \
220 V(JSArrayLength) \ 115 V(JSArrayLength) \
221 V(HasInstanceType) \
222 V(HasInstanceTypeAndBranch) \
223 V(HasCachedArrayIndex) \
224 V(HasCachedArrayIndexAndBranch) \
225 V(ClassOfTest) \
226 V(ClassOfTestAndBranch) \
227 V(Label) \ 116 V(Label) \
228 V(LazyBailout) \ 117 V(LazyBailout) \
229 V(LoadContextSlot) \ 118 V(LoadContextSlot) \
230 V(LoadElements) \ 119 V(LoadElements) \
120 V(LoadFunctionPrototype) \
231 V(LoadGlobal) \ 121 V(LoadGlobal) \
232 V(LoadKeyedFastElement) \ 122 V(LoadKeyedFastElement) \
233 V(LoadKeyedGeneric) \ 123 V(LoadKeyedGeneric) \
234 V(LoadNamedField) \ 124 V(LoadNamedField) \
235 V(LoadNamedGeneric) \ 125 V(LoadNamedGeneric) \
236 V(LoadFunctionPrototype) \
237 V(ModI) \ 126 V(ModI) \
238 V(MulI) \ 127 V(MulI) \
239 V(NumberTagD) \ 128 V(NumberTagD) \
240 V(NumberTagI) \ 129 V(NumberTagI) \
241 V(NumberUntagD) \ 130 V(NumberUntagD) \
242 V(ObjectLiteral) \ 131 V(ObjectLiteral) \
243 V(OsrEntry) \ 132 V(OsrEntry) \
133 V(OuterContext) \
244 V(Parameter) \ 134 V(Parameter) \
245 V(Power) \ 135 V(Power) \
246 V(PushArgument) \ 136 V(PushArgument) \
247 V(RegExpLiteral) \ 137 V(RegExpLiteral) \
248 V(Return) \ 138 V(Return) \
249 V(ShiftI) \ 139 V(ShiftI) \
250 V(SmiTag) \ 140 V(SmiTag) \
251 V(SmiUntag) \ 141 V(SmiUntag) \
252 V(StackCheck) \ 142 V(StackCheck) \
143 V(StoreContextSlot) \
253 V(StoreGlobal) \ 144 V(StoreGlobal) \
254 V(StoreKeyedFastElement) \ 145 V(StoreKeyedFastElement) \
255 V(StoreKeyedGeneric) \ 146 V(StoreKeyedGeneric) \
256 V(StoreNamedField) \ 147 V(StoreNamedField) \
257 V(StoreNamedGeneric) \ 148 V(StoreNamedGeneric) \
258 V(StringCharCodeAt) \ 149 V(StringCharCodeAt) \
259 V(StringLength) \ 150 V(StringLength) \
260 V(SubI) \ 151 V(SubI) \
261 V(TaggedToI) \ 152 V(TaggedToI) \
262 V(Throw) \ 153 V(Throw) \
(...skipping 1016 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 public: 1170 public:
1280 explicit LStoreGlobal(LOperand* value) { 1171 explicit LStoreGlobal(LOperand* value) {
1281 inputs_[0] = value; 1172 inputs_[0] = value;
1282 } 1173 }
1283 1174
1284 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") 1175 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global")
1285 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) 1176 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal)
1286 }; 1177 };
1287 1178
1288 1179
1289 class LLoadContextSlot: public LTemplateInstruction<1, 0, 0> { 1180 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1290 public: 1181 public:
1182 explicit LLoadContextSlot(LOperand* context) {
1183 inputs_[0] = context;
1184 }
1185
1291 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") 1186 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1292 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) 1187 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1293 1188
1294 int context_chain_length() { return hydrogen()->context_chain_length(); } 1189 LOperand* context() { return InputAt(0); }
1295 int slot_index() { return hydrogen()->slot_index(); } 1190 int slot_index() { return hydrogen()->slot_index(); }
1296 1191
1297 virtual void PrintDataTo(StringStream* stream); 1192 virtual void PrintDataTo(StringStream* stream);
1298 }; 1193 };
1299 1194
1300 1195
1196 class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
1197 public:
1198 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1199 inputs_[0] = context;
1200 inputs_[1] = value;
1201 temps_[0] = temp;
1202 }
1203
1204 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1205 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1206
1207 LOperand* context() { return InputAt(0); }
1208 LOperand* value() { return InputAt(1); }
1209 int slot_index() { return hydrogen()->slot_index(); }
1210 int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1211
1212 virtual void PrintDataTo(StringStream* stream);
1213 };
1214
1215
1301 class LPushArgument: public LTemplateInstruction<0, 1, 0> { 1216 class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1302 public: 1217 public:
1303 explicit LPushArgument(LOperand* value) { 1218 explicit LPushArgument(LOperand* value) {
1304 inputs_[0] = value; 1219 inputs_[0] = value;
1305 } 1220 }
1306 1221
1307 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1222 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1308 }; 1223 };
1309 1224
1310 1225
1311 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { 1226 class LContext: public LTemplateInstruction<1, 0, 0> {
1312 public: 1227 public:
1313 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") 1228 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1314 }; 1229 };
1315 1230
1316 1231
1317 class LGlobalReceiver: public LTemplateInstruction<1, 0, 0> { 1232 class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1318 public: 1233 public:
1319 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1234 explicit LOuterContext(LOperand* context) {
1235 inputs_[0] = context;
1236 }
1237
1238 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1239
1240 LOperand* context() { return InputAt(0); }
1320 }; 1241 };
1321 1242
1322 1243
1244 class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
1245 public:
1246 explicit LGlobalObject(LOperand* context) {
1247 inputs_[0] = context;
1248 }
1249
1250 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1251
1252 LOperand* context() { return InputAt(0); }
1253 };
1254
1255
1256 class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1257 public:
1258 explicit LGlobalReceiver(LOperand* global_object) {
1259 inputs_[0] = global_object;
1260 }
1261
1262 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1263
1264 LOperand* global() { return InputAt(0); }
1265 };
1266
1267
1323 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> { 1268 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1324 public: 1269 public:
1325 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") 1270 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1326 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) 1271 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1327 1272
1328 virtual void PrintDataTo(StringStream* stream); 1273 virtual void PrintDataTo(StringStream* stream);
1329 1274
1330 Handle<JSFunction> function() { return hydrogen()->function(); } 1275 Handle<JSFunction> function() { return hydrogen()->function(); }
1331 int arity() const { return hydrogen()->argument_count() - 1; } 1276 int arity() const { return hydrogen()->argument_count() - 1; }
1332 }; 1277 };
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
2021 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 1966 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2022 }; 1967 };
2023 1968
2024 #undef DECLARE_HYDROGEN_ACCESSOR 1969 #undef DECLARE_HYDROGEN_ACCESSOR
2025 #undef DECLARE_INSTRUCTION 1970 #undef DECLARE_INSTRUCTION
2026 #undef DECLARE_CONCRETE_INSTRUCTION 1971 #undef DECLARE_CONCRETE_INSTRUCTION
2027 1972
2028 } } // namespace v8::internal 1973 } } // namespace v8::internal
2029 1974
2030 #endif // V8_IA32_LITHIUM_IA32_H_ 1975 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698