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

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

Issue 6529032: Merge 6168:6800 from bleeding_edge to experimental/gc branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: 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
« no previous file with comments | « src/ia32/lithium-gap-resolver-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 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
11 // with the distribution. 11 // with the distribution.
(...skipping 11 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_IA32_LITHIUM_IA32_H_ 28 #ifndef V8_IA32_LITHIUM_IA32_H_
29 #define V8_IA32_LITHIUM_IA32_H_ 29 #define V8_IA32_LITHIUM_IA32_H_
30 30
31 #include "hydrogen.h" 31 #include "hydrogen.h"
32 #include "lithium-allocator.h" 32 #include "lithium-allocator.h"
33 #include "lithium.h"
33 #include "safepoint-table.h" 34 #include "safepoint-table.h"
34 35
35 namespace v8 { 36 namespace v8 {
36 namespace internal { 37 namespace internal {
37 38
38 // Forward declarations. 39 // Forward declarations.
39 class LCodeGen; 40 class LCodeGen;
40 class LEnvironment;
41 class Translation;
42 class LGapNode;
43
44
45 // Type hierarchy:
46 //
47 // LInstruction
48 // LAccessArgumentsAt
49 // LArgumentsElements
50 // LArgumentsLength
51 // LBinaryOperation
52 // LAddI
53 // LApplyArguments
54 // LArithmeticD
55 // LArithmeticT
56 // LBitI
57 // LBoundsCheck
58 // LCmpID
59 // LCmpIDAndBranch
60 // LCmpJSObjectEq
61 // LCmpJSObjectEqAndBranch
62 // LCmpT
63 // LDivI
64 // LInstanceOf
65 // LInstanceOfAndBranch
66 // LLoadKeyedFastElement
67 // LLoadKeyedGeneric
68 // LModI
69 // LMulI
70 // LPower
71 // LShiftI
72 // LSubI
73 // LCallConstantFunction
74 // LCallFunction
75 // LCallGlobal
76 // LCallKeyed
77 // LCallKnownGlobal
78 // LCallNamed
79 // LCallRuntime
80 // LCallStub
81 // LConstant
82 // LConstantD
83 // LConstantI
84 // LConstantT
85 // LDeoptimize
86 // LFunctionLiteral
87 // LGlobalObject
88 // LGlobalReceiver
89 // LLabel
90 // LLayzBailout
91 // LLoadGlobal
92 // LMaterializedLiteral
93 // LArrayLiteral
94 // LObjectLiteral
95 // LRegExpLiteral
96 // LOsrEntry
97 // LParameter
98 // LRegExpConstructResult
99 // LStackCheck
100 // LStoreKeyed
101 // LStoreKeyedFastElement
102 // LStoreKeyedGeneric
103 // LStoreNamed
104 // LStoreNamedField
105 // LStoreNamedGeneric
106 // LUnaryOperation
107 // LBitNotI
108 // LBranch
109 // LCallNew
110 // LCheckFunction
111 // LCheckInstanceType
112 // LCheckMap
113 // LCheckPrototypeMaps
114 // LCheckSmi
115 // LClassOfTest
116 // LClassOfTestAndBranch
117 // LDeleteProperty
118 // LDoubleToI
119 // LFixedArrayLength
120 // LHasCachedArrayIndex
121 // LHasCachedArrayIndexAndBranch
122 // LHasInstanceType
123 // LHasInstanceTypeAndBranch
124 // LInteger32ToDouble
125 // LIsNull
126 // LIsNullAndBranch
127 // LIsObject
128 // LIsObjectAndBranch
129 // LIsSmi
130 // LIsSmiAndBranch
131 // LJSArrayLength
132 // LLoadNamedField
133 // LLoadNamedGeneric
134 // LLoadFunctionPrototype
135 // LNumberTagD
136 // LNumberTagI
137 // LPushArgument
138 // LReturn
139 // LSmiTag
140 // LStoreGlobal
141 // LTaggedToI
142 // LThrow
143 // LTypeof
144 // LTypeofIs
145 // LTypeofIsAndBranch
146 // LUnaryMathOperation
147 // LValueOf
148 // LUnknownOSRValue
149 41
150 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ 42 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \
151 V(BinaryOperation) \ 43 V(ControlInstruction) \
152 V(Constant) \
153 V(Call) \ 44 V(Call) \
154 V(MaterializedLiteral) \
155 V(StoreKeyed) \ 45 V(StoreKeyed) \
156 V(StoreNamed) \ 46 V(StoreNamed) \
157 V(UnaryOperation) \
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) \
165 V(ArgumentsElements) \ 54 V(ArgumentsElements) \
166 V(ArgumentsLength) \ 55 V(ArgumentsLength) \
167 V(ArithmeticD) \ 56 V(ArithmeticD) \
(...skipping 10 matching lines...) Expand all
178 V(CallKnownGlobal) \ 67 V(CallKnownGlobal) \
179 V(CallNamed) \ 68 V(CallNamed) \
180 V(CallNew) \ 69 V(CallNew) \
181 V(CallRuntime) \ 70 V(CallRuntime) \
182 V(CallStub) \ 71 V(CallStub) \
183 V(CheckFunction) \ 72 V(CheckFunction) \
184 V(CheckInstanceType) \ 73 V(CheckInstanceType) \
185 V(CheckMap) \ 74 V(CheckMap) \
186 V(CheckPrototypeMaps) \ 75 V(CheckPrototypeMaps) \
187 V(CheckSmi) \ 76 V(CheckSmi) \
77 V(ClassOfTest) \
78 V(ClassOfTestAndBranch) \
188 V(CmpID) \ 79 V(CmpID) \
189 V(CmpIDAndBranch) \ 80 V(CmpIDAndBranch) \
190 V(CmpJSObjectEq) \ 81 V(CmpJSObjectEq) \
191 V(CmpJSObjectEqAndBranch) \ 82 V(CmpJSObjectEqAndBranch) \
192 V(CmpMapAndBranch) \ 83 V(CmpMapAndBranch) \
193 V(CmpT) \ 84 V(CmpT) \
194 V(CmpTAndBranch) \ 85 V(CmpTAndBranch) \
195 V(ConstantD) \ 86 V(ConstantD) \
196 V(ConstantI) \ 87 V(ConstantI) \
197 V(ConstantT) \ 88 V(ConstantT) \
89 V(Context) \
198 V(DeleteProperty) \ 90 V(DeleteProperty) \
199 V(Deoptimize) \ 91 V(Deoptimize) \
200 V(DivI) \ 92 V(DivI) \
201 V(DoubleToI) \ 93 V(DoubleToI) \
94 V(FixedArrayLength) \
202 V(FunctionLiteral) \ 95 V(FunctionLiteral) \
203 V(Gap) \ 96 V(Gap) \
204 V(GlobalObject) \ 97 V(GlobalObject) \
205 V(GlobalReceiver) \ 98 V(GlobalReceiver) \
206 V(Goto) \ 99 V(Goto) \
207 V(FixedArrayLength) \ 100 V(HasCachedArrayIndex) \
101 V(HasCachedArrayIndexAndBranch) \
102 V(HasInstanceType) \
103 V(HasInstanceTypeAndBranch) \
208 V(InstanceOf) \ 104 V(InstanceOf) \
209 V(InstanceOfAndBranch) \ 105 V(InstanceOfAndBranch) \
106 V(InstanceOfKnownGlobal) \
210 V(Integer32ToDouble) \ 107 V(Integer32ToDouble) \
211 V(IsNull) \ 108 V(IsNull) \
212 V(IsNullAndBranch) \ 109 V(IsNullAndBranch) \
213 V(IsObject) \ 110 V(IsObject) \
214 V(IsObjectAndBranch) \ 111 V(IsObjectAndBranch) \
215 V(IsSmi) \ 112 V(IsSmi) \
216 V(IsSmiAndBranch) \ 113 V(IsSmiAndBranch) \
114 V(IsConstructCall) \
115 V(IsConstructCallAndBranch) \
217 V(JSArrayLength) \ 116 V(JSArrayLength) \
218 V(HasInstanceType) \
219 V(HasInstanceTypeAndBranch) \
220 V(HasCachedArrayIndex) \
221 V(HasCachedArrayIndexAndBranch) \
222 V(ClassOfTest) \
223 V(ClassOfTestAndBranch) \
224 V(Label) \ 117 V(Label) \
225 V(LazyBailout) \ 118 V(LazyBailout) \
119 V(LoadContextSlot) \
226 V(LoadElements) \ 120 V(LoadElements) \
121 V(LoadFunctionPrototype) \
227 V(LoadGlobal) \ 122 V(LoadGlobal) \
228 V(LoadKeyedFastElement) \ 123 V(LoadKeyedFastElement) \
229 V(LoadKeyedGeneric) \ 124 V(LoadKeyedGeneric) \
230 V(LoadNamedField) \ 125 V(LoadNamedField) \
231 V(LoadNamedGeneric) \ 126 V(LoadNamedGeneric) \
232 V(LoadFunctionPrototype) \ 127 V(LoadPixelArrayElement) \
128 V(LoadPixelArrayExternalPointer) \
233 V(ModI) \ 129 V(ModI) \
234 V(MulI) \ 130 V(MulI) \
235 V(NumberTagD) \ 131 V(NumberTagD) \
236 V(NumberTagI) \ 132 V(NumberTagI) \
237 V(NumberUntagD) \ 133 V(NumberUntagD) \
238 V(ObjectLiteral) \ 134 V(ObjectLiteral) \
239 V(OsrEntry) \ 135 V(OsrEntry) \
136 V(OuterContext) \
240 V(Parameter) \ 137 V(Parameter) \
138 V(PixelArrayLength) \
241 V(Power) \ 139 V(Power) \
242 V(PushArgument) \ 140 V(PushArgument) \
243 V(RegExpLiteral) \ 141 V(RegExpLiteral) \
244 V(Return) \ 142 V(Return) \
245 V(ShiftI) \ 143 V(ShiftI) \
246 V(SmiTag) \ 144 V(SmiTag) \
247 V(SmiUntag) \ 145 V(SmiUntag) \
248 V(StackCheck) \ 146 V(StackCheck) \
147 V(StoreContextSlot) \
249 V(StoreGlobal) \ 148 V(StoreGlobal) \
250 V(StoreKeyedFastElement) \ 149 V(StoreKeyedFastElement) \
251 V(StoreKeyedGeneric) \ 150 V(StoreKeyedGeneric) \
252 V(StoreNamedField) \ 151 V(StoreNamedField) \
253 V(StoreNamedGeneric) \ 152 V(StoreNamedGeneric) \
153 V(StringCharCodeAt) \
154 V(StringLength) \
254 V(SubI) \ 155 V(SubI) \
255 V(TaggedToI) \ 156 V(TaggedToI) \
256 V(Throw) \ 157 V(Throw) \
257 V(Typeof) \ 158 V(Typeof) \
258 V(TypeofIs) \ 159 V(TypeofIs) \
259 V(TypeofIsAndBranch) \ 160 V(TypeofIsAndBranch) \
260 V(UnaryMathOperation) \ 161 V(UnaryMathOperation) \
261 V(UnknownOSRValue) \ 162 V(UnknownOSRValue) \
262 V(ValueOf) 163 V(ValueOf)
263 164
(...skipping 14 matching lines...) Expand all
278 179
279 #define DECLARE_HYDROGEN_ACCESSOR(type) \ 180 #define DECLARE_HYDROGEN_ACCESSOR(type) \
280 H##type* hydrogen() const { \ 181 H##type* hydrogen() const { \
281 return H##type::cast(hydrogen_value()); \ 182 return H##type::cast(hydrogen_value()); \
282 } 183 }
283 184
284 185
285 class LInstruction: public ZoneObject { 186 class LInstruction: public ZoneObject {
286 public: 187 public:
287 LInstruction() 188 LInstruction()
288 : hydrogen_value_(NULL) { } 189 : environment_(NULL),
190 hydrogen_value_(NULL),
191 is_call_(false),
192 is_save_doubles_(false) { }
289 virtual ~LInstruction() { } 193 virtual ~LInstruction() { }
290 194
291 virtual void CompileToNative(LCodeGen* generator) = 0; 195 virtual void CompileToNative(LCodeGen* generator) = 0;
292 virtual const char* Mnemonic() const = 0; 196 virtual const char* Mnemonic() const = 0;
293 virtual void PrintTo(StringStream* stream) const; 197 virtual void PrintTo(StringStream* stream);
294 virtual void PrintDataTo(StringStream* stream) const { } 198 virtual void PrintDataTo(StringStream* stream) = 0;
199 virtual void PrintOutputOperandTo(StringStream* stream) = 0;
295 200
296 // Declare virtual type testers. 201 // Declare virtual type testers.
297 #define DECLARE_DO(type) virtual bool Is##type() const { return false; } 202 #define DECLARE_DO(type) virtual bool Is##type() const { return false; }
298 LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO) 203 LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO)
299 #undef DECLARE_DO 204 #undef DECLARE_DO
205
300 virtual bool IsControl() const { return false; } 206 virtual bool IsControl() const { return false; }
207 virtual void SetBranchTargets(int true_block_id, int false_block_id) { }
301 208
302 void set_environment(LEnvironment* env) { environment_.set(env); } 209 void set_environment(LEnvironment* env) { environment_ = env; }
303 LEnvironment* environment() const { return environment_.get(); } 210 LEnvironment* environment() const { return environment_; }
304 bool HasEnvironment() const { return environment_.is_set(); } 211 bool HasEnvironment() const { return environment_ != NULL; }
305 212
306 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } 213 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); }
307 LPointerMap* pointer_map() const { return pointer_map_.get(); } 214 LPointerMap* pointer_map() const { return pointer_map_.get(); }
308 bool HasPointerMap() const { return pointer_map_.is_set(); } 215 bool HasPointerMap() const { return pointer_map_.is_set(); }
309 216
310 void set_result(LOperand* operand) { result_.set(operand); }
311 LOperand* result() const { return result_.get(); }
312 bool HasResult() const { return result_.is_set(); }
313 217
314 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; } 218 void set_hydrogen_value(HValue* value) { hydrogen_value_ = value; }
315 HValue* hydrogen_value() const { return hydrogen_value_; } 219 HValue* hydrogen_value() const { return hydrogen_value_; }
316 220
317 void set_deoptimization_environment(LEnvironment* env) { 221 void set_deoptimization_environment(LEnvironment* env) {
318 deoptimization_environment_.set(env); 222 deoptimization_environment_.set(env);
319 } 223 }
320 LEnvironment* deoptimization_environment() const { 224 LEnvironment* deoptimization_environment() const {
321 return deoptimization_environment_.get(); 225 return deoptimization_environment_.get();
322 } 226 }
323 bool HasDeoptimizationEnvironment() const { 227 bool HasDeoptimizationEnvironment() const {
324 return deoptimization_environment_.is_set(); 228 return deoptimization_environment_.is_set();
325 } 229 }
326 230
231 void MarkAsCall() { is_call_ = true; }
232 void MarkAsSaveDoubles() { is_save_doubles_ = true; }
233
234 // Interface to the register allocator and iterators.
235 bool IsMarkedAsCall() const { return is_call_; }
236 bool IsMarkedAsSaveDoubles() const { return is_save_doubles_; }
237
238 virtual bool HasResult() const = 0;
239 virtual LOperand* result() = 0;
240
241 virtual int InputCount() = 0;
242 virtual LOperand* InputAt(int i) = 0;
243 virtual int TempCount() = 0;
244 virtual LOperand* TempAt(int i) = 0;
245
246 LOperand* FirstInput() { return InputAt(0); }
247 LOperand* Output() { return HasResult() ? result() : NULL; }
248
249 #ifdef DEBUG
250 void VerifyCall();
251 #endif
252
327 private: 253 private:
328 SetOncePointer<LEnvironment> environment_; 254 LEnvironment* environment_;
329 SetOncePointer<LPointerMap> pointer_map_; 255 SetOncePointer<LPointerMap> pointer_map_;
330 SetOncePointer<LOperand> result_;
331 HValue* hydrogen_value_; 256 HValue* hydrogen_value_;
332 SetOncePointer<LEnvironment> deoptimization_environment_; 257 SetOncePointer<LEnvironment> deoptimization_environment_;
258 bool is_call_;
259 bool is_save_doubles_;
333 }; 260 };
334 261
335 262
336 class LGapResolver BASE_EMBEDDED { 263 template<typename ElementType, int NumElements>
264 class OperandContainer {
337 public: 265 public:
338 LGapResolver(const ZoneList<LMoveOperands>* moves, LOperand* marker_operand); 266 OperandContainer() {
339 const ZoneList<LMoveOperands>* ResolveInReverseOrder(); 267 for (int i = 0; i < NumElements; i++) elems_[i] = NULL;
268 }
269 int length() { return NumElements; }
270 ElementType& operator[](int i) {
271 ASSERT(i < length());
272 return elems_[i];
273 }
274 void PrintOperandsTo(StringStream* stream);
340 275
341 private: 276 private:
342 LGapNode* LookupNode(LOperand* operand); 277 ElementType elems_[NumElements];
343 bool CanReach(LGapNode* a, LGapNode* b, int visited_id);
344 bool CanReach(LGapNode* a, LGapNode* b);
345 void RegisterMove(LMoveOperands move);
346 void AddResultMove(LOperand* from, LOperand* to);
347 void AddResultMove(LGapNode* from, LGapNode* to);
348 void ResolveCycle(LGapNode* start);
349
350 ZoneList<LGapNode*> nodes_;
351 ZoneList<LGapNode*> identified_cycles_;
352 ZoneList<LMoveOperands> result_;
353 LOperand* marker_operand_;
354 int next_visited_id_;
355 int bailout_after_ast_id_;
356 }; 278 };
357 279
358 280
359 class LParallelMove : public ZoneObject { 281 template<typename ElementType>
282 class OperandContainer<ElementType, 0> {
360 public: 283 public:
361 LParallelMove() : move_operands_(4) { } 284 int length() { return 0; }
362 285 void PrintOperandsTo(StringStream* stream) { }
363 void AddMove(LOperand* from, LOperand* to) { 286 ElementType& operator[](int i) {
364 move_operands_.Add(LMoveOperands(from, to)); 287 UNREACHABLE();
288 static ElementType t = 0;
289 return t;
365 } 290 }
366
367 bool IsRedundant() const;
368
369 const ZoneList<LMoveOperands>* move_operands() const {
370 return &move_operands_;
371 }
372
373 void PrintDataTo(StringStream* stream) const;
374
375 private:
376 ZoneList<LMoveOperands> move_operands_;
377 }; 291 };
378 292
379 293
380 class LGap: public LInstruction { 294 // R = number of result operands (0 or 1).
295 // I = number of input operands.
296 // T = number of temporary operands.
297 template<int R, int I, int T>
298 class LTemplateInstruction: public LInstruction {
299 public:
300 // Allow 0 or 1 output operands.
301 STATIC_ASSERT(R == 0 || R == 1);
302 virtual bool HasResult() const { return R != 0; }
303 void set_result(LOperand* operand) { results_[0] = operand; }
304 LOperand* result() { return results_[0]; }
305
306 int InputCount() { return I; }
307 LOperand* InputAt(int i) { return inputs_[i]; }
308
309 int TempCount() { return T; }
310 LOperand* TempAt(int i) { return temps_[i]; }
311
312 virtual void PrintDataTo(StringStream* stream);
313 virtual void PrintOutputOperandTo(StringStream* stream);
314
315 protected:
316 OperandContainer<LOperand*, R> results_;
317 OperandContainer<LOperand*, I> inputs_;
318 OperandContainer<LOperand*, T> temps_;
319 };
320
321
322 class LGap: public LTemplateInstruction<0, 0, 0> {
381 public: 323 public:
382 explicit LGap(HBasicBlock* block) 324 explicit LGap(HBasicBlock* block)
383 : block_(block) { 325 : block_(block) {
384 parallel_moves_[BEFORE] = NULL; 326 parallel_moves_[BEFORE] = NULL;
385 parallel_moves_[START] = NULL; 327 parallel_moves_[START] = NULL;
386 parallel_moves_[END] = NULL; 328 parallel_moves_[END] = NULL;
387 parallel_moves_[AFTER] = NULL; 329 parallel_moves_[AFTER] = NULL;
388 } 330 }
389 331
390 DECLARE_CONCRETE_INSTRUCTION(Gap, "gap") 332 DECLARE_CONCRETE_INSTRUCTION(Gap, "gap")
391 virtual void PrintDataTo(StringStream* stream) const; 333 virtual void PrintDataTo(StringStream* stream);
392 334
393 bool IsRedundant() const; 335 bool IsRedundant() const;
394 336
395 HBasicBlock* block() const { return block_; } 337 HBasicBlock* block() const { return block_; }
396 338
397 enum InnerPosition { 339 enum InnerPosition {
398 BEFORE, 340 BEFORE,
399 START, 341 START,
400 END, 342 END,
401 AFTER, 343 AFTER,
402 FIRST_INNER_POSITION = BEFORE, 344 FIRST_INNER_POSITION = BEFORE,
403 LAST_INNER_POSITION = AFTER 345 LAST_INNER_POSITION = AFTER
404 }; 346 };
405 347
406 LParallelMove* GetOrCreateParallelMove(InnerPosition pos) { 348 LParallelMove* GetOrCreateParallelMove(InnerPosition pos) {
407 if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove; 349 if (parallel_moves_[pos] == NULL) parallel_moves_[pos] = new LParallelMove;
408 return parallel_moves_[pos]; 350 return parallel_moves_[pos];
409 } 351 }
410 352
411 LParallelMove* GetParallelMove(InnerPosition pos) { 353 LParallelMove* GetParallelMove(InnerPosition pos) {
412 return parallel_moves_[pos]; 354 return parallel_moves_[pos];
413 } 355 }
414 356
415 private: 357 private:
416 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; 358 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
417 HBasicBlock* block_; 359 HBasicBlock* block_;
418 }; 360 };
419 361
420 362
421 class LGoto: public LInstruction { 363 class LGoto: public LTemplateInstruction<0, 0, 0> {
422 public: 364 public:
423 LGoto(int block_id, bool include_stack_check = false) 365 LGoto(int block_id, bool include_stack_check = false)
424 : block_id_(block_id), include_stack_check_(include_stack_check) { } 366 : block_id_(block_id), include_stack_check_(include_stack_check) { }
425 367
426 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") 368 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
427 virtual void PrintDataTo(StringStream* stream) const; 369 virtual void PrintDataTo(StringStream* stream);
428 virtual bool IsControl() const { return true; } 370 virtual bool IsControl() const { return true; }
429 371
430 int block_id() const { return block_id_; } 372 int block_id() const { return block_id_; }
431 bool include_stack_check() const { return include_stack_check_; } 373 bool include_stack_check() const { return include_stack_check_; }
432 374
433 private: 375 private:
434 int block_id_; 376 int block_id_;
435 bool include_stack_check_; 377 bool include_stack_check_;
436 }; 378 };
437 379
438 380
439 class LLazyBailout: public LInstruction { 381 class LLazyBailout: public LTemplateInstruction<0, 0, 0> {
440 public: 382 public:
441 LLazyBailout() : gap_instructions_size_(0) { } 383 LLazyBailout() : gap_instructions_size_(0) { }
442 384
443 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") 385 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
444 386
445 void set_gap_instructions_size(int gap_instructions_size) { 387 void set_gap_instructions_size(int gap_instructions_size) {
446 gap_instructions_size_ = gap_instructions_size; 388 gap_instructions_size_ = gap_instructions_size;
447 } 389 }
448 int gap_instructions_size() { return gap_instructions_size_; } 390 int gap_instructions_size() { return gap_instructions_size_; }
449 391
450 private: 392 private:
451 int gap_instructions_size_; 393 int gap_instructions_size_;
452 }; 394 };
453 395
454 396
455 class LDeoptimize: public LInstruction { 397 class LDeoptimize: public LTemplateInstruction<0, 0, 0> {
456 public: 398 public:
457 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") 399 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
458 }; 400 };
459 401
460 402
461 class LLabel: public LGap { 403 class LLabel: public LGap {
462 public: 404 public:
463 explicit LLabel(HBasicBlock* block) 405 explicit LLabel(HBasicBlock* block)
464 : LGap(block), replacement_(NULL) { } 406 : LGap(block), replacement_(NULL) { }
465 407
466 DECLARE_CONCRETE_INSTRUCTION(Label, "label") 408 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
467 409
468 virtual void PrintDataTo(StringStream* stream) const; 410 virtual void PrintDataTo(StringStream* stream);
469 411
470 int block_id() const { return block()->block_id(); } 412 int block_id() const { return block()->block_id(); }
471 bool is_loop_header() const { return block()->IsLoopHeader(); } 413 bool is_loop_header() const { return block()->IsLoopHeader(); }
472 Label* label() { return &label_; } 414 Label* label() { return &label_; }
473 LLabel* replacement() const { return replacement_; } 415 LLabel* replacement() const { return replacement_; }
474 void set_replacement(LLabel* label) { replacement_ = label; } 416 void set_replacement(LLabel* label) { replacement_ = label; }
475 bool HasReplacement() const { return replacement_ != NULL; } 417 bool HasReplacement() const { return replacement_ != NULL; }
476 418
477 private: 419 private:
478 Label label_; 420 Label label_;
479 LLabel* replacement_; 421 LLabel* replacement_;
480 }; 422 };
481 423
482 424
483 class LParameter: public LInstruction { 425 class LParameter: public LTemplateInstruction<1, 0, 0> {
484 public: 426 public:
485 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") 427 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
486 }; 428 };
487 429
488 430
489 class LCallStub: public LInstruction { 431 class LCallStub: public LTemplateInstruction<1, 1, 0> {
490 public: 432 public:
433 explicit LCallStub(LOperand* context) {
434 inputs_[0] = context;
435 }
436
491 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") 437 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub")
492 DECLARE_HYDROGEN_ACCESSOR(CallStub) 438 DECLARE_HYDROGEN_ACCESSOR(CallStub)
493 439
440 LOperand* context() { return inputs_[0]; }
441
494 TranscendentalCache::Type transcendental_type() { 442 TranscendentalCache::Type transcendental_type() {
495 return hydrogen()->transcendental_type(); 443 return hydrogen()->transcendental_type();
496 } 444 }
497 }; 445 };
498 446
499 447
500 class LUnknownOSRValue: public LInstruction { 448 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> {
501 public: 449 public:
502 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 450 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
503 }; 451 };
504 452
505 453
506 class LUnaryOperation: public LInstruction { 454 template<int I, int T>
455 class LControlInstruction: public LTemplateInstruction<0, I, T> {
507 public: 456 public:
508 explicit LUnaryOperation(LOperand* input) : input_(input) { } 457 DECLARE_INSTRUCTION(ControlInstruction)
458 virtual bool IsControl() const { return true; }
509 459
510 DECLARE_INSTRUCTION(UnaryOperation) 460 int true_block_id() const { return true_block_id_; }
511 461 int false_block_id() const { return false_block_id_; }
512 LOperand* input() const { return input_; } 462 void SetBranchTargets(int true_block_id, int false_block_id) {
513 463 true_block_id_ = true_block_id;
514 virtual void PrintDataTo(StringStream* stream) const; 464 false_block_id_ = false_block_id;
465 }
515 466
516 private: 467 private:
517 LOperand* input_; 468 int true_block_id_;
469 int false_block_id_;
518 }; 470 };
519 471
520 472
521 class LBinaryOperation: public LInstruction { 473 class LApplyArguments: public LTemplateInstruction<1, 4, 1> {
522 public:
523 LBinaryOperation(LOperand* left, LOperand* right)
524 : left_(left), right_(right) { }
525
526 DECLARE_INSTRUCTION(BinaryOperation)
527
528 LOperand* left() const { return left_; }
529 LOperand* right() const { return right_; }
530 virtual void PrintDataTo(StringStream* stream) const;
531
532 private:
533 LOperand* left_;
534 LOperand* right_;
535 };
536
537
538 class LApplyArguments: public LBinaryOperation {
539 public: 474 public:
540 LApplyArguments(LOperand* function, 475 LApplyArguments(LOperand* function,
541 LOperand* receiver, 476 LOperand* receiver,
542 LOperand* length, 477 LOperand* length,
543 LOperand* elements) 478 LOperand* elements,
544 : LBinaryOperation(function, receiver), 479 LOperand* temp) {
545 length_(length), 480 inputs_[0] = function;
546 elements_(elements) { } 481 inputs_[1] = receiver;
482 inputs_[2] = length;
483 inputs_[3] = elements;
484 temps_[0] = temp;
485 }
547 486
548 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") 487 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
549 488
550 LOperand* function() const { return left(); } 489 LOperand* function() { return inputs_[0]; }
551 LOperand* receiver() const { return right(); } 490 LOperand* receiver() { return inputs_[1]; }
552 LOperand* length() const { return length_; } 491 LOperand* length() { return inputs_[2]; }
553 LOperand* elements() const { return elements_; } 492 LOperand* elements() { return inputs_[3]; }
554
555 private:
556 LOperand* length_;
557 LOperand* elements_;
558 }; 493 };
559 494
560 495
561 class LAccessArgumentsAt: public LInstruction { 496 class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
562 public: 497 public:
563 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) 498 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
564 : arguments_(arguments), length_(length), index_(index) { } 499 inputs_[0] = arguments;
500 inputs_[1] = length;
501 inputs_[2] = index;
502 }
565 503
566 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") 504 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
567 505
568 LOperand* arguments() const { return arguments_; } 506 LOperand* arguments() { return inputs_[0]; }
569 LOperand* length() const { return length_; } 507 LOperand* length() { return inputs_[1]; }
570 LOperand* index() const { return index_; } 508 LOperand* index() { return inputs_[2]; }
571 509
572 virtual void PrintDataTo(StringStream* stream) const; 510 virtual void PrintDataTo(StringStream* stream);
573
574 private:
575 LOperand* arguments_;
576 LOperand* length_;
577 LOperand* index_;
578 }; 511 };
579 512
580 513
581 class LArgumentsLength: public LUnaryOperation { 514 class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
582 public: 515 public:
583 explicit LArgumentsLength(LOperand* elements) : LUnaryOperation(elements) {} 516 explicit LArgumentsLength(LOperand* elements) {
517 inputs_[0] = elements;
518 }
584 519
585 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") 520 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
586 }; 521 };
587 522
588 523
589 class LArgumentsElements: public LInstruction { 524 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
590 public: 525 public:
591 LArgumentsElements() { } 526 LArgumentsElements() { }
592 527
593 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") 528 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
594 }; 529 };
595 530
596 531
597 class LModI: public LBinaryOperation { 532 class LModI: public LTemplateInstruction<1, 2, 1> {
598 public: 533 public:
599 LModI(LOperand* left, LOperand* right) : LBinaryOperation(left, right) { } 534 LModI(LOperand* left, LOperand* right, LOperand* temp) {
535 inputs_[0] = left;
536 inputs_[1] = right;
537 temps_[0] = temp;
538 }
600 539
601 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") 540 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
602 DECLARE_HYDROGEN_ACCESSOR(Mod) 541 DECLARE_HYDROGEN_ACCESSOR(Mod)
603 }; 542 };
604 543
605 544
606 class LDivI: public LBinaryOperation { 545 class LDivI: public LTemplateInstruction<1, 2, 1> {
607 public: 546 public:
608 LDivI(LOperand* left, LOperand* right) 547 LDivI(LOperand* left, LOperand* right, LOperand* temp) {
609 : LBinaryOperation(left, right) { } 548 inputs_[0] = left;
549 inputs_[1] = right;
550 temps_[0] = temp;
551 }
610 552
611 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 553 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
612 DECLARE_HYDROGEN_ACCESSOR(Div) 554 DECLARE_HYDROGEN_ACCESSOR(Div)
613 }; 555 };
614 556
615 557
616 class LMulI: public LBinaryOperation { 558 class LMulI: public LTemplateInstruction<1, 2, 1> {
617 public: 559 public:
618 LMulI(LOperand* left, LOperand* right, LOperand* temp) 560 LMulI(LOperand* left, LOperand* right, LOperand* temp) {
619 : LBinaryOperation(left, right), temp_(temp) { } 561 inputs_[0] = left;
562 inputs_[1] = right;
563 temps_[0] = temp;
564 }
620 565
621 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 566 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
622 DECLARE_HYDROGEN_ACCESSOR(Mul) 567 DECLARE_HYDROGEN_ACCESSOR(Mul)
623 568 };
624 LOperand* temp() const { return temp_; } 569
625 570
626 private: 571 class LCmpID: public LTemplateInstruction<1, 2, 0> {
627 LOperand* temp_; 572 public:
628 }; 573 LCmpID(LOperand* left, LOperand* right) {
629 574 inputs_[0] = left;
630 575 inputs_[1] = right;
631 class LCmpID: public LBinaryOperation { 576 }
632 public:
633 LCmpID(Token::Value op, LOperand* left, LOperand* right, bool is_double)
634 : LBinaryOperation(left, right), op_(op), is_double_(is_double) { }
635
636 Token::Value op() const { return op_; }
637 bool is_double() const { return is_double_; }
638 577
639 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") 578 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id")
640 579 DECLARE_HYDROGEN_ACCESSOR(Compare)
641 private: 580
642 Token::Value op_; 581 Token::Value op() const { return hydrogen()->token(); }
643 bool is_double_; 582 bool is_double() const {
644 }; 583 return hydrogen()->GetInputRepresentation().IsDouble();
645 584 }
646 585 };
647 class LCmpIDAndBranch: public LCmpID { 586
648 public: 587
649 LCmpIDAndBranch(Token::Value op, 588 class LCmpIDAndBranch: public LControlInstruction<2, 0> {
650 LOperand* left, 589 public:
651 LOperand* right, 590 LCmpIDAndBranch(LOperand* left, LOperand* right) {
652 int true_block_id, 591 inputs_[0] = left;
653 int false_block_id, 592 inputs_[1] = right;
654 bool is_double) 593 }
655 : LCmpID(op, left, right, is_double),
656 true_block_id_(true_block_id),
657 false_block_id_(false_block_id) { }
658 594
659 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") 595 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
660 virtual void PrintDataTo(StringStream* stream) const; 596 DECLARE_HYDROGEN_ACCESSOR(Compare)
661 virtual bool IsControl() const { return true; } 597
662 598 Token::Value op() const { return hydrogen()->token(); }
663 int true_block_id() const { return true_block_id_; } 599 bool is_double() const {
664 int false_block_id() const { return false_block_id_; } 600 return hydrogen()->GetInputRepresentation().IsDouble();
665 601 }
666 private: 602
667 int true_block_id_; 603 virtual void PrintDataTo(StringStream* stream);
668 int false_block_id_; 604 };
669 }; 605
670 606
671 607 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> {
672 class LUnaryMathOperation: public LUnaryOperation { 608 public:
673 public: 609 explicit LUnaryMathOperation(LOperand* value) {
674 explicit LUnaryMathOperation(LOperand* value) 610 inputs_[0] = value;
675 : LUnaryOperation(value) { } 611 }
676 612
677 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") 613 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
678 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 614 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
679 615
680 virtual void PrintDataTo(StringStream* stream) const; 616 virtual void PrintDataTo(StringStream* stream);
681 BuiltinFunctionId op() const { return hydrogen()->op(); } 617 BuiltinFunctionId op() const { return hydrogen()->op(); }
682 }; 618 };
683 619
684 620
685 class LCmpJSObjectEq: public LBinaryOperation { 621 class LCmpJSObjectEq: public LTemplateInstruction<1, 2, 0> {
686 public: 622 public:
687 LCmpJSObjectEq(LOperand* left, LOperand* right) 623 LCmpJSObjectEq(LOperand* left, LOperand* right) {
688 : LBinaryOperation(left, right) {} 624 inputs_[0] = left;
625 inputs_[1] = right;
626 }
689 627
690 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") 628 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq")
691 }; 629 };
692 630
693 631
694 class LCmpJSObjectEqAndBranch: public LCmpJSObjectEq { 632 class LCmpJSObjectEqAndBranch: public LControlInstruction<2, 0> {
695 public: 633 public:
696 LCmpJSObjectEqAndBranch(LOperand* left, 634 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) {
697 LOperand* right, 635 inputs_[0] = left;
698 int true_block_id, 636 inputs_[1] = right;
699 int false_block_id) 637 }
700 : LCmpJSObjectEq(left, right),
701 true_block_id_(true_block_id),
702 false_block_id_(false_block_id) { }
703 638
704 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, 639 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch,
705 "cmp-jsobject-eq-and-branch") 640 "cmp-jsobject-eq-and-branch")
706 641 };
707 int true_block_id() const { return true_block_id_; } 642
708 int false_block_id() const { return false_block_id_; } 643
709 644 class LIsNull: public LTemplateInstruction<1, 1, 0> {
710 private: 645 public:
711 int true_block_id_; 646 explicit LIsNull(LOperand* value) {
712 int false_block_id_; 647 inputs_[0] = value;
713 }; 648 }
714
715
716 class LIsNull: public LUnaryOperation {
717 public:
718 LIsNull(LOperand* value, bool is_strict)
719 : LUnaryOperation(value), is_strict_(is_strict) {}
720 649
721 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") 650 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null")
722 651 DECLARE_HYDROGEN_ACCESSOR(IsNull)
723 bool is_strict() const { return is_strict_; } 652
724 653 bool is_strict() const { return hydrogen()->is_strict(); }
725 private: 654 };
726 bool is_strict_; 655
727 }; 656
728 657 class LIsNullAndBranch: public LControlInstruction<1, 1> {
729 658 public:
730 class LIsNullAndBranch: public LIsNull { 659 LIsNullAndBranch(LOperand* value, LOperand* temp) {
731 public: 660 inputs_[0] = value;
732 LIsNullAndBranch(LOperand* value, 661 temps_[0] = temp;
733 bool is_strict, 662 }
734 LOperand* temp,
735 int true_block_id,
736 int false_block_id)
737 : LIsNull(value, is_strict),
738 temp_(temp),
739 true_block_id_(true_block_id),
740 false_block_id_(false_block_id) { }
741 663
742 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") 664 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch")
743 virtual void PrintDataTo(StringStream* stream) const; 665 DECLARE_HYDROGEN_ACCESSOR(IsNull)
744 virtual bool IsControl() const { return true; } 666
745 667 bool is_strict() const { return hydrogen()->is_strict(); }
746 int true_block_id() const { return true_block_id_; } 668
747 int false_block_id() const { return false_block_id_; } 669 virtual void PrintDataTo(StringStream* stream);
748 670 };
749 LOperand* temp() const { return temp_; } 671
750 672
751 private: 673 class LIsObject: public LTemplateInstruction<1, 1, 1> {
752 LOperand* temp_; 674 public:
753 int true_block_id_; 675 LIsObject(LOperand* value, LOperand* temp) {
754 int false_block_id_; 676 inputs_[0] = value;
755 }; 677 temps_[0] = temp;
756 678 }
757
758 class LIsObject: public LUnaryOperation {
759 public:
760 LIsObject(LOperand* value, LOperand* temp)
761 : LUnaryOperation(value), temp_(temp) {}
762 679
763 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object") 680 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object")
764 681 };
765 LOperand* temp() const { return temp_; } 682
766 683
767 private: 684 class LIsObjectAndBranch: public LControlInstruction<1, 2> {
768 LOperand* temp_; 685 public:
769 }; 686 LIsObjectAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) {
770 687 inputs_[0] = value;
771 688 temps_[0] = temp;
772 class LIsObjectAndBranch: public LIsObject { 689 temps_[1] = temp2;
773 public: 690 }
774 LIsObjectAndBranch(LOperand* value,
775 LOperand* temp,
776 LOperand* temp2,
777 int true_block_id,
778 int false_block_id)
779 : LIsObject(value, temp),
780 temp2_(temp2),
781 true_block_id_(true_block_id),
782 false_block_id_(false_block_id) { }
783 691
784 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") 692 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
785 virtual void PrintDataTo(StringStream* stream) const; 693
786 virtual bool IsControl() const { return true; } 694 virtual void PrintDataTo(StringStream* stream);
787 695 };
788 int true_block_id() const { return true_block_id_; } 696
789 int false_block_id() const { return false_block_id_; } 697
790 698 class LIsSmi: public LTemplateInstruction<1, 1, 0> {
791 LOperand* temp2() const { return temp2_; } 699 public:
792 700 explicit LIsSmi(LOperand* value) {
793 private: 701 inputs_[0] = value;
794 LOperand* temp2_; 702 }
795 int true_block_id_;
796 int false_block_id_;
797 };
798
799
800 class LIsSmi: public LUnaryOperation {
801 public:
802 explicit LIsSmi(LOperand* value) : LUnaryOperation(value) {}
803 703
804 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") 704 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi")
805 DECLARE_HYDROGEN_ACCESSOR(IsSmi) 705 DECLARE_HYDROGEN_ACCESSOR(IsSmi)
806 }; 706 };
807 707
808 708
809 class LIsSmiAndBranch: public LIsSmi { 709 class LIsSmiAndBranch: public LControlInstruction<1, 0> {
810 public: 710 public:
811 LIsSmiAndBranch(LOperand* value, 711 explicit LIsSmiAndBranch(LOperand* value) {
812 int true_block_id, 712 inputs_[0] = value;
813 int false_block_id) 713 }
814 : LIsSmi(value),
815 true_block_id_(true_block_id),
816 false_block_id_(false_block_id) { }
817 714
818 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") 715 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
819 virtual void PrintDataTo(StringStream* stream) const; 716
820 virtual bool IsControl() const { return true; } 717 virtual void PrintDataTo(StringStream* stream);
821 718 };
822 int true_block_id() const { return true_block_id_; } 719
823 int false_block_id() const { return false_block_id_; } 720
824 721 class LHasInstanceType: public LTemplateInstruction<1, 1, 0> {
825 private: 722 public:
826 int true_block_id_; 723 explicit LHasInstanceType(LOperand* value) {
827 int false_block_id_; 724 inputs_[0] = value;
828 }; 725 }
829
830
831 class LHasInstanceType: public LUnaryOperation {
832 public:
833 explicit LHasInstanceType(LOperand* value)
834 : LUnaryOperation(value) { }
835 726
836 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") 727 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type")
837 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) 728 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
838 729 };
839 InstanceType TestType(); // The type to test against when generating code. 730
840 Condition BranchCondition(); // The branch condition for 'true'. 731
841 }; 732 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 1> {
842 733 public:
843 734 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) {
844 class LHasInstanceTypeAndBranch: public LHasInstanceType { 735 inputs_[0] = value;
845 public: 736 temps_[0] = temp;
846 LHasInstanceTypeAndBranch(LOperand* value, 737 }
847 LOperand* temporary,
848 int true_block_id,
849 int false_block_id)
850 : LHasInstanceType(value),
851 temp_(temporary),
852 true_block_id_(true_block_id),
853 false_block_id_(false_block_id) { }
854 738
855 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 739 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
856 "has-instance-type-and-branch") 740 "has-instance-type-and-branch")
857 virtual void PrintDataTo(StringStream* stream) const; 741 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType)
858 virtual bool IsControl() const { return true; } 742
859 743 virtual void PrintDataTo(StringStream* stream);
860 int true_block_id() const { return true_block_id_; } 744 };
861 int false_block_id() const { return false_block_id_; } 745
862 746
863 LOperand* temp() { return temp_; } 747 class LHasCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
864 748 public:
865 private: 749 explicit LHasCachedArrayIndex(LOperand* value) {
866 LOperand* temp_; 750 inputs_[0] = value;
867 int true_block_id_; 751 }
868 int false_block_id_;
869 };
870
871
872 class LHasCachedArrayIndex: public LUnaryOperation {
873 public:
874 explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation(value) {}
875 752
876 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") 753 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index")
877 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) 754 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex)
878 }; 755 };
879 756
880 757
881 class LHasCachedArrayIndexAndBranch: public LHasCachedArrayIndex { 758 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
882 public: 759 public:
883 LHasCachedArrayIndexAndBranch(LOperand* value, 760 explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
884 int true_block_id, 761 inputs_[0] = value;
885 int false_block_id) 762 }
886 : LHasCachedArrayIndex(value),
887 true_block_id_(true_block_id),
888 false_block_id_(false_block_id) { }
889 763
890 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, 764 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
891 "has-cached-array-index-and-branch") 765 "has-cached-array-index-and-branch")
892 virtual void PrintDataTo(StringStream* stream) const; 766 virtual void PrintDataTo(StringStream* stream);
893 virtual bool IsControl() const { return true; } 767 };
894 768
895 int true_block_id() const { return true_block_id_; } 769
896 int false_block_id() const { return false_block_id_; } 770 class LIsConstructCall: public LTemplateInstruction<1, 0, 0> {
897 771 public:
898 private: 772 DECLARE_CONCRETE_INSTRUCTION(IsConstructCall, "is-construct-call")
899 int true_block_id_; 773 DECLARE_HYDROGEN_ACCESSOR(IsConstructCall)
900 int false_block_id_; 774 };
901 }; 775
902 776
903 777 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
904 class LClassOfTest: public LUnaryOperation { 778 public:
905 public: 779 explicit LIsConstructCallAndBranch(LOperand* temp) {
906 LClassOfTest(LOperand* value, LOperand* temp) 780 temps_[0] = temp;
907 : LUnaryOperation(value), temporary_(temp) {} 781 }
782
783 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
784 "is-construct-call-and-branch")
785 };
786
787
788 class LClassOfTest: public LTemplateInstruction<1, 1, 1> {
789 public:
790 LClassOfTest(LOperand* value, LOperand* temp) {
791 inputs_[0] = value;
792 temps_[0] = temp;
793 }
908 794
909 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") 795 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test")
910 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) 796 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
911 797
912 virtual void PrintDataTo(StringStream* stream) const; 798 virtual void PrintDataTo(StringStream* stream);
913 799 };
914 LOperand* temporary() { return temporary_; } 800
915 801
916 private: 802 class LClassOfTestAndBranch: public LControlInstruction<1, 2> {
917 LOperand *temporary_; 803 public:
918 }; 804 LClassOfTestAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) {
919 805 inputs_[0] = value;
920 806 temps_[0] = temp;
921 class LClassOfTestAndBranch: public LClassOfTest { 807 temps_[1] = temp2;
922 public: 808 }
923 LClassOfTestAndBranch(LOperand* value,
924 LOperand* temporary,
925 LOperand* temporary2,
926 int true_block_id,
927 int false_block_id)
928 : LClassOfTest(value, temporary),
929 temporary2_(temporary2),
930 true_block_id_(true_block_id),
931 false_block_id_(false_block_id) { }
932 809
933 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, 810 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
934 "class-of-test-and-branch") 811 "class-of-test-and-branch")
935 virtual void PrintDataTo(StringStream* stream) const; 812 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest)
936 virtual bool IsControl() const { return true; } 813
937 814 virtual void PrintDataTo(StringStream* stream);
938 int true_block_id() const { return true_block_id_; } 815 };
939 int false_block_id() const { return false_block_id_; } 816
940 LOperand* temporary2() { return temporary2_; } 817
941 818 class LCmpT: public LTemplateInstruction<1, 2, 0> {
942 private: 819 public:
943 LOperand* temporary2_; 820 LCmpT(LOperand* left, LOperand* right) {
944 int true_block_id_; 821 inputs_[0] = left;
945 int false_block_id_; 822 inputs_[1] = right;
946 }; 823 }
947
948
949 class LCmpT: public LBinaryOperation {
950 public:
951 LCmpT(LOperand* left, LOperand* right) : LBinaryOperation(left, right) {}
952 824
953 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") 825 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
954 DECLARE_HYDROGEN_ACCESSOR(Compare) 826 DECLARE_HYDROGEN_ACCESSOR(Compare)
955 827
956 Token::Value op() const { return hydrogen()->token(); } 828 Token::Value op() const { return hydrogen()->token(); }
957 }; 829 };
958 830
959 831
960 class LCmpTAndBranch: public LCmpT { 832 class LCmpTAndBranch: public LControlInstruction<2, 0> {
961 public: 833 public:
962 LCmpTAndBranch(LOperand* left, 834 LCmpTAndBranch(LOperand* left, LOperand* right) {
963 LOperand* right, 835 inputs_[0] = left;
964 int true_block_id, 836 inputs_[1] = right;
965 int false_block_id) 837 }
966 : LCmpT(left, right),
967 true_block_id_(true_block_id),
968 false_block_id_(false_block_id) { }
969 838
970 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") 839 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch")
840 DECLARE_HYDROGEN_ACCESSOR(Compare)
971 841
972 int true_block_id() const { return true_block_id_; } 842 Token::Value op() const { return hydrogen()->token(); }
973 int false_block_id() const { return false_block_id_; }
974
975 private:
976 int true_block_id_;
977 int false_block_id_;
978 }; 843 };
979 844
980 845
981 class LInstanceOf: public LBinaryOperation { 846 class LInstanceOf: public LTemplateInstruction<1, 3, 0> {
982 public: 847 public:
983 LInstanceOf(LOperand* left, LOperand* right) 848 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
984 : LBinaryOperation(left, right) { } 849 inputs_[0] = context;
850 inputs_[1] = left;
851 inputs_[2] = right;
852 }
985 853
986 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 854 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
855
856 LOperand* context() { return inputs_[0]; }
987 }; 857 };
988 858
989 859
990 class LInstanceOfAndBranch: public LInstanceOf { 860 class LInstanceOfAndBranch: public LControlInstruction<3, 0> {
991 public: 861 public:
992 LInstanceOfAndBranch(LOperand* left, 862 LInstanceOfAndBranch(LOperand* context, LOperand* left, LOperand* right) {
993 LOperand* right, 863 inputs_[0] = context;
994 int true_block_id, 864 inputs_[1] = left;
995 int false_block_id) 865 inputs_[2] = right;
996 : LInstanceOf(left, right), 866 }
997 true_block_id_(true_block_id),
998 false_block_id_(false_block_id) { }
999 867
1000 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") 868 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch")
1001 869
1002 int true_block_id() const { return true_block_id_; } 870 LOperand* context() { return inputs_[0]; }
1003 int false_block_id() const { return false_block_id_; }
1004
1005 private:
1006 int true_block_id_;
1007 int false_block_id_;
1008 }; 871 };
1009 872
1010 873
1011 class LBoundsCheck: public LBinaryOperation { 874 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
1012 public: 875 public:
1013 LBoundsCheck(LOperand* index, LOperand* length) 876 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
1014 : LBinaryOperation(index, length) { } 877 inputs_[0] = value;
878 temps_[0] = temp;
879 }
1015 880
1016 LOperand* index() const { return left(); } 881 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
1017 LOperand* length() const { return right(); } 882 "instance-of-known-global")
883 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
884
885 Handle<JSFunction> function() const { return hydrogen()->function(); }
886 };
887
888
889 class LBoundsCheck: public LTemplateInstruction<0, 2, 0> {
890 public:
891 LBoundsCheck(LOperand* index, LOperand* length) {
892 inputs_[0] = index;
893 inputs_[1] = length;
894 }
895
896 LOperand* index() { return inputs_[0]; }
897 LOperand* length() { return inputs_[1]; }
1018 898
1019 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") 899 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
1020 }; 900 };
1021 901
1022 902
1023 class LBitI: public LBinaryOperation { 903 class LBitI: public LTemplateInstruction<1, 2, 0> {
1024 public: 904 public:
1025 LBitI(Token::Value op, LOperand* left, LOperand* right) 905 LBitI(Token::Value op, LOperand* left, LOperand* right)
1026 : LBinaryOperation(left, right), op_(op) { } 906 : op_(op) {
907 inputs_[0] = left;
908 inputs_[1] = right;
909 }
1027 910
1028 Token::Value op() const { return op_; } 911 Token::Value op() const { return op_; }
1029 912
1030 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") 913 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
1031 914
1032 private: 915 private:
1033 Token::Value op_; 916 Token::Value op_;
1034 }; 917 };
1035 918
1036 919
1037 class LShiftI: public LBinaryOperation { 920 class LShiftI: public LTemplateInstruction<1, 2, 0> {
1038 public: 921 public:
1039 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) 922 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
1040 : LBinaryOperation(left, right), op_(op), can_deopt_(can_deopt) { } 923 : op_(op), can_deopt_(can_deopt) {
924 inputs_[0] = left;
925 inputs_[1] = right;
926 }
1041 927
1042 Token::Value op() const { return op_; } 928 Token::Value op() const { return op_; }
1043 929
1044 bool can_deopt() const { return can_deopt_; } 930 bool can_deopt() const { return can_deopt_; }
1045 931
1046 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") 932 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1047 933
1048 private: 934 private:
1049 Token::Value op_; 935 Token::Value op_;
1050 bool can_deopt_; 936 bool can_deopt_;
1051 }; 937 };
1052 938
1053 939
1054 class LSubI: public LBinaryOperation { 940 class LSubI: public LTemplateInstruction<1, 2, 0> {
1055 public: 941 public:
1056 LSubI(LOperand* left, LOperand* right) 942 LSubI(LOperand* left, LOperand* right) {
1057 : LBinaryOperation(left, right) { } 943 inputs_[0] = left;
944 inputs_[1] = right;
945 }
1058 946
1059 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") 947 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1060 DECLARE_HYDROGEN_ACCESSOR(Sub) 948 DECLARE_HYDROGEN_ACCESSOR(Sub)
1061 }; 949 };
1062 950
1063 951
1064 class LConstant: public LInstruction { 952 class LConstantI: public LTemplateInstruction<1, 0, 0> {
1065 DECLARE_INSTRUCTION(Constant) 953 public:
954 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
955 DECLARE_HYDROGEN_ACCESSOR(Constant)
956
957 int32_t value() const { return hydrogen()->Integer32Value(); }
1066 }; 958 };
1067 959
1068 960
1069 class LConstantI: public LConstant { 961 class LConstantD: public LTemplateInstruction<1, 0, 1> {
1070 public: 962 public:
1071 explicit LConstantI(int32_t value) : value_(value) { } 963 explicit LConstantD(LOperand* temp) {
1072 int32_t value() const { return value_; } 964 temps_[0] = temp;
965 }
1073 966
1074 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") 967 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
968 DECLARE_HYDROGEN_ACCESSOR(Constant)
1075 969
1076 private: 970 double value() const { return hydrogen()->DoubleValue(); }
1077 int32_t value_;
1078 }; 971 };
1079 972
1080 973
1081 class LConstantD: public LConstant { 974 class LConstantT: public LTemplateInstruction<1, 0, 0> {
1082 public: 975 public:
1083 explicit LConstantD(double value) : value_(value) { } 976 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1084 double value() const { return value_; } 977 DECLARE_HYDROGEN_ACCESSOR(Constant)
1085 978
1086 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 979 Handle<Object> value() const { return hydrogen()->handle(); }
1087
1088 private:
1089 double value_;
1090 }; 980 };
1091 981
1092 982
1093 class LConstantT: public LConstant { 983 class LBranch: public LControlInstruction<1, 0> {
1094 public: 984 public:
1095 explicit LConstantT(Handle<Object> value) : value_(value) { } 985 explicit LBranch(LOperand* value) {
1096 Handle<Object> value() const { return value_; } 986 inputs_[0] = value;
1097 987 }
1098 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1099
1100 private:
1101 Handle<Object> value_;
1102 };
1103
1104
1105 class LBranch: public LUnaryOperation {
1106 public:
1107 LBranch(LOperand* input, int true_block_id, int false_block_id)
1108 : LUnaryOperation(input),
1109 true_block_id_(true_block_id),
1110 false_block_id_(false_block_id) { }
1111 988
1112 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 989 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1113 DECLARE_HYDROGEN_ACCESSOR(Value) 990 DECLARE_HYDROGEN_ACCESSOR(Value)
1114 991
1115 virtual void PrintDataTo(StringStream* stream) const; 992 virtual void PrintDataTo(StringStream* stream);
1116 virtual bool IsControl() const { return true; }
1117
1118 int true_block_id() const { return true_block_id_; }
1119 int false_block_id() const { return false_block_id_; }
1120
1121 private:
1122 int true_block_id_;
1123 int false_block_id_;
1124 }; 993 };
1125 994
1126 995
1127 class LCmpMapAndBranch: public LUnaryOperation { 996 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> {
1128 public: 997 public:
1129 LCmpMapAndBranch(LOperand* value, 998 explicit LCmpMapAndBranch(LOperand* value) {
1130 Handle<Map> map, 999 inputs_[0] = value;
1131 int true_block_id, 1000 }
1132 int false_block_id)
1133 : LUnaryOperation(value),
1134 map_(map),
1135 true_block_id_(true_block_id),
1136 false_block_id_(false_block_id) { }
1137 1001
1138 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1002 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1003 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1139 1004
1140 virtual bool IsControl() const { return true; } 1005 virtual bool IsControl() const { return true; }
1141 1006
1142 Handle<Map> map() const { return map_; } 1007 Handle<Map> map() const { return hydrogen()->map(); }
1143 int true_block_id() const { return true_block_id_; } 1008 int true_block_id() const {
1144 int false_block_id() const { return false_block_id_; } 1009 return hydrogen()->FirstSuccessor()->block_id();
1145 1010 }
1146 private: 1011 int false_block_id() const {
1147 Handle<Map> map_; 1012 return hydrogen()->SecondSuccessor()->block_id();
1148 int true_block_id_; 1013 }
1149 int false_block_id_;
1150 }; 1014 };
1151 1015
1152 1016
1153 class LJSArrayLength: public LUnaryOperation { 1017 class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
1154 public: 1018 public:
1155 explicit LJSArrayLength(LOperand* input) : LUnaryOperation(input) { } 1019 explicit LJSArrayLength(LOperand* value) {
1020 inputs_[0] = value;
1021 }
1156 1022
1157 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") 1023 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
1158 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) 1024 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
1159 }; 1025 };
1160 1026
1161 1027
1162 class LFixedArrayLength: public LUnaryOperation { 1028 class LPixelArrayLength: public LTemplateInstruction<1, 1, 0> {
1163 public: 1029 public:
1164 explicit LFixedArrayLength(LOperand* input) : LUnaryOperation(input) { } 1030 explicit LPixelArrayLength(LOperand* value) {
1031 inputs_[0] = value;
1032 }
1033
1034 DECLARE_CONCRETE_INSTRUCTION(PixelArrayLength, "pixel-array-length")
1035 DECLARE_HYDROGEN_ACCESSOR(PixelArrayLength)
1036 };
1037
1038
1039 class LFixedArrayLength: public LTemplateInstruction<1, 1, 0> {
1040 public:
1041 explicit LFixedArrayLength(LOperand* value) {
1042 inputs_[0] = value;
1043 }
1165 1044
1166 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") 1045 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length")
1167 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) 1046 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength)
1168 }; 1047 };
1169 1048
1170 1049
1171 class LValueOf: public LUnaryOperation { 1050 class LValueOf: public LTemplateInstruction<1, 1, 1> {
1172 public: 1051 public:
1173 LValueOf(LOperand* input, LOperand* temporary) 1052 LValueOf(LOperand* value, LOperand* temp) {
1174 : LUnaryOperation(input), temporary_(temporary) { } 1053 inputs_[0] = value;
1175 1054 temps_[0] = temp;
1176 LOperand* temporary() const { return temporary_; } 1055 }
1177 1056
1178 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") 1057 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1179 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 1058 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1180
1181 private:
1182 LOperand* temporary_;
1183 }; 1059 };
1184 1060
1185 1061
1186 class LThrow: public LUnaryOperation { 1062 class LThrow: public LTemplateInstruction<0, 1, 0> {
1187 public: 1063 public:
1188 explicit LThrow(LOperand* value) : LUnaryOperation(value) { } 1064 explicit LThrow(LOperand* value) {
1065 inputs_[0] = value;
1066 }
1189 1067
1190 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") 1068 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1191 }; 1069 };
1192 1070
1193 1071
1194 class LBitNotI: public LUnaryOperation { 1072 class LBitNotI: public LTemplateInstruction<1, 1, 0> {
1195 public: 1073 public:
1196 explicit LBitNotI(LOperand* use) : LUnaryOperation(use) { } 1074 explicit LBitNotI(LOperand* value) {
1075 inputs_[0] = value;
1076 }
1197 1077
1198 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") 1078 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
1199 }; 1079 };
1200 1080
1201 1081
1202 class LAddI: public LBinaryOperation { 1082 class LAddI: public LTemplateInstruction<1, 2, 0> {
1203 public: 1083 public:
1204 LAddI(LOperand* left, LOperand* right) 1084 LAddI(LOperand* left, LOperand* right) {
1205 : LBinaryOperation(left, right) { } 1085 inputs_[0] = left;
1086 inputs_[1] = right;
1087 }
1206 1088
1207 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") 1089 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1208 DECLARE_HYDROGEN_ACCESSOR(Add) 1090 DECLARE_HYDROGEN_ACCESSOR(Add)
1209 }; 1091 };
1210 1092
1211 1093
1212 class LPower: public LBinaryOperation { 1094 class LPower: public LTemplateInstruction<1, 2, 0> {
1213 public: 1095 public:
1214 LPower(LOperand* left, LOperand* right) 1096 LPower(LOperand* left, LOperand* right) {
1215 : LBinaryOperation(left, right) { } 1097 inputs_[0] = left;
1098 inputs_[1] = right;
1099 }
1216 1100
1217 DECLARE_CONCRETE_INSTRUCTION(Power, "power") 1101 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1218 DECLARE_HYDROGEN_ACCESSOR(Power) 1102 DECLARE_HYDROGEN_ACCESSOR(Power)
1219 }; 1103 };
1220 1104
1221 1105
1222 class LArithmeticD: public LBinaryOperation { 1106 class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
1223 public: 1107 public:
1224 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) 1108 LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
1225 : LBinaryOperation(left, right), op_(op) { } 1109 : op_(op) {
1110 inputs_[0] = left;
1111 inputs_[1] = right;
1112 }
1226 1113
1227 Token::Value op() const { return op_; } 1114 Token::Value op() const { return op_; }
1228 1115
1229 virtual void CompileToNative(LCodeGen* generator); 1116 virtual void CompileToNative(LCodeGen* generator);
1230 virtual const char* Mnemonic() const; 1117 virtual const char* Mnemonic() const;
1231 1118
1232 private: 1119 private:
1233 Token::Value op_; 1120 Token::Value op_;
1234 }; 1121 };
1235 1122
1236 1123
1237 class LArithmeticT: public LBinaryOperation { 1124 class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
1238 public: 1125 public:
1239 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) 1126 LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1240 : LBinaryOperation(left, right), op_(op) { } 1127 : op_(op) {
1128 inputs_[0] = left;
1129 inputs_[1] = right;
1130 }
1241 1131
1242 virtual void CompileToNative(LCodeGen* generator); 1132 virtual void CompileToNative(LCodeGen* generator);
1243 virtual const char* Mnemonic() const; 1133 virtual const char* Mnemonic() const;
1244 1134
1245 Token::Value op() const { return op_; } 1135 Token::Value op() const { return op_; }
1246 1136
1247 private: 1137 private:
1248 Token::Value op_; 1138 Token::Value op_;
1249 }; 1139 };
1250 1140
1251 1141
1252 class LReturn: public LUnaryOperation { 1142 class LReturn: public LTemplateInstruction<0, 1, 0> {
1253 public: 1143 public:
1254 explicit LReturn(LOperand* use) : LUnaryOperation(use) { } 1144 explicit LReturn(LOperand* value) {
1145 inputs_[0] = value;
1146 }
1255 1147
1256 DECLARE_CONCRETE_INSTRUCTION(Return, "return") 1148 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1257 }; 1149 };
1258 1150
1259 1151
1260 class LLoadNamedField: public LUnaryOperation { 1152 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
1261 public: 1153 public:
1262 explicit LLoadNamedField(LOperand* object) : LUnaryOperation(object) { } 1154 explicit LLoadNamedField(LOperand* object) {
1155 inputs_[0] = object;
1156 }
1263 1157
1264 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") 1158 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1265 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) 1159 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1266 }; 1160 };
1267 1161
1268 1162
1269 class LLoadNamedGeneric: public LUnaryOperation { 1163 class LLoadNamedGeneric: public LTemplateInstruction<1, 2, 0> {
1270 public: 1164 public:
1271 explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation(object) { } 1165 LLoadNamedGeneric(LOperand* context, LOperand* object) {
1166 inputs_[0] = context;
1167 inputs_[1] = object;
1168 }
1272 1169
1273 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") 1170 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1274 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) 1171 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1275 1172
1276 LOperand* object() const { return input(); } 1173 LOperand* context() { return inputs_[0]; }
1174 LOperand* object() { return inputs_[1]; }
1277 Handle<Object> name() const { return hydrogen()->name(); } 1175 Handle<Object> name() const { return hydrogen()->name(); }
1278 }; 1176 };
1279 1177
1280 1178
1281 class LLoadFunctionPrototype: public LUnaryOperation { 1179 class LLoadFunctionPrototype: public LTemplateInstruction<1, 1, 1> {
1282 public: 1180 public:
1283 LLoadFunctionPrototype(LOperand* function, LOperand* temporary) 1181 LLoadFunctionPrototype(LOperand* function, LOperand* temp) {
1284 : LUnaryOperation(function), temporary_(temporary) { } 1182 inputs_[0] = function;
1183 temps_[0] = temp;
1184 }
1285 1185
1286 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") 1186 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1287 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) 1187 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1288 1188
1289 LOperand* function() const { return input(); } 1189 LOperand* function() { return inputs_[0]; }
1290 LOperand* temporary() const { return temporary_; } 1190 };
1291 1191
1292 private: 1192
1293 LOperand* temporary_; 1193 class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1294 }; 1194 public:
1295 1195 explicit LLoadElements(LOperand* object) {
1296 1196 inputs_[0] = object;
1297 class LLoadElements: public LUnaryOperation { 1197 }
1298 public:
1299 explicit LLoadElements(LOperand* obj) : LUnaryOperation(obj) { }
1300 1198
1301 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") 1199 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1302 }; 1200 };
1303 1201
1304 1202
1305 class LLoadKeyedFastElement: public LBinaryOperation { 1203 class LLoadPixelArrayExternalPointer: public LTemplateInstruction<1, 1, 0> {
1306 public: 1204 public:
1307 LLoadKeyedFastElement(LOperand* elements, 1205 explicit LLoadPixelArrayExternalPointer(LOperand* object) {
1308 LOperand* key, 1206 inputs_[0] = object;
1309 LOperand* load_result) 1207 }
1310 : LBinaryOperation(elements, key), 1208
1311 load_result_(load_result) { } 1209 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayExternalPointer,
1210 "load-pixel-array-external-pointer")
1211 };
1212
1213
1214 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1215 public:
1216 LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1217 inputs_[0] = elements;
1218 inputs_[1] = key;
1219 }
1312 1220
1313 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element") 1221 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedFastElement, "load-keyed-fast-element")
1314 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement) 1222 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedFastElement)
1315 1223
1316 LOperand* elements() const { return left(); } 1224 LOperand* elements() { return inputs_[0]; }
1317 LOperand* key() const { return right(); } 1225 LOperand* key() { return inputs_[1]; }
1318 LOperand* load_result() const { return load_result_; } 1226 };
1319 1227
1320 private: 1228
1321 LOperand* load_result_; 1229 class LLoadPixelArrayElement: public LTemplateInstruction<1, 2, 0> {
1322 }; 1230 public:
1323 1231 LLoadPixelArrayElement(LOperand* external_pointer, LOperand* key) {
1324 1232 inputs_[0] = external_pointer;
1325 class LLoadKeyedGeneric: public LBinaryOperation { 1233 inputs_[1] = key;
1326 public: 1234 }
1327 LLoadKeyedGeneric(LOperand* obj, LOperand* key) 1235
1328 : LBinaryOperation(obj, key) { } 1236 DECLARE_CONCRETE_INSTRUCTION(LoadPixelArrayElement,
1237 "load-pixel-array-element")
1238 DECLARE_HYDROGEN_ACCESSOR(LoadPixelArrayElement)
1239
1240 LOperand* external_pointer() { return inputs_[0]; }
1241 LOperand* key() { return inputs_[1]; }
1242 };
1243
1244
1245 class LLoadKeyedGeneric: public LTemplateInstruction<1, 3, 0> {
1246 public:
1247 LLoadKeyedGeneric(LOperand* context, LOperand* obj, LOperand* key) {
1248 inputs_[0] = context;
1249 inputs_[1] = obj;
1250 inputs_[2] = key;
1251 }
1329 1252
1330 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") 1253 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1331 1254
1332 LOperand* object() const { return left(); } 1255 LOperand* context() { return inputs_[0]; }
1333 LOperand* key() const { return right(); } 1256 LOperand* object() { return inputs_[1]; }
1334 }; 1257 LOperand* key() { return inputs_[2]; }
1335 1258 };
1336 1259
1337 class LLoadGlobal: public LInstruction { 1260
1261 class LLoadGlobal: public LTemplateInstruction<1, 0, 0> {
1338 public: 1262 public:
1339 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global") 1263 DECLARE_CONCRETE_INSTRUCTION(LoadGlobal, "load-global")
1340 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal) 1264 DECLARE_HYDROGEN_ACCESSOR(LoadGlobal)
1341 }; 1265 };
1342 1266
1343 1267
1344 class LStoreGlobal: public LUnaryOperation { 1268 class LStoreGlobal: public LTemplateInstruction<0, 1, 0> {
1345 public: 1269 public:
1346 explicit LStoreGlobal(LOperand* value) : LUnaryOperation(value) {} 1270 explicit LStoreGlobal(LOperand* value) {
1271 inputs_[0] = value;
1272 }
1347 1273
1348 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global") 1274 DECLARE_CONCRETE_INSTRUCTION(StoreGlobal, "store-global")
1349 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal) 1275 DECLARE_HYDROGEN_ACCESSOR(StoreGlobal)
1350 }; 1276 };
1351 1277
1352 1278
1353 class LPushArgument: public LUnaryOperation { 1279 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1354 public: 1280 public:
1355 explicit LPushArgument(LOperand* argument) : LUnaryOperation(argument) {} 1281 explicit LLoadContextSlot(LOperand* context) {
1282 inputs_[0] = context;
1283 }
1284
1285 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1286 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1287
1288 LOperand* context() { return InputAt(0); }
1289 int slot_index() { return hydrogen()->slot_index(); }
1290
1291 virtual void PrintDataTo(StringStream* stream);
1292 };
1293
1294
1295 class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
1296 public:
1297 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1298 inputs_[0] = context;
1299 inputs_[1] = value;
1300 temps_[0] = temp;
1301 }
1302
1303 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1304 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1305
1306 LOperand* context() { return InputAt(0); }
1307 LOperand* value() { return InputAt(1); }
1308 int slot_index() { return hydrogen()->slot_index(); }
1309 int needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1310
1311 virtual void PrintDataTo(StringStream* stream);
1312 };
1313
1314
1315 class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1316 public:
1317 explicit LPushArgument(LOperand* value) {
1318 inputs_[0] = value;
1319 }
1356 1320
1357 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1321 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1358 }; 1322 };
1359 1323
1360 1324
1361 class LGlobalObject: public LInstruction { 1325 class LContext: public LTemplateInstruction<1, 0, 0> {
1362 public: 1326 public:
1327 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1328 };
1329
1330
1331 class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1332 public:
1333 explicit LOuterContext(LOperand* context) {
1334 inputs_[0] = context;
1335 }
1336
1337 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1338
1339 LOperand* context() { return InputAt(0); }
1340 };
1341
1342
1343 class LGlobalObject: public LTemplateInstruction<1, 1, 0> {
1344 public:
1345 explicit LGlobalObject(LOperand* context) {
1346 inputs_[0] = context;
1347 }
1348
1363 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") 1349 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1364 }; 1350
1365 1351 LOperand* context() { return InputAt(0); }
1366 1352 };
1367 class LGlobalReceiver: public LInstruction { 1353
1368 public: 1354
1355 class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1356 public:
1357 explicit LGlobalReceiver(LOperand* global_object) {
1358 inputs_[0] = global_object;
1359 }
1360
1369 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1361 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1370 }; 1362
1371 1363 LOperand* global() { return InputAt(0); }
1372 1364 };
1373 class LCallConstantFunction: public LInstruction { 1365
1366
1367 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1374 public: 1368 public:
1375 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") 1369 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1376 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) 1370 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1377 1371
1378 virtual void PrintDataTo(StringStream* stream) const; 1372 virtual void PrintDataTo(StringStream* stream);
1379 1373
1380 Handle<JSFunction> function() const { return hydrogen()->function(); } 1374 Handle<JSFunction> function() { return hydrogen()->function(); }
1381 int arity() const { return hydrogen()->argument_count() - 1; } 1375 int arity() const { return hydrogen()->argument_count() - 1; }
1382 }; 1376 };
1383 1377
1384 1378
1385 class LCallKeyed: public LInstruction { 1379 class LCallKeyed: public LTemplateInstruction<1, 2, 0> {
1386 public: 1380 public:
1381 LCallKeyed(LOperand* context, LOperand* key) {
1382 inputs_[0] = context;
1383 inputs_[1] = key;
1384 }
1385
1387 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") 1386 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed")
1388 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) 1387 DECLARE_HYDROGEN_ACCESSOR(CallKeyed)
1389 1388
1390 virtual void PrintDataTo(StringStream* stream) const; 1389 LOperand* context() { return inputs_[0]; }
1391 1390 LOperand* key() { return inputs_[1]; }
1392 int arity() const { return hydrogen()->argument_count() - 1; } 1391
1393 }; 1392 virtual void PrintDataTo(StringStream* stream);
1394 1393
1395 1394 int arity() const { return hydrogen()->argument_count() - 1; }
1396 class LCallNamed: public LInstruction { 1395 };
1397 public: 1396
1397
1398 class LCallNamed: public LTemplateInstruction<1, 1, 0> {
1399 public:
1400 explicit LCallNamed(LOperand* context) {
1401 inputs_[0] = context;
1402 }
1403
1398 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named") 1404 DECLARE_CONCRETE_INSTRUCTION(CallNamed, "call-named")
1399 DECLARE_HYDROGEN_ACCESSOR(CallNamed) 1405 DECLARE_HYDROGEN_ACCESSOR(CallNamed)
1400 1406
1401 virtual void PrintDataTo(StringStream* stream) const; 1407 virtual void PrintDataTo(StringStream* stream);
1402 1408
1409 LOperand* context() { return inputs_[0]; }
1403 Handle<String> name() const { return hydrogen()->name(); } 1410 Handle<String> name() const { return hydrogen()->name(); }
1404 int arity() const { return hydrogen()->argument_count() - 1; } 1411 int arity() const { return hydrogen()->argument_count() - 1; }
1405 }; 1412 };
1406 1413
1407 1414
1408 class LCallFunction: public LInstruction { 1415 class LCallFunction: public LTemplateInstruction<1, 1, 0> {
1409 public: 1416 public:
1417 explicit LCallFunction(LOperand* context) {
1418 inputs_[0] = context;
1419 }
1420
1410 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function") 1421 DECLARE_CONCRETE_INSTRUCTION(CallFunction, "call-function")
1411 DECLARE_HYDROGEN_ACCESSOR(CallFunction) 1422 DECLARE_HYDROGEN_ACCESSOR(CallFunction)
1412 1423
1424 LOperand* context() { return inputs_[0]; }
1413 int arity() const { return hydrogen()->argument_count() - 2; } 1425 int arity() const { return hydrogen()->argument_count() - 2; }
1414 }; 1426 };
1415 1427
1416 1428
1417 class LCallGlobal: public LInstruction { 1429 class LCallGlobal: public LTemplateInstruction<1, 1, 0> {
1418 public: 1430 public:
1431 explicit LCallGlobal(LOperand* context) {
1432 inputs_[0] = context;
1433 }
1434
1419 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global") 1435 DECLARE_CONCRETE_INSTRUCTION(CallGlobal, "call-global")
1420 DECLARE_HYDROGEN_ACCESSOR(CallGlobal) 1436 DECLARE_HYDROGEN_ACCESSOR(CallGlobal)
1421 1437
1422 virtual void PrintDataTo(StringStream* stream) const; 1438 virtual void PrintDataTo(StringStream* stream);
1423 1439
1440 LOperand* context() { return inputs_[0]; }
1424 Handle<String> name() const {return hydrogen()->name(); } 1441 Handle<String> name() const {return hydrogen()->name(); }
1425 int arity() const { return hydrogen()->argument_count() - 1; } 1442 int arity() const { return hydrogen()->argument_count() - 1; }
1426 }; 1443 };
1427 1444
1428 1445
1429 class LCallKnownGlobal: public LInstruction { 1446 class LCallKnownGlobal: public LTemplateInstruction<1, 0, 0> {
1430 public: 1447 public:
1431 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global") 1448 DECLARE_CONCRETE_INSTRUCTION(CallKnownGlobal, "call-known-global")
1432 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal) 1449 DECLARE_HYDROGEN_ACCESSOR(CallKnownGlobal)
1433 1450
1434 virtual void PrintDataTo(StringStream* stream) const; 1451 virtual void PrintDataTo(StringStream* stream);
1435 1452
1436 Handle<JSFunction> target() const { return hydrogen()->target(); } 1453 Handle<JSFunction> target() const { return hydrogen()->target(); }
1437 int arity() const { return hydrogen()->argument_count() - 1; } 1454 int arity() const { return hydrogen()->argument_count() - 1; }
1438 }; 1455 };
1439 1456
1440 1457
1441 class LCallNew: public LUnaryOperation { 1458 class LCallNew: public LTemplateInstruction<1, 2, 0> {
1442 public: 1459 public:
1443 explicit LCallNew(LOperand* constructor) : LUnaryOperation(constructor) { } 1460 LCallNew(LOperand* context, LOperand* constructor) {
1461 inputs_[0] = context;
1462 inputs_[1] = constructor;
1463 }
1444 1464
1445 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") 1465 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1446 DECLARE_HYDROGEN_ACCESSOR(CallNew) 1466 DECLARE_HYDROGEN_ACCESSOR(CallNew)
1447 1467
1448 virtual void PrintDataTo(StringStream* stream) const; 1468 virtual void PrintDataTo(StringStream* stream);
1449 1469
1450 int arity() const { return hydrogen()->argument_count() - 1; } 1470 LOperand* context() { return inputs_[0]; }
1451 }; 1471 LOperand* constructor() { return inputs_[1]; }
1452 1472 int arity() const { return hydrogen()->argument_count() - 1; }
1453 1473 };
1454 class LCallRuntime: public LInstruction { 1474
1475
1476 class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1455 public: 1477 public:
1456 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") 1478 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1457 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) 1479 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1458 1480
1459 Runtime::Function* function() const { return hydrogen()->function(); } 1481 Runtime::Function* function() const { return hydrogen()->function(); }
1460 int arity() const { return hydrogen()->argument_count(); } 1482 int arity() const { return hydrogen()->argument_count(); }
1461 }; 1483 };
1462 1484
1463 1485
1464 class LInteger32ToDouble: public LUnaryOperation { 1486 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1465 public: 1487 public:
1466 explicit LInteger32ToDouble(LOperand* use) : LUnaryOperation(use) { } 1488 explicit LInteger32ToDouble(LOperand* value) {
1489 inputs_[0] = value;
1490 }
1467 1491
1468 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") 1492 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1469 }; 1493 };
1470 1494
1471 1495
1472 class LNumberTagI: public LUnaryOperation { 1496 class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1473 public: 1497 public:
1474 explicit LNumberTagI(LOperand* use) : LUnaryOperation(use) { } 1498 explicit LNumberTagI(LOperand* value) {
1499 inputs_[0] = value;
1500 }
1475 1501
1476 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") 1502 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1477 }; 1503 };
1478 1504
1479 1505
1480 class LNumberTagD: public LUnaryOperation { 1506 class LNumberTagD: public LTemplateInstruction<1, 1, 1> {
1481 public: 1507 public:
1482 explicit LNumberTagD(LOperand* value, LOperand* temp) 1508 LNumberTagD(LOperand* value, LOperand* temp) {
1483 : LUnaryOperation(value), temp_(temp) { } 1509 inputs_[0] = value;
1510 temps_[0] = temp;
1511 }
1484 1512
1485 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") 1513 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1486
1487 LOperand* temp() const { return temp_; }
1488
1489 private:
1490 LOperand* temp_;
1491 }; 1514 };
1492 1515
1493 1516
1494 // Sometimes truncating conversion from a tagged value to an int32. 1517 // Sometimes truncating conversion from a tagged value to an int32.
1495 class LDoubleToI: public LUnaryOperation { 1518 class LDoubleToI: public LTemplateInstruction<1, 1, 1> {
1496 public: 1519 public:
1497 explicit LDoubleToI(LOperand* value) : LUnaryOperation(value) { } 1520 LDoubleToI(LOperand* value, LOperand* temp) {
1521 inputs_[0] = value;
1522 temps_[0] = temp;
1523 }
1498 1524
1499 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") 1525 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1500 DECLARE_HYDROGEN_ACCESSOR(Change) 1526 DECLARE_HYDROGEN_ACCESSOR(Change)
1501 1527
1502 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1528 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1503 }; 1529 };
1504 1530
1505 1531
1506 // Truncating conversion from a tagged value to an int32. 1532 // Truncating conversion from a tagged value to an int32.
1507 class LTaggedToI: public LUnaryOperation { 1533 class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
1508 public: 1534 public:
1509 LTaggedToI(LOperand* value, LOperand* temp) 1535 LTaggedToI(LOperand* value, LOperand* temp) {
1510 : LUnaryOperation(value), temp_(temp) { } 1536 inputs_[0] = value;
1537 temps_[0] = temp;
1538 }
1511 1539
1512 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") 1540 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1513 DECLARE_HYDROGEN_ACCESSOR(Change) 1541 DECLARE_HYDROGEN_ACCESSOR(Change)
1514 1542
1515 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1543 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1516 LOperand* temp() const { return temp_; }
1517
1518 private:
1519 LOperand* temp_;
1520 }; 1544 };
1521 1545
1522 1546
1523 class LSmiTag: public LUnaryOperation { 1547 class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1524 public: 1548 public:
1525 explicit LSmiTag(LOperand* use) : LUnaryOperation(use) { } 1549 explicit LSmiTag(LOperand* value) {
1550 inputs_[0] = value;
1551 }
1526 1552
1527 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") 1553 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1528 }; 1554 };
1529 1555
1530 1556
1531 class LNumberUntagD: public LUnaryOperation { 1557 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1532 public: 1558 public:
1533 explicit LNumberUntagD(LOperand* value) : LUnaryOperation(value) { } 1559 explicit LNumberUntagD(LOperand* value) {
1560 inputs_[0] = value;
1561 }
1534 1562
1535 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") 1563 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1536 }; 1564 };
1537 1565
1538 1566
1539 class LSmiUntag: public LUnaryOperation { 1567 class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1540 public: 1568 public:
1541 LSmiUntag(LOperand* use, bool needs_check) 1569 LSmiUntag(LOperand* value, bool needs_check)
1542 : LUnaryOperation(use), needs_check_(needs_check) { } 1570 : needs_check_(needs_check) {
1571 inputs_[0] = value;
1572 }
1543 1573
1544 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") 1574 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1545 1575
1546 bool needs_check() const { return needs_check_; } 1576 bool needs_check() const { return needs_check_; }
1547 1577
1548 private: 1578 private:
1549 bool needs_check_; 1579 bool needs_check_;
1550 }; 1580 };
1551 1581
1552 1582
1553 class LStoreNamed: public LInstruction { 1583 class LStoreNamed: public LTemplateInstruction<0, 2, 1> {
1554 public: 1584 public:
1555 LStoreNamed(LOperand* obj, Handle<Object> name, LOperand* val) 1585 LStoreNamed(LOperand* obj, LOperand* val) {
1556 : object_(obj), name_(name), value_(val) { } 1586 inputs_[0] = obj;
1587 inputs_[1] = val;
1588 }
1557 1589
1558 DECLARE_INSTRUCTION(StoreNamed) 1590 DECLARE_INSTRUCTION(StoreNamed)
1591 DECLARE_HYDROGEN_ACCESSOR(StoreNamed)
1559 1592
1560 virtual void PrintDataTo(StringStream* stream) const; 1593 virtual void PrintDataTo(StringStream* stream);
1561 1594
1562 LOperand* object() const { return object_; } 1595 LOperand* object() { return inputs_[0]; }
1563 Handle<Object> name() const { return name_; } 1596 LOperand* value() { return inputs_[1]; }
1564 LOperand* value() const { return value_; } 1597 Handle<Object> name() const { return hydrogen()->name(); }
1565
1566 private:
1567 LOperand* object_;
1568 Handle<Object> name_;
1569 LOperand* value_;
1570 }; 1598 };
1571 1599
1572 1600
1573 class LStoreNamedField: public LStoreNamed { 1601 class LStoreNamedField: public LStoreNamed {
1574 public: 1602 public:
1575 LStoreNamedField(LOperand* obj, 1603 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp)
1576 Handle<Object> name, 1604 : LStoreNamed(obj, val) {
1577 LOperand* val, 1605 temps_[0] = temp;
1578 bool in_object, 1606 }
1579 int offset,
1580 LOperand* temp,
1581 bool needs_write_barrier,
1582 Handle<Map> transition)
1583 : LStoreNamed(obj, name, val),
1584 is_in_object_(in_object),
1585 offset_(offset),
1586 temp_(temp),
1587 needs_write_barrier_(needs_write_barrier),
1588 transition_(transition) { }
1589 1607
1590 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1608 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1609 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1591 1610
1592 bool is_in_object() { return is_in_object_; } 1611 bool is_in_object() { return hydrogen()->is_in_object(); }
1593 int offset() { return offset_; } 1612 int offset() { return hydrogen()->offset(); }
1594 LOperand* temp() { return temp_; } 1613 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); }
1595 bool needs_write_barrier() { return needs_write_barrier_; } 1614 Handle<Map> transition() const { return hydrogen()->transition(); }
1596 Handle<Map> transition() const { return transition_; }
1597 void set_transition(Handle<Map> map) { transition_ = map; }
1598
1599 private:
1600 bool is_in_object_;
1601 int offset_;
1602 LOperand* temp_;
1603 bool needs_write_barrier_;
1604 Handle<Map> transition_;
1605 }; 1615 };
1606 1616
1607 1617
1608 class LStoreNamedGeneric: public LStoreNamed { 1618 class LStoreNamedGeneric: public LTemplateInstruction<0, 3, 0> {
1609 public: 1619 public:
1610 LStoreNamedGeneric(LOperand* obj, 1620 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value) {
1611 Handle<Object> name, 1621 inputs_[0] = context;
1612 LOperand* val) 1622 inputs_[1] = object;
1613 : LStoreNamed(obj, name, val) { } 1623 inputs_[2] = value;
1624 }
1614 1625
1615 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1626 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1627 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1628
1629 LOperand* context() { return inputs_[0]; }
1630 LOperand* object() { return inputs_[1]; }
1631 LOperand* value() { return inputs_[2]; }
1632 Handle<Object> name() const { return hydrogen()->name(); }
1616 }; 1633 };
1617 1634
1618 1635
1619 class LStoreKeyed: public LInstruction { 1636 class LStoreKeyed: public LTemplateInstruction<0, 3, 0> {
1620 public: 1637 public:
1621 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) 1638 LStoreKeyed(LOperand* obj, LOperand* key, LOperand* val) {
1622 : object_(obj), key_(key), value_(val) { } 1639 inputs_[0] = obj;
1640 inputs_[1] = key;
1641 inputs_[2] = val;
1642 }
1623 1643
1624 DECLARE_INSTRUCTION(StoreKeyed) 1644 DECLARE_INSTRUCTION(StoreKeyed)
1625 1645
1626 virtual void PrintDataTo(StringStream* stream) const; 1646 virtual void PrintDataTo(StringStream* stream);
1627 1647
1628 LOperand* object() const { return object_; } 1648 LOperand* object() { return inputs_[0]; }
1629 LOperand* key() const { return key_; } 1649 LOperand* key() { return inputs_[1]; }
1630 LOperand* value() const { return value_; } 1650 LOperand* value() { return inputs_[2]; }
1631
1632 private:
1633 LOperand* object_;
1634 LOperand* key_;
1635 LOperand* value_;
1636 }; 1651 };
1637 1652
1638 1653
1639 class LStoreKeyedFastElement: public LStoreKeyed { 1654 class LStoreKeyedFastElement: public LStoreKeyed {
1640 public: 1655 public:
1641 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) 1656 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val)
1642 : LStoreKeyed(obj, key, val) {} 1657 : LStoreKeyed(obj, key, val) {}
1643 1658
1644 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, 1659 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1645 "store-keyed-fast-element") 1660 "store-keyed-fast-element")
1646 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) 1661 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1647 }; 1662 };
1648 1663
1649 1664
1650 class LStoreKeyedGeneric: public LStoreKeyed { 1665 class LStoreKeyedGeneric: public LTemplateInstruction<0, 4, 0> {
1651 public: 1666 public:
1652 LStoreKeyedGeneric(LOperand* obj, LOperand* key, LOperand* val) 1667 LStoreKeyedGeneric(LOperand* context,
1653 : LStoreKeyed(obj, key, val) { } 1668 LOperand* object,
1669 LOperand* key,
1670 LOperand* value) {
1671 inputs_[0] = context;
1672 inputs_[1] = object;
1673 inputs_[2] = key;
1674 inputs_[3] = value;
1675 }
1654 1676
1655 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 1677 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1678
1679 LOperand* context() { return inputs_[0]; }
1680 LOperand* object() { return inputs_[1]; }
1681 LOperand* key() { return inputs_[2]; }
1682 LOperand* value() { return inputs_[3]; }
1656 }; 1683 };
1657 1684
1658 1685
1659 class LCheckFunction: public LUnaryOperation { 1686 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1660 public: 1687 public:
1661 explicit LCheckFunction(LOperand* use) : LUnaryOperation(use) { } 1688 LStringCharCodeAt(LOperand* string, LOperand* index) {
1689 inputs_[0] = string;
1690 inputs_[1] = index;
1691 }
1692
1693 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1694 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1695
1696 LOperand* string() { return inputs_[0]; }
1697 LOperand* index() { return inputs_[1]; }
1698 };
1699
1700
1701 class LStringLength: public LTemplateInstruction<1, 1, 0> {
1702 public:
1703 explicit LStringLength(LOperand* string) {
1704 inputs_[0] = string;
1705 }
1706
1707 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1708 DECLARE_HYDROGEN_ACCESSOR(StringLength)
1709
1710 LOperand* string() { return inputs_[0]; }
1711 };
1712
1713
1714 class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
1715 public:
1716 explicit LCheckFunction(LOperand* value) {
1717 inputs_[0] = value;
1718 }
1662 1719
1663 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") 1720 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1664 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) 1721 DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1665 }; 1722 };
1666 1723
1667 1724
1668 class LCheckInstanceType: public LUnaryOperation { 1725 class LCheckInstanceType: public LTemplateInstruction<0, 1, 1> {
1669 public: 1726 public:
1670 LCheckInstanceType(LOperand* use, LOperand* temp) 1727 LCheckInstanceType(LOperand* value, LOperand* temp) {
1671 : LUnaryOperation(use), temp_(temp) { } 1728 inputs_[0] = value;
1729 temps_[0] = temp;
1730 }
1672 1731
1673 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") 1732 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1674 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) 1733 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1675
1676 LOperand* temp() const { return temp_; }
1677
1678 private:
1679 LOperand* temp_;
1680 }; 1734 };
1681 1735
1682 1736
1683 class LCheckMap: public LUnaryOperation { 1737 class LCheckMap: public LTemplateInstruction<0, 1, 0> {
1684 public: 1738 public:
1685 explicit LCheckMap(LOperand* use) : LUnaryOperation(use) { } 1739 explicit LCheckMap(LOperand* value) {
1740 inputs_[0] = value;
1741 }
1686 1742
1687 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") 1743 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map")
1688 DECLARE_HYDROGEN_ACCESSOR(CheckMap) 1744 DECLARE_HYDROGEN_ACCESSOR(CheckMap)
1689 }; 1745 };
1690 1746
1691 1747
1692 class LCheckPrototypeMaps: public LInstruction { 1748 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> {
1693 public: 1749 public:
1694 LCheckPrototypeMaps(LOperand* temp, 1750 explicit LCheckPrototypeMaps(LOperand* temp) {
1695 Handle<JSObject> holder, 1751 temps_[0] = temp;
1696 Handle<Map> receiver_map) 1752 }
1697 : temp_(temp),
1698 holder_(holder),
1699 receiver_map_(receiver_map) { }
1700 1753
1701 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") 1754 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1755 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1702 1756
1703 LOperand* temp() const { return temp_; } 1757 Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1704 Handle<JSObject> holder() const { return holder_; } 1758 Handle<JSObject> holder() const { return hydrogen()->holder(); }
1705 Handle<Map> receiver_map() const { return receiver_map_; }
1706
1707 private:
1708 LOperand* temp_;
1709 Handle<JSObject> holder_;
1710 Handle<Map> receiver_map_;
1711 }; 1759 };
1712 1760
1713 1761
1714 class LCheckSmi: public LUnaryOperation { 1762 class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
1715 public: 1763 public:
1716 LCheckSmi(LOperand* use, Condition condition) 1764 LCheckSmi(LOperand* value, Condition condition)
1717 : LUnaryOperation(use), condition_(condition) { } 1765 : condition_(condition) {
1766 inputs_[0] = value;
1767 }
1718 1768
1719 Condition condition() const { return condition_; } 1769 Condition condition() const { return condition_; }
1720 1770
1721 virtual void CompileToNative(LCodeGen* generator); 1771 virtual void CompileToNative(LCodeGen* generator);
1722 virtual const char* Mnemonic() const { 1772 virtual const char* Mnemonic() const {
1723 return (condition_ == zero) ? "check-non-smi" : "check-smi"; 1773 return (condition_ == zero) ? "check-non-smi" : "check-smi";
1724 } 1774 }
1725 1775
1726 private: 1776 private:
1727 Condition condition_; 1777 Condition condition_;
1728 }; 1778 };
1729 1779
1730 1780
1731 class LMaterializedLiteral: public LInstruction { 1781 class LArrayLiteral: public LTemplateInstruction<1, 0, 0> {
1732 public:
1733 DECLARE_INSTRUCTION(MaterializedLiteral)
1734 };
1735
1736
1737 class LArrayLiteral: public LMaterializedLiteral {
1738 public: 1782 public:
1739 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal") 1783 DECLARE_CONCRETE_INSTRUCTION(ArrayLiteral, "array-literal")
1740 DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral) 1784 DECLARE_HYDROGEN_ACCESSOR(ArrayLiteral)
1741 }; 1785 };
1742 1786
1743 1787
1744 class LObjectLiteral: public LMaterializedLiteral { 1788 class LObjectLiteral: public LTemplateInstruction<1, 1, 0> {
1745 public: 1789 public:
1790 explicit LObjectLiteral(LOperand* context) {
1791 inputs_[0] = context;
1792 }
1793
1746 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal") 1794 DECLARE_CONCRETE_INSTRUCTION(ObjectLiteral, "object-literal")
1747 DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral) 1795 DECLARE_HYDROGEN_ACCESSOR(ObjectLiteral)
1796
1797 LOperand* context() { return inputs_[0]; }
1748 }; 1798 };
1749 1799
1750 1800
1751 class LRegExpLiteral: public LMaterializedLiteral { 1801 class LRegExpLiteral: public LTemplateInstruction<1, 0, 0> {
1752 public: 1802 public:
1753 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal") 1803 DECLARE_CONCRETE_INSTRUCTION(RegExpLiteral, "regexp-literal")
1754 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral) 1804 DECLARE_HYDROGEN_ACCESSOR(RegExpLiteral)
1755 }; 1805 };
1756 1806
1757 1807
1758 class LFunctionLiteral: public LInstruction { 1808 class LFunctionLiteral: public LTemplateInstruction<1, 0, 0> {
1759 public: 1809 public:
1760 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal") 1810 DECLARE_CONCRETE_INSTRUCTION(FunctionLiteral, "function-literal")
1761 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral) 1811 DECLARE_HYDROGEN_ACCESSOR(FunctionLiteral)
1762 1812
1763 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } 1813 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
1764 }; 1814 };
1765 1815
1766 1816
1767 class LTypeof: public LUnaryOperation { 1817 class LTypeof: public LTemplateInstruction<1, 1, 0> {
1768 public: 1818 public:
1769 explicit LTypeof(LOperand* input) : LUnaryOperation(input) { } 1819 explicit LTypeof(LOperand* value) {
1820 inputs_[0] = value;
1821 }
1770 1822
1771 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") 1823 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
1772 }; 1824 };
1773 1825
1774 1826
1775 class LTypeofIs: public LUnaryOperation { 1827 class LTypeofIs: public LTemplateInstruction<1, 1, 0> {
1776 public: 1828 public:
1777 explicit LTypeofIs(LOperand* input) : LUnaryOperation(input) { } 1829 explicit LTypeofIs(LOperand* value) {
1778 virtual void PrintDataTo(StringStream* stream) const; 1830 inputs_[0] = value;
1831 }
1779 1832
1780 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") 1833 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is")
1781 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) 1834 DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
1782 1835
1783 Handle<String> type_literal() { return hydrogen()->type_literal(); } 1836 Handle<String> type_literal() { return hydrogen()->type_literal(); }
1837
1838 virtual void PrintDataTo(StringStream* stream);
1784 }; 1839 };
1785 1840
1786 1841
1787 class LTypeofIsAndBranch: public LTypeofIs { 1842 class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
1788 public: 1843 public:
1789 LTypeofIsAndBranch(LOperand* value, 1844 explicit LTypeofIsAndBranch(LOperand* value) {
1790 int true_block_id, 1845 inputs_[0] = value;
1791 int false_block_id) 1846 }
1792 : LTypeofIs(value),
1793 true_block_id_(true_block_id),
1794 false_block_id_(false_block_id) { }
1795 1847
1796 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") 1848 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
1849 DECLARE_HYDROGEN_ACCESSOR(TypeofIs)
1797 1850
1798 virtual void PrintDataTo(StringStream* stream) const; 1851 Handle<String> type_literal() { return hydrogen()->type_literal(); }
1799 virtual bool IsControl() const { return true; }
1800 1852
1801 int true_block_id() const { return true_block_id_; } 1853 virtual void PrintDataTo(StringStream* stream);
1802 int false_block_id() const { return false_block_id_; }
1803
1804 private:
1805 int true_block_id_;
1806 int false_block_id_;
1807 }; 1854 };
1808 1855
1809 1856
1810 class LDeleteProperty: public LBinaryOperation { 1857 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
1811 public: 1858 public:
1812 LDeleteProperty(LOperand* obj, LOperand* key) : LBinaryOperation(obj, key) {} 1859 LDeleteProperty(LOperand* obj, LOperand* key) {
1860 inputs_[0] = obj;
1861 inputs_[1] = key;
1862 }
1813 1863
1814 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") 1864 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
1815 1865
1816 LOperand* object() const { return left(); } 1866 LOperand* object() { return inputs_[0]; }
1817 LOperand* key() const { return right(); } 1867 LOperand* key() { return inputs_[1]; }
1818 }; 1868 };
1819 1869
1820 1870
1821 class LOsrEntry: public LInstruction { 1871 class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
1822 public: 1872 public:
1823 LOsrEntry(); 1873 LOsrEntry();
1824 1874
1825 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") 1875 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
1826 1876
1827 LOperand** SpilledRegisterArray() { return register_spills_; } 1877 LOperand** SpilledRegisterArray() { return register_spills_; }
1828 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } 1878 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; }
1829 1879
1830 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); 1880 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand);
1831 void MarkSpilledDoubleRegister(int allocation_index, 1881 void MarkSpilledDoubleRegister(int allocation_index,
1832 LOperand* spill_operand); 1882 LOperand* spill_operand);
1833 1883
1834 private: 1884 private:
1835 // Arrays of spill slot operands for registers with an assigned spill 1885 // Arrays of spill slot operands for registers with an assigned spill
1836 // slot, i.e., that must also be restored to the spill slot on OSR entry. 1886 // slot, i.e., that must also be restored to the spill slot on OSR entry.
1837 // NULL if the register has no assigned spill slot. Indexed by allocation 1887 // NULL if the register has no assigned spill slot. Indexed by allocation
1838 // index. 1888 // index.
1839 LOperand* register_spills_[Register::kNumAllocatableRegisters]; 1889 LOperand* register_spills_[Register::kNumAllocatableRegisters];
1840 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters]; 1890 LOperand* double_register_spills_[DoubleRegister::kNumAllocatableRegisters];
1841 }; 1891 };
1842 1892
1843 1893
1844 class LStackCheck: public LInstruction { 1894 class LStackCheck: public LTemplateInstruction<0, 0, 0> {
1845 public: 1895 public:
1846 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 1896 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
1847 }; 1897 };
1848 1898
1849 1899
1850 class LPointerMap: public ZoneObject {
1851 public:
1852 explicit LPointerMap(int position)
1853 : pointer_operands_(8), position_(position), lithium_position_(-1) { }
1854
1855 const ZoneList<LOperand*>* operands() const { return &pointer_operands_; }
1856 int position() const { return position_; }
1857 int lithium_position() const { return lithium_position_; }
1858
1859 void set_lithium_position(int pos) {
1860 ASSERT(lithium_position_ == -1);
1861 lithium_position_ = pos;
1862 }
1863
1864 void RecordPointer(LOperand* op);
1865 void PrintTo(StringStream* stream) const;
1866
1867 private:
1868 ZoneList<LOperand*> pointer_operands_;
1869 int position_;
1870 int lithium_position_;
1871 };
1872
1873
1874 class LEnvironment: public ZoneObject {
1875 public:
1876 LEnvironment(Handle<JSFunction> closure,
1877 int ast_id,
1878 int parameter_count,
1879 int argument_count,
1880 int value_count,
1881 LEnvironment* outer)
1882 : closure_(closure),
1883 arguments_stack_height_(argument_count),
1884 deoptimization_index_(Safepoint::kNoDeoptimizationIndex),
1885 translation_index_(-1),
1886 ast_id_(ast_id),
1887 parameter_count_(parameter_count),
1888 values_(value_count),
1889 representations_(value_count),
1890 spilled_registers_(NULL),
1891 spilled_double_registers_(NULL),
1892 outer_(outer) {
1893 }
1894
1895 Handle<JSFunction> closure() const { return closure_; }
1896 int arguments_stack_height() const { return arguments_stack_height_; }
1897 int deoptimization_index() const { return deoptimization_index_; }
1898 int translation_index() const { return translation_index_; }
1899 int ast_id() const { return ast_id_; }
1900 int parameter_count() const { return parameter_count_; }
1901 const ZoneList<LOperand*>* values() const { return &values_; }
1902 LEnvironment* outer() const { return outer_; }
1903
1904 void AddValue(LOperand* operand, Representation representation) {
1905 values_.Add(operand);
1906 representations_.Add(representation);
1907 }
1908
1909 bool HasTaggedValueAt(int index) const {
1910 return representations_[index].IsTagged();
1911 }
1912
1913 void Register(int deoptimization_index, int translation_index) {
1914 ASSERT(!HasBeenRegistered());
1915 deoptimization_index_ = deoptimization_index;
1916 translation_index_ = translation_index;
1917 }
1918 bool HasBeenRegistered() const {
1919 return deoptimization_index_ != Safepoint::kNoDeoptimizationIndex;
1920 }
1921
1922 void SetSpilledRegisters(LOperand** registers,
1923 LOperand** double_registers) {
1924 spilled_registers_ = registers;
1925 spilled_double_registers_ = double_registers;
1926 }
1927
1928 // Emit frame translation commands for this environment.
1929 void WriteTranslation(LCodeGen* cgen, Translation* translation) const;
1930
1931 void PrintTo(StringStream* stream) const;
1932
1933 private:
1934 Handle<JSFunction> closure_;
1935 int arguments_stack_height_;
1936 int deoptimization_index_;
1937 int translation_index_;
1938 int ast_id_;
1939 int parameter_count_;
1940 ZoneList<LOperand*> values_;
1941 ZoneList<Representation> representations_;
1942
1943 // Allocation index indexed arrays of spill slot operands for registers
1944 // that are also in spill slots at an OSR entry. NULL for environments
1945 // that do not correspond to an OSR entry.
1946 LOperand** spilled_registers_;
1947 LOperand** spilled_double_registers_;
1948
1949 LEnvironment* outer_;
1950 };
1951
1952 class LChunkBuilder; 1900 class LChunkBuilder;
1953 class LChunk: public ZoneObject { 1901 class LChunk: public ZoneObject {
1954 public: 1902 public:
1955 explicit LChunk(HGraph* graph); 1903 explicit LChunk(HGraph* graph)
1904 : spill_slot_count_(0),
1905 graph_(graph),
1906 instructions_(32),
1907 pointer_maps_(8),
1908 inlined_closures_(1) { }
1956 1909
1957 int AddInstruction(LInstruction* instruction, HBasicBlock* block); 1910 void AddInstruction(LInstruction* instruction, HBasicBlock* block);
1958 LConstantOperand* DefineConstantOperand(HConstant* constant); 1911 LConstantOperand* DefineConstantOperand(HConstant* constant);
1959 Handle<Object> LookupLiteral(LConstantOperand* operand) const; 1912 Handle<Object> LookupLiteral(LConstantOperand* operand) const;
1960 Representation LookupLiteralRepresentation(LConstantOperand* operand) const; 1913 Representation LookupLiteralRepresentation(LConstantOperand* operand) const;
1961 1914
1962 int GetNextSpillIndex(bool is_double); 1915 int GetNextSpillIndex(bool is_double);
1963 LOperand* GetNextSpillSlot(bool is_double); 1916 LOperand* GetNextSpillSlot(bool is_double);
1964 1917
1965 int ParameterAt(int index); 1918 int ParameterAt(int index);
1966 int GetParameterStackSlot(int index) const; 1919 int GetParameterStackSlot(int index) const;
1967 int spill_slot_count() const { return spill_slot_count_; } 1920 int spill_slot_count() const { return spill_slot_count_; }
(...skipping 24 matching lines...) Expand all
1992 } 1945 }
1993 1946
1994 const ZoneList<Handle<JSFunction> >* inlined_closures() const { 1947 const ZoneList<Handle<JSFunction> >* inlined_closures() const {
1995 return &inlined_closures_; 1948 return &inlined_closures_;
1996 } 1949 }
1997 1950
1998 void AddInlinedClosure(Handle<JSFunction> closure) { 1951 void AddInlinedClosure(Handle<JSFunction> closure) {
1999 inlined_closures_.Add(closure); 1952 inlined_closures_.Add(closure);
2000 } 1953 }
2001 1954
2002 void Verify() const;
2003
2004 private: 1955 private:
2005 int spill_slot_count_; 1956 int spill_slot_count_;
2006 HGraph* const graph_; 1957 HGraph* const graph_;
2007 ZoneList<LInstruction*> instructions_; 1958 ZoneList<LInstruction*> instructions_;
2008 ZoneList<LPointerMap*> pointer_maps_; 1959 ZoneList<LPointerMap*> pointer_maps_;
2009 ZoneList<Handle<JSFunction> > inlined_closures_; 1960 ZoneList<Handle<JSFunction> > inlined_closures_;
2010 }; 1961 };
2011 1962
2012 1963
2013 class LChunkBuilder BASE_EMBEDDED { 1964 class LChunkBuilder BASE_EMBEDDED {
2014 public: 1965 public:
2015 LChunkBuilder(HGraph* graph, LAllocator* allocator) 1966 LChunkBuilder(HGraph* graph, LAllocator* allocator)
2016 : chunk_(NULL), 1967 : chunk_(NULL),
2017 graph_(graph), 1968 graph_(graph),
2018 status_(UNUSED), 1969 status_(UNUSED),
2019 current_instruction_(NULL), 1970 current_instruction_(NULL),
2020 current_block_(NULL), 1971 current_block_(NULL),
2021 next_block_(NULL), 1972 next_block_(NULL),
2022 argument_count_(0), 1973 argument_count_(0),
2023 allocator_(allocator), 1974 allocator_(allocator),
2024 position_(RelocInfo::kNoPosition), 1975 position_(RelocInfo::kNoPosition),
2025 instructions_pending_deoptimization_environment_(NULL), 1976 instruction_pending_deoptimization_environment_(NULL),
2026 pending_deoptimization_ast_id_(AstNode::kNoNumber) { } 1977 pending_deoptimization_ast_id_(AstNode::kNoNumber) { }
2027 1978
2028 // Build the sequence for the graph. 1979 // Build the sequence for the graph.
2029 LChunk* Build(); 1980 LChunk* Build();
2030 1981
2031 // Declare methods that deal with the individual node types. 1982 // Declare methods that deal with the individual node types.
2032 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node); 1983 #define DECLARE_DO(type) LInstruction* Do##type(H##type* node);
2033 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO) 1984 HYDROGEN_CONCRETE_INSTRUCTION_LIST(DECLARE_DO)
2034 #undef DECLARE_DO 1985 #undef DECLARE_DO
2035 1986
(...skipping 14 matching lines...) Expand all
2050 bool is_aborted() const { return status_ == ABORTED; } 2001 bool is_aborted() const { return status_ == ABORTED; }
2051 2002
2052 void Abort(const char* format, ...); 2003 void Abort(const char* format, ...);
2053 2004
2054 // Methods for getting operands for Use / Define / Temp. 2005 // Methods for getting operands for Use / Define / Temp.
2055 LRegister* ToOperand(Register reg); 2006 LRegister* ToOperand(Register reg);
2056 LUnallocated* ToUnallocated(Register reg); 2007 LUnallocated* ToUnallocated(Register reg);
2057 LUnallocated* ToUnallocated(XMMRegister reg); 2008 LUnallocated* ToUnallocated(XMMRegister reg);
2058 2009
2059 // Methods for setting up define-use relationships. 2010 // Methods for setting up define-use relationships.
2060 LOperand* Use(HValue* value, LUnallocated* operand); 2011 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand);
2061 LOperand* UseFixed(HValue* value, Register fixed_register); 2012 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register);
2062 LOperand* UseFixedDouble(HValue* value, XMMRegister fixed_register); 2013 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value,
2014 XMMRegister fixed_register);
2063 2015
2064 // A value that is guaranteed to be allocated to a register. 2016 // A value that is guaranteed to be allocated to a register.
2065 // Operand created by UseRegister is guaranteed to be live until the end of 2017 // Operand created by UseRegister is guaranteed to be live until the end of
2066 // instruction. This means that register allocator will not reuse it's 2018 // instruction. This means that register allocator will not reuse it's
2067 // register for any other operand inside instruction. 2019 // register for any other operand inside instruction.
2068 // Operand created by UseRegisterAtStart is guaranteed to be live only at 2020 // Operand created by UseRegisterAtStart is guaranteed to be live only at
2069 // instruction start. Register allocator is free to assign the same register 2021 // instruction start. Register allocator is free to assign the same register
2070 // to some other operand used inside instruction (i.e. temporary or 2022 // to some other operand used inside instruction (i.e. temporary or
2071 // output). 2023 // output).
2072 LOperand* UseRegister(HValue* value); 2024 MUST_USE_RESULT LOperand* UseRegister(HValue* value);
2073 LOperand* UseRegisterAtStart(HValue* value); 2025 MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value);
2074 2026
2075 // A value in a register that may be trashed. 2027 // An input operand in a register that may be trashed.
2076 LOperand* UseTempRegister(HValue* value); 2028 MUST_USE_RESULT LOperand* UseTempRegister(HValue* value);
2077 LOperand* Use(HValue* value); 2029
2078 LOperand* UseAtStart(HValue* value); 2030 // An input operand in a register or stack slot.
2079 LOperand* UseOrConstant(HValue* value); 2031 MUST_USE_RESULT LOperand* Use(HValue* value);
2080 LOperand* UseOrConstantAtStart(HValue* value); 2032 MUST_USE_RESULT LOperand* UseAtStart(HValue* value);
2081 LOperand* UseRegisterOrConstant(HValue* value); 2033
2082 LOperand* UseRegisterOrConstantAtStart(HValue* value); 2034 // An input operand in a register, stack slot or a constant operand.
2035 MUST_USE_RESULT LOperand* UseOrConstant(HValue* value);
2036 MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value);
2037
2038 // An input operand in a register or a constant operand.
2039 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value);
2040 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value);
2041
2042 // An input operand in register, stack slot or a constant operand.
2043 // Will not be moved to a register even if one is freely available.
2044 MUST_USE_RESULT LOperand* UseAny(HValue* value);
2045
2046 // Temporary operand that must be in a register.
2047 MUST_USE_RESULT LUnallocated* TempRegister();
2048 MUST_USE_RESULT LOperand* FixedTemp(Register reg);
2049 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg);
2083 2050
2084 // Methods for setting up define-use relationships. 2051 // Methods for setting up define-use relationships.
2085 // Return the same instruction that they are passed. 2052 // Return the same instruction that they are passed.
2086 LInstruction* Define(LInstruction* instr, LUnallocated* result); 2053 template<int I, int T>
2087 LInstruction* Define(LInstruction* instr); 2054 LInstruction* Define(LTemplateInstruction<1, I, T>* instr,
2088 LInstruction* DefineAsRegister(LInstruction* instr); 2055 LUnallocated* result);
2089 LInstruction* DefineAsSpilled(LInstruction* instr, int index); 2056 template<int I, int T>
2090 LInstruction* DefineSameAsFirst(LInstruction* instr); 2057 LInstruction* Define(LTemplateInstruction<1, I, T>* instr);
2091 LInstruction* DefineFixed(LInstruction* instr, Register reg); 2058 template<int I, int T>
2092 LInstruction* DefineFixedDouble(LInstruction* instr, XMMRegister reg); 2059 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr);
2060 template<int I, int T>
2061 LInstruction* DefineAsSpilled(LTemplateInstruction<1, I, T>* instr,
2062 int index);
2063 template<int I, int T>
2064 LInstruction* DefineSameAsFirst(LTemplateInstruction<1, I, T>* instr);
2065 template<int I, int T>
2066 LInstruction* DefineFixed(LTemplateInstruction<1, I, T>* instr,
2067 Register reg);
2068 template<int I, int T>
2069 LInstruction* DefineFixedDouble(LTemplateInstruction<1, I, T>* instr,
2070 XMMRegister reg);
2093 LInstruction* AssignEnvironment(LInstruction* instr); 2071 LInstruction* AssignEnvironment(LInstruction* instr);
2094 LInstruction* AssignPointerMap(LInstruction* instr); 2072 LInstruction* AssignPointerMap(LInstruction* instr);
2095 2073
2096 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY }; 2074 enum CanDeoptimize { CAN_DEOPTIMIZE_EAGERLY, CANNOT_DEOPTIMIZE_EAGERLY };
2097 2075
2098 // By default we assume that instruction sequences generated for calls 2076 // By default we assume that instruction sequences generated for calls
2099 // cannot deoptimize eagerly and we do not attach environment to this 2077 // cannot deoptimize eagerly and we do not attach environment to this
2100 // instruction. 2078 // instruction.
2101 LInstruction* MarkAsCall( 2079 LInstruction* MarkAsCall(
2102 LInstruction* instr, 2080 LInstruction* instr,
2103 HInstruction* hinstr, 2081 HInstruction* hinstr,
2104 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); 2082 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY);
2083 LInstruction* MarkAsSaveDoubles(LInstruction* instr);
2105 2084
2106 LInstruction* SetInstructionPendingDeoptimizationEnvironment( 2085 LInstruction* SetInstructionPendingDeoptimizationEnvironment(
2107 LInstruction* instr, int ast_id); 2086 LInstruction* instr, int ast_id);
2108 void ClearInstructionPendingDeoptimizationEnvironment(); 2087 void ClearInstructionPendingDeoptimizationEnvironment();
2109 2088
2110 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); 2089 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env);
2111 2090
2112 // Temporary operand that may be a memory location.
2113 LOperand* Temp();
2114 // Temporary operand that must be in a register.
2115 LUnallocated* TempRegister();
2116 LOperand* FixedTemp(Register reg);
2117 LOperand* FixedTemp(XMMRegister reg);
2118
2119 void VisitInstruction(HInstruction* current); 2091 void VisitInstruction(HInstruction* current);
2120 2092
2121 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); 2093 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block);
2122 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); 2094 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr);
2123 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); 2095 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr);
2124 LInstruction* DoArithmeticD(Token::Value op, 2096 LInstruction* DoArithmeticD(Token::Value op,
2125 HArithmeticBinaryOperation* instr); 2097 HArithmeticBinaryOperation* instr);
2126 LInstruction* DoArithmeticT(Token::Value op, 2098 LInstruction* DoArithmeticT(Token::Value op,
2127 HArithmeticBinaryOperation* instr); 2099 HArithmeticBinaryOperation* instr);
2128 2100
2129 LChunk* chunk_; 2101 LChunk* chunk_;
2130 HGraph* const graph_; 2102 HGraph* const graph_;
2131 Status status_; 2103 Status status_;
2132 HInstruction* current_instruction_; 2104 HInstruction* current_instruction_;
2133 HBasicBlock* current_block_; 2105 HBasicBlock* current_block_;
2134 HBasicBlock* next_block_; 2106 HBasicBlock* next_block_;
2135 int argument_count_; 2107 int argument_count_;
2136 LAllocator* allocator_; 2108 LAllocator* allocator_;
2137 int position_; 2109 int position_;
2138 LInstruction* instructions_pending_deoptimization_environment_; 2110 LInstruction* instruction_pending_deoptimization_environment_;
2139 int pending_deoptimization_ast_id_; 2111 int pending_deoptimization_ast_id_;
2140 2112
2141 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2113 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2142 }; 2114 };
2143 2115
2144 #undef DECLARE_HYDROGEN_ACCESSOR 2116 #undef DECLARE_HYDROGEN_ACCESSOR
2145 #undef DECLARE_INSTRUCTION 2117 #undef DECLARE_INSTRUCTION
2146 #undef DECLARE_CONCRETE_INSTRUCTION 2118 #undef DECLARE_CONCRETE_INSTRUCTION
2147 2119
2148 } } // namespace v8::internal 2120 } } // namespace v8::internal
2149 2121
2150 #endif // V8_IA32_LITHIUM_IA32_H_ 2122 #endif // V8_IA32_LITHIUM_IA32_H_
OLDNEW
« no previous file with comments | « src/ia32/lithium-gap-resolver-ia32.cc ('k') | src/ia32/lithium-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698