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

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

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

Powered by Google App Engine
This is Rietveld 408576698