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

Side by Side Diff: src/crankshaft/s390/lithium-s390.h

Issue 1763233003: S390: Initial Impl of Crankshaft features (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « src/crankshaft/s390/lithium-gap-resolver-s390.cc ('k') | src/crankshaft/s390/lithium-s390.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ 5 #ifndef V8_CRANKSHAFT_S390_LITHIUM_S390_H_
6 #define V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ 6 #define V8_CRANKSHAFT_S390_LITHIUM_S390_H_
7 7
8 #include "src/crankshaft/hydrogen.h" 8 #include "src/crankshaft/hydrogen.h"
9 #include "src/crankshaft/lithium.h" 9 #include "src/crankshaft/lithium.h"
10 #include "src/crankshaft/lithium-allocator.h" 10 #include "src/crankshaft/lithium-allocator.h"
11 #include "src/safepoint-table.h" 11 #include "src/safepoint-table.h"
12 #include "src/utils.h" 12 #include "src/utils.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 V(ThisFunction) \ 146 V(ThisFunction) \
147 V(ToFastProperties) \ 147 V(ToFastProperties) \
148 V(TransitionElementsKind) \ 148 V(TransitionElementsKind) \
149 V(TrapAllocationMemento) \ 149 V(TrapAllocationMemento) \
150 V(Typeof) \ 150 V(Typeof) \
151 V(TypeofIsAndBranch) \ 151 V(TypeofIsAndBranch) \
152 V(Uint32ToDouble) \ 152 V(Uint32ToDouble) \
153 V(UnknownOSRValue) \ 153 V(UnknownOSRValue) \
154 V(WrapReceiver) 154 V(WrapReceiver)
155 155
156
157 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \ 156 #define DECLARE_CONCRETE_INSTRUCTION(type, mnemonic) \
158 Opcode opcode() const final { return LInstruction::k##type; } \ 157 Opcode opcode() const final { return LInstruction::k##type; } \
159 void CompileToNative(LCodeGen* generator) final; \ 158 void CompileToNative(LCodeGen* generator) final; \
160 const char* Mnemonic() const final { return mnemonic; } \ 159 const char* Mnemonic() const final { return mnemonic; } \
161 static L##type* cast(LInstruction* instr) { \ 160 static L##type* cast(LInstruction* instr) { \
162 DCHECK(instr->Is##type()); \ 161 DCHECK(instr->Is##type()); \
163 return reinterpret_cast<L##type*>(instr); \ 162 return reinterpret_cast<L##type*>(instr); \
164 } 163 }
165 164
166
167 #define DECLARE_HYDROGEN_ACCESSOR(type) \ 165 #define DECLARE_HYDROGEN_ACCESSOR(type) \
168 H##type* hydrogen() const { return H##type::cast(hydrogen_value()); } 166 H##type* hydrogen() const { return H##type::cast(hydrogen_value()); }
169 167
170
171 class LInstruction : public ZoneObject { 168 class LInstruction : public ZoneObject {
172 public: 169 public:
173 LInstruction() 170 LInstruction()
174 : environment_(NULL), 171 : environment_(NULL),
175 hydrogen_value_(NULL), 172 hydrogen_value_(NULL),
176 bit_field_(IsCallBits::encode(false)) {} 173 bit_field_(IsCallBits::encode(false)) {}
177 174
178 virtual ~LInstruction() {} 175 virtual ~LInstruction() {}
179 176
180 virtual void CompileToNative(LCodeGen* generator) = 0; 177 virtual void CompileToNative(LCodeGen* generator) = 0;
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 virtual LOperand* TempAt(int i) = 0; 252 virtual LOperand* TempAt(int i) = 0;
256 253
257 class IsCallBits : public BitField<bool, 0, 1> {}; 254 class IsCallBits : public BitField<bool, 0, 1> {};
258 255
259 LEnvironment* environment_; 256 LEnvironment* environment_;
260 SetOncePointer<LPointerMap> pointer_map_; 257 SetOncePointer<LPointerMap> pointer_map_;
261 HValue* hydrogen_value_; 258 HValue* hydrogen_value_;
262 int bit_field_; 259 int bit_field_;
263 }; 260 };
264 261
265
266 // R = number of result operands (0 or 1). 262 // R = number of result operands (0 or 1).
267 template <int R> 263 template <int R>
268 class LTemplateResultInstruction : public LInstruction { 264 class LTemplateResultInstruction : public LInstruction {
269 public: 265 public:
270 // Allow 0 or 1 output operands. 266 // Allow 0 or 1 output operands.
271 STATIC_ASSERT(R == 0 || R == 1); 267 STATIC_ASSERT(R == 0 || R == 1);
272 bool HasResult() const final { return R != 0 && result() != NULL; } 268 bool HasResult() const final { return R != 0 && result() != NULL; }
273 void set_result(LOperand* operand) { results_[0] = operand; } 269 void set_result(LOperand* operand) { results_[0] = operand; }
274 LOperand* result() const override { return results_[0]; } 270 LOperand* result() const override { return results_[0]; }
275 271
276 protected: 272 protected:
277 EmbeddedContainer<LOperand*, R> results_; 273 EmbeddedContainer<LOperand*, R> results_;
278 }; 274 };
279 275
280
281 // R = number of result operands (0 or 1). 276 // R = number of result operands (0 or 1).
282 // I = number of input operands. 277 // I = number of input operands.
283 // T = number of temporary operands. 278 // T = number of temporary operands.
284 template <int R, int I, int T> 279 template <int R, int I, int T>
285 class LTemplateInstruction : public LTemplateResultInstruction<R> { 280 class LTemplateInstruction : public LTemplateResultInstruction<R> {
286 protected: 281 protected:
287 EmbeddedContainer<LOperand*, I> inputs_; 282 EmbeddedContainer<LOperand*, I> inputs_;
288 EmbeddedContainer<LOperand*, T> temps_; 283 EmbeddedContainer<LOperand*, T> temps_;
289 284
290 private: 285 private:
291 // Iterator support. 286 // Iterator support.
292 int InputCount() final { return I; } 287 int InputCount() final { return I; }
293 LOperand* InputAt(int i) final { return inputs_[i]; } 288 LOperand* InputAt(int i) final { return inputs_[i]; }
294 289
295 int TempCount() final { return T; } 290 int TempCount() final { return T; }
296 LOperand* TempAt(int i) final { return temps_[i]; } 291 LOperand* TempAt(int i) final { return temps_[i]; }
297 }; 292 };
298 293
299
300 class LGap : public LTemplateInstruction<0, 0, 0> { 294 class LGap : public LTemplateInstruction<0, 0, 0> {
301 public: 295 public:
302 explicit LGap(HBasicBlock* block) : block_(block) { 296 explicit LGap(HBasicBlock* block) : block_(block) {
303 parallel_moves_[BEFORE] = NULL; 297 parallel_moves_[BEFORE] = NULL;
304 parallel_moves_[START] = NULL; 298 parallel_moves_[START] = NULL;
305 parallel_moves_[END] = NULL; 299 parallel_moves_[END] = NULL;
306 parallel_moves_[AFTER] = NULL; 300 parallel_moves_[AFTER] = NULL;
307 } 301 }
308 302
309 // Can't use the DECLARE-macro here because of sub-classes. 303 // Can't use the DECLARE-macro here because of sub-classes.
(...skipping 26 matching lines...) Expand all
336 330
337 LParallelMove* GetParallelMove(InnerPosition pos) { 331 LParallelMove* GetParallelMove(InnerPosition pos) {
338 return parallel_moves_[pos]; 332 return parallel_moves_[pos];
339 } 333 }
340 334
341 private: 335 private:
342 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; 336 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1];
343 HBasicBlock* block_; 337 HBasicBlock* block_;
344 }; 338 };
345 339
346
347 class LInstructionGap final : public LGap { 340 class LInstructionGap final : public LGap {
348 public: 341 public:
349 explicit LInstructionGap(HBasicBlock* block) : LGap(block) {} 342 explicit LInstructionGap(HBasicBlock* block) : LGap(block) {}
350 343
351 bool HasInterestingComment(LCodeGen* gen) const override { 344 bool HasInterestingComment(LCodeGen* gen) const override {
352 return !IsRedundant(); 345 return !IsRedundant();
353 } 346 }
354 347
355 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") 348 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap")
356 }; 349 };
357 350
358
359 class LGoto final : public LTemplateInstruction<0, 0, 0> { 351 class LGoto final : public LTemplateInstruction<0, 0, 0> {
360 public: 352 public:
361 explicit LGoto(HBasicBlock* block) : block_(block) {} 353 explicit LGoto(HBasicBlock* block) : block_(block) {}
362 354
363 bool HasInterestingComment(LCodeGen* gen) const override; 355 bool HasInterestingComment(LCodeGen* gen) const override;
364 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") 356 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto")
365 void PrintDataTo(StringStream* stream) override; 357 void PrintDataTo(StringStream* stream) override;
366 bool IsControl() const override { return true; } 358 bool IsControl() const override { return true; }
367 359
368 int block_id() const { return block_->block_id(); } 360 int block_id() const { return block_->block_id(); }
369 361
370 private: 362 private:
371 HBasicBlock* block_; 363 HBasicBlock* block_;
372 }; 364 };
373 365
374
375 class LPrologue final : public LTemplateInstruction<0, 0, 0> { 366 class LPrologue final : public LTemplateInstruction<0, 0, 0> {
376 public: 367 public:
377 DECLARE_CONCRETE_INSTRUCTION(Prologue, "prologue") 368 DECLARE_CONCRETE_INSTRUCTION(Prologue, "prologue")
378 }; 369 };
379 370
380
381 class LLazyBailout final : public LTemplateInstruction<0, 0, 0> { 371 class LLazyBailout final : public LTemplateInstruction<0, 0, 0> {
382 public: 372 public:
383 LLazyBailout() : gap_instructions_size_(0) {} 373 LLazyBailout() : gap_instructions_size_(0) {}
384 374
385 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") 375 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout")
386 376
387 void set_gap_instructions_size(int gap_instructions_size) { 377 void set_gap_instructions_size(int gap_instructions_size) {
388 gap_instructions_size_ = gap_instructions_size; 378 gap_instructions_size_ = gap_instructions_size;
389 } 379 }
390 int gap_instructions_size() { return gap_instructions_size_; } 380 int gap_instructions_size() { return gap_instructions_size_; }
391 381
392 private: 382 private:
393 int gap_instructions_size_; 383 int gap_instructions_size_;
394 }; 384 };
395 385
396
397 class LDummy final : public LTemplateInstruction<1, 0, 0> { 386 class LDummy final : public LTemplateInstruction<1, 0, 0> {
398 public: 387 public:
399 LDummy() {} 388 LDummy() {}
400 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy") 389 DECLARE_CONCRETE_INSTRUCTION(Dummy, "dummy")
401 }; 390 };
402 391
403
404 class LDummyUse final : public LTemplateInstruction<1, 1, 0> { 392 class LDummyUse final : public LTemplateInstruction<1, 1, 0> {
405 public: 393 public:
406 explicit LDummyUse(LOperand* value) { inputs_[0] = value; } 394 explicit LDummyUse(LOperand* value) { inputs_[0] = value; }
407 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") 395 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use")
408 }; 396 };
409 397
410
411 class LDeoptimize final : public LTemplateInstruction<0, 0, 0> { 398 class LDeoptimize final : public LTemplateInstruction<0, 0, 0> {
412 public: 399 public:
413 bool IsControl() const override { return true; } 400 bool IsControl() const override { return true; }
414 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") 401 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize")
415 DECLARE_HYDROGEN_ACCESSOR(Deoptimize) 402 DECLARE_HYDROGEN_ACCESSOR(Deoptimize)
416 }; 403 };
417 404
418
419 class LLabel final : public LGap { 405 class LLabel final : public LGap {
420 public: 406 public:
421 explicit LLabel(HBasicBlock* block) : LGap(block), replacement_(NULL) {} 407 explicit LLabel(HBasicBlock* block) : LGap(block), replacement_(NULL) {}
422 408
423 bool HasInterestingComment(LCodeGen* gen) const override { return false; } 409 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
424 DECLARE_CONCRETE_INSTRUCTION(Label, "label") 410 DECLARE_CONCRETE_INSTRUCTION(Label, "label")
425 411
426 void PrintDataTo(StringStream* stream) override; 412 void PrintDataTo(StringStream* stream) override;
427 413
428 int block_id() const { return block()->block_id(); } 414 int block_id() const { return block()->block_id(); }
429 bool is_loop_header() const { return block()->IsLoopHeader(); } 415 bool is_loop_header() const { return block()->IsLoopHeader(); }
430 bool is_osr_entry() const { return block()->is_osr_entry(); } 416 bool is_osr_entry() const { return block()->is_osr_entry(); }
431 Label* label() { return &label_; } 417 Label* label() { return &label_; }
432 LLabel* replacement() const { return replacement_; } 418 LLabel* replacement() const { return replacement_; }
433 void set_replacement(LLabel* label) { replacement_ = label; } 419 void set_replacement(LLabel* label) { replacement_ = label; }
434 bool HasReplacement() const { return replacement_ != NULL; } 420 bool HasReplacement() const { return replacement_ != NULL; }
435 421
436 private: 422 private:
437 Label label_; 423 Label label_;
438 LLabel* replacement_; 424 LLabel* replacement_;
439 }; 425 };
440 426
441
442 class LParameter final : public LTemplateInstruction<1, 0, 0> { 427 class LParameter final : public LTemplateInstruction<1, 0, 0> {
443 public: 428 public:
444 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } 429 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; }
445 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") 430 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter")
446 }; 431 };
447 432
448
449 class LUnknownOSRValue final : public LTemplateInstruction<1, 0, 0> { 433 class LUnknownOSRValue final : public LTemplateInstruction<1, 0, 0> {
450 public: 434 public:
451 bool HasInterestingComment(LCodeGen* gen) const override { return false; } 435 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
452 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") 436 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value")
453 }; 437 };
454 438
455
456 template <int I, int T> 439 template <int I, int T>
457 class LControlInstruction : public LTemplateInstruction<0, I, T> { 440 class LControlInstruction : public LTemplateInstruction<0, I, T> {
458 public: 441 public:
459 LControlInstruction() : false_label_(NULL), true_label_(NULL) {} 442 LControlInstruction() : false_label_(NULL), true_label_(NULL) {}
460 443
461 bool IsControl() const final { return true; } 444 bool IsControl() const final { return true; }
462 445
463 int SuccessorCount() { return hydrogen()->SuccessorCount(); } 446 int SuccessorCount() { return hydrogen()->SuccessorCount(); }
464 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); } 447 HBasicBlock* SuccessorAt(int i) { return hydrogen()->SuccessorAt(i); }
465 448
(...skipping 23 matching lines...) Expand all
489 472
490 private: 473 private:
491 HControlInstruction* hydrogen() { 474 HControlInstruction* hydrogen() {
492 return HControlInstruction::cast(this->hydrogen_value()); 475 return HControlInstruction::cast(this->hydrogen_value());
493 } 476 }
494 477
495 Label* false_label_; 478 Label* false_label_;
496 Label* true_label_; 479 Label* true_label_;
497 }; 480 };
498 481
499
500 class LWrapReceiver final : public LTemplateInstruction<1, 2, 0> { 482 class LWrapReceiver final : public LTemplateInstruction<1, 2, 0> {
501 public: 483 public:
502 LWrapReceiver(LOperand* receiver, LOperand* function) { 484 LWrapReceiver(LOperand* receiver, LOperand* function) {
503 inputs_[0] = receiver; 485 inputs_[0] = receiver;
504 inputs_[1] = function; 486 inputs_[1] = function;
505 } 487 }
506 488
507 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver") 489 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
508 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver) 490 DECLARE_HYDROGEN_ACCESSOR(WrapReceiver)
509 491
510 LOperand* receiver() { return inputs_[0]; } 492 LOperand* receiver() { return inputs_[0]; }
511 LOperand* function() { return inputs_[1]; } 493 LOperand* function() { return inputs_[1]; }
512 }; 494 };
513 495
514
515 class LApplyArguments final : public LTemplateInstruction<1, 4, 0> { 496 class LApplyArguments final : public LTemplateInstruction<1, 4, 0> {
516 public: 497 public:
517 LApplyArguments(LOperand* function, LOperand* receiver, LOperand* length, 498 LApplyArguments(LOperand* function, LOperand* receiver, LOperand* length,
518 LOperand* elements) { 499 LOperand* elements) {
519 inputs_[0] = function; 500 inputs_[0] = function;
520 inputs_[1] = receiver; 501 inputs_[1] = receiver;
521 inputs_[2] = length; 502 inputs_[2] = length;
522 inputs_[3] = elements; 503 inputs_[3] = elements;
523 } 504 }
524 505
525 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments") 506 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
526 507
527 LOperand* function() { return inputs_[0]; } 508 LOperand* function() { return inputs_[0]; }
528 LOperand* receiver() { return inputs_[1]; } 509 LOperand* receiver() { return inputs_[1]; }
529 LOperand* length() { return inputs_[2]; } 510 LOperand* length() { return inputs_[2]; }
530 LOperand* elements() { return inputs_[3]; } 511 LOperand* elements() { return inputs_[3]; }
531 }; 512 };
532 513
533
534 class LAccessArgumentsAt final : public LTemplateInstruction<1, 3, 0> { 514 class LAccessArgumentsAt final : public LTemplateInstruction<1, 3, 0> {
535 public: 515 public:
536 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) { 516 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
537 inputs_[0] = arguments; 517 inputs_[0] = arguments;
538 inputs_[1] = length; 518 inputs_[1] = length;
539 inputs_[2] = index; 519 inputs_[2] = index;
540 } 520 }
541 521
542 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at") 522 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
543 523
544 LOperand* arguments() { return inputs_[0]; } 524 LOperand* arguments() { return inputs_[0]; }
545 LOperand* length() { return inputs_[1]; } 525 LOperand* length() { return inputs_[1]; }
546 LOperand* index() { return inputs_[2]; } 526 LOperand* index() { return inputs_[2]; }
547 527
548 void PrintDataTo(StringStream* stream) override; 528 void PrintDataTo(StringStream* stream) override;
549 }; 529 };
550 530
551
552 class LArgumentsLength final : public LTemplateInstruction<1, 1, 0> { 531 class LArgumentsLength final : public LTemplateInstruction<1, 1, 0> {
553 public: 532 public:
554 explicit LArgumentsLength(LOperand* elements) { inputs_[0] = elements; } 533 explicit LArgumentsLength(LOperand* elements) { inputs_[0] = elements; }
555 534
556 LOperand* elements() { return inputs_[0]; } 535 LOperand* elements() { return inputs_[0]; }
557 536
558 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") 537 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
559 }; 538 };
560 539
561
562 class LArgumentsElements final : public LTemplateInstruction<1, 0, 0> { 540 class LArgumentsElements final : public LTemplateInstruction<1, 0, 0> {
563 public: 541 public:
564 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") 542 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
565 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements) 543 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
566 }; 544 };
567 545
568
569 class LModByPowerOf2I final : public LTemplateInstruction<1, 1, 0> { 546 class LModByPowerOf2I final : public LTemplateInstruction<1, 1, 0> {
570 public: 547 public:
571 LModByPowerOf2I(LOperand* dividend, int32_t divisor) { 548 LModByPowerOf2I(LOperand* dividend, int32_t divisor) {
572 inputs_[0] = dividend; 549 inputs_[0] = dividend;
573 divisor_ = divisor; 550 divisor_ = divisor;
574 } 551 }
575 552
576 LOperand* dividend() { return inputs_[0]; } 553 LOperand* dividend() { return inputs_[0]; }
577 int32_t divisor() const { return divisor_; } 554 int32_t divisor() const { return divisor_; }
578 555
579 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i") 556 DECLARE_CONCRETE_INSTRUCTION(ModByPowerOf2I, "mod-by-power-of-2-i")
580 DECLARE_HYDROGEN_ACCESSOR(Mod) 557 DECLARE_HYDROGEN_ACCESSOR(Mod)
581 558
582 private: 559 private:
583 int32_t divisor_; 560 int32_t divisor_;
584 }; 561 };
585 562
586
587 class LModByConstI final : public LTemplateInstruction<1, 1, 0> { 563 class LModByConstI final : public LTemplateInstruction<1, 1, 0> {
588 public: 564 public:
589 LModByConstI(LOperand* dividend, int32_t divisor) { 565 LModByConstI(LOperand* dividend, int32_t divisor) {
590 inputs_[0] = dividend; 566 inputs_[0] = dividend;
591 divisor_ = divisor; 567 divisor_ = divisor;
592 } 568 }
593 569
594 LOperand* dividend() { return inputs_[0]; } 570 LOperand* dividend() { return inputs_[0]; }
595 int32_t divisor() const { return divisor_; } 571 int32_t divisor() const { return divisor_; }
596 572
597 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i") 573 DECLARE_CONCRETE_INSTRUCTION(ModByConstI, "mod-by-const-i")
598 DECLARE_HYDROGEN_ACCESSOR(Mod) 574 DECLARE_HYDROGEN_ACCESSOR(Mod)
599 575
600 private: 576 private:
601 int32_t divisor_; 577 int32_t divisor_;
602 }; 578 };
603 579
604
605 class LModI final : public LTemplateInstruction<1, 2, 0> { 580 class LModI final : public LTemplateInstruction<1, 2, 0> {
606 public: 581 public:
607 LModI(LOperand* left, LOperand* right) { 582 LModI(LOperand* left, LOperand* right) {
608 inputs_[0] = left; 583 inputs_[0] = left;
609 inputs_[1] = right; 584 inputs_[1] = right;
610 } 585 }
611 586
612 LOperand* left() { return inputs_[0]; } 587 LOperand* left() { return inputs_[0]; }
613 LOperand* right() { return inputs_[1]; } 588 LOperand* right() { return inputs_[1]; }
614 589
615 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") 590 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
616 DECLARE_HYDROGEN_ACCESSOR(Mod) 591 DECLARE_HYDROGEN_ACCESSOR(Mod)
617 }; 592 };
618 593
619
620 class LDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> { 594 class LDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> {
621 public: 595 public:
622 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 596 LDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
623 inputs_[0] = dividend; 597 inputs_[0] = dividend;
624 divisor_ = divisor; 598 divisor_ = divisor;
625 } 599 }
626 600
627 LOperand* dividend() { return inputs_[0]; } 601 LOperand* dividend() { return inputs_[0]; }
628 int32_t divisor() const { return divisor_; } 602 int32_t divisor() const { return divisor_; }
629 603
630 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i") 604 DECLARE_CONCRETE_INSTRUCTION(DivByPowerOf2I, "div-by-power-of-2-i")
631 DECLARE_HYDROGEN_ACCESSOR(Div) 605 DECLARE_HYDROGEN_ACCESSOR(Div)
632 606
633 private: 607 private:
634 int32_t divisor_; 608 int32_t divisor_;
635 }; 609 };
636 610
637
638 class LDivByConstI final : public LTemplateInstruction<1, 1, 0> { 611 class LDivByConstI final : public LTemplateInstruction<1, 1, 0> {
639 public: 612 public:
640 LDivByConstI(LOperand* dividend, int32_t divisor) { 613 LDivByConstI(LOperand* dividend, int32_t divisor) {
641 inputs_[0] = dividend; 614 inputs_[0] = dividend;
642 divisor_ = divisor; 615 divisor_ = divisor;
643 } 616 }
644 617
645 LOperand* dividend() { return inputs_[0]; } 618 LOperand* dividend() { return inputs_[0]; }
646 int32_t divisor() const { return divisor_; } 619 int32_t divisor() const { return divisor_; }
647 620
648 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i") 621 DECLARE_CONCRETE_INSTRUCTION(DivByConstI, "div-by-const-i")
649 DECLARE_HYDROGEN_ACCESSOR(Div) 622 DECLARE_HYDROGEN_ACCESSOR(Div)
650 623
651 private: 624 private:
652 int32_t divisor_; 625 int32_t divisor_;
653 }; 626 };
654 627
655
656 class LDivI final : public LTemplateInstruction<1, 2, 0> { 628 class LDivI final : public LTemplateInstruction<1, 2, 0> {
657 public: 629 public:
658 LDivI(LOperand* dividend, LOperand* divisor) { 630 LDivI(LOperand* dividend, LOperand* divisor) {
659 inputs_[0] = dividend; 631 inputs_[0] = dividend;
660 inputs_[1] = divisor; 632 inputs_[1] = divisor;
661 } 633 }
662 634
663 LOperand* dividend() { return inputs_[0]; } 635 LOperand* dividend() { return inputs_[0]; }
664 LOperand* divisor() { return inputs_[1]; } 636 LOperand* divisor() { return inputs_[1]; }
665 637
666 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 638 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
667 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 639 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
668 }; 640 };
669 641
670
671 class LFlooringDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> { 642 class LFlooringDivByPowerOf2I final : public LTemplateInstruction<1, 1, 0> {
672 public: 643 public:
673 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) { 644 LFlooringDivByPowerOf2I(LOperand* dividend, int32_t divisor) {
674 inputs_[0] = dividend; 645 inputs_[0] = dividend;
675 divisor_ = divisor; 646 divisor_ = divisor;
676 } 647 }
677 648
678 LOperand* dividend() { return inputs_[0]; } 649 LOperand* dividend() { return inputs_[0]; }
679 int32_t divisor() { return divisor_; } 650 int32_t divisor() { return divisor_; }
680 651
681 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I, 652 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByPowerOf2I,
682 "flooring-div-by-power-of-2-i") 653 "flooring-div-by-power-of-2-i")
683 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 654 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
684 655
685 private: 656 private:
686 int32_t divisor_; 657 int32_t divisor_;
687 }; 658 };
688 659
689
690 class LFlooringDivByConstI final : public LTemplateInstruction<1, 1, 1> { 660 class LFlooringDivByConstI final : public LTemplateInstruction<1, 1, 1> {
691 public: 661 public:
692 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) { 662 LFlooringDivByConstI(LOperand* dividend, int32_t divisor, LOperand* temp) {
693 inputs_[0] = dividend; 663 inputs_[0] = dividend;
694 divisor_ = divisor; 664 divisor_ = divisor;
695 temps_[0] = temp; 665 temps_[0] = temp;
696 } 666 }
697 667
698 LOperand* dividend() { return inputs_[0]; } 668 LOperand* dividend() { return inputs_[0]; }
699 int32_t divisor() const { return divisor_; } 669 int32_t divisor() const { return divisor_; }
700 LOperand* temp() { return temps_[0]; } 670 LOperand* temp() { return temps_[0]; }
701 671
702 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i") 672 DECLARE_CONCRETE_INSTRUCTION(FlooringDivByConstI, "flooring-div-by-const-i")
703 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 673 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
704 674
705 private: 675 private:
706 int32_t divisor_; 676 int32_t divisor_;
707 }; 677 };
708 678
709
710 class LFlooringDivI final : public LTemplateInstruction<1, 2, 0> { 679 class LFlooringDivI final : public LTemplateInstruction<1, 2, 0> {
711 public: 680 public:
712 LFlooringDivI(LOperand* dividend, LOperand* divisor) { 681 LFlooringDivI(LOperand* dividend, LOperand* divisor) {
713 inputs_[0] = dividend; 682 inputs_[0] = dividend;
714 inputs_[1] = divisor; 683 inputs_[1] = divisor;
715 } 684 }
716 685
717 LOperand* dividend() { return inputs_[0]; } 686 LOperand* dividend() { return inputs_[0]; }
718 LOperand* divisor() { return inputs_[1]; } 687 LOperand* divisor() { return inputs_[1]; }
719 688
720 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i") 689 DECLARE_CONCRETE_INSTRUCTION(FlooringDivI, "flooring-div-i")
721 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 690 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
722 }; 691 };
723 692
724
725 class LMulI final : public LTemplateInstruction<1, 2, 0> { 693 class LMulI final : public LTemplateInstruction<1, 2, 0> {
726 public: 694 public:
727 LMulI(LOperand* left, LOperand* right) { 695 LMulI(LOperand* left, LOperand* right) {
728 inputs_[0] = left; 696 inputs_[0] = left;
729 inputs_[1] = right; 697 inputs_[1] = right;
730 } 698 }
731 699
732 LOperand* left() { return inputs_[0]; } 700 LOperand* left() { return inputs_[0]; }
733 LOperand* right() { return inputs_[1]; } 701 LOperand* right() { return inputs_[1]; }
734 702
735 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 703 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
736 DECLARE_HYDROGEN_ACCESSOR(Mul) 704 DECLARE_HYDROGEN_ACCESSOR(Mul)
737 }; 705 };
738 706
739
740 // Instruction for computing multiplier * multiplicand + addend. 707 // Instruction for computing multiplier * multiplicand + addend.
741 class LMultiplyAddD final : public LTemplateInstruction<1, 3, 0> { 708 class LMultiplyAddD final : public LTemplateInstruction<1, 3, 0> {
742 public: 709 public:
743 LMultiplyAddD(LOperand* addend, LOperand* multiplier, 710 LMultiplyAddD(LOperand* addend, LOperand* multiplier,
744 LOperand* multiplicand) { 711 LOperand* multiplicand) {
745 inputs_[0] = addend; 712 inputs_[0] = addend;
746 inputs_[1] = multiplier; 713 inputs_[1] = multiplier;
747 inputs_[2] = multiplicand; 714 inputs_[2] = multiplicand;
748 } 715 }
749 716
750 LOperand* addend() { return inputs_[0]; } 717 LOperand* addend() { return inputs_[0]; }
751 LOperand* multiplier() { return inputs_[1]; } 718 LOperand* multiplier() { return inputs_[1]; }
752 LOperand* multiplicand() { return inputs_[2]; } 719 LOperand* multiplicand() { return inputs_[2]; }
753 720
754 DECLARE_CONCRETE_INSTRUCTION(MultiplyAddD, "multiply-add-d") 721 DECLARE_CONCRETE_INSTRUCTION(MultiplyAddD, "multiply-add-d")
755 }; 722 };
756 723
757
758 // Instruction for computing minuend - multiplier * multiplicand. 724 // Instruction for computing minuend - multiplier * multiplicand.
759 class LMultiplySubD final : public LTemplateInstruction<1, 3, 0> { 725 class LMultiplySubD final : public LTemplateInstruction<1, 3, 0> {
760 public: 726 public:
761 LMultiplySubD(LOperand* minuend, LOperand* multiplier, 727 LMultiplySubD(LOperand* minuend, LOperand* multiplier,
762 LOperand* multiplicand) { 728 LOperand* multiplicand) {
763 inputs_[0] = minuend; 729 inputs_[0] = minuend;
764 inputs_[1] = multiplier; 730 inputs_[1] = multiplier;
765 inputs_[2] = multiplicand; 731 inputs_[2] = multiplicand;
766 } 732 }
767 733
768 LOperand* minuend() { return inputs_[0]; } 734 LOperand* minuend() { return inputs_[0]; }
769 LOperand* multiplier() { return inputs_[1]; } 735 LOperand* multiplier() { return inputs_[1]; }
770 LOperand* multiplicand() { return inputs_[2]; } 736 LOperand* multiplicand() { return inputs_[2]; }
771 737
772 DECLARE_CONCRETE_INSTRUCTION(MultiplySubD, "multiply-sub-d") 738 DECLARE_CONCRETE_INSTRUCTION(MultiplySubD, "multiply-sub-d")
773 }; 739 };
774 740
775
776 class LDebugBreak final : public LTemplateInstruction<0, 0, 0> { 741 class LDebugBreak final : public LTemplateInstruction<0, 0, 0> {
777 public: 742 public:
778 DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break") 743 DECLARE_CONCRETE_INSTRUCTION(DebugBreak, "break")
779 }; 744 };
780 745
781
782 class LCompareNumericAndBranch final : public LControlInstruction<2, 0> { 746 class LCompareNumericAndBranch final : public LControlInstruction<2, 0> {
783 public: 747 public:
784 LCompareNumericAndBranch(LOperand* left, LOperand* right) { 748 LCompareNumericAndBranch(LOperand* left, LOperand* right) {
785 inputs_[0] = left; 749 inputs_[0] = left;
786 inputs_[1] = right; 750 inputs_[1] = right;
787 } 751 }
788 752
789 LOperand* left() { return inputs_[0]; } 753 LOperand* left() { return inputs_[0]; }
790 LOperand* right() { return inputs_[1]; } 754 LOperand* right() { return inputs_[1]; }
791 755
792 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch, 756 DECLARE_CONCRETE_INSTRUCTION(CompareNumericAndBranch,
793 "compare-numeric-and-branch") 757 "compare-numeric-and-branch")
794 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch) 758 DECLARE_HYDROGEN_ACCESSOR(CompareNumericAndBranch)
795 759
796 Token::Value op() const { return hydrogen()->token(); } 760 Token::Value op() const { return hydrogen()->token(); }
797 bool is_double() const { return hydrogen()->representation().IsDouble(); } 761 bool is_double() const { return hydrogen()->representation().IsDouble(); }
798 762
799 void PrintDataTo(StringStream* stream) override; 763 void PrintDataTo(StringStream* stream) override;
800 }; 764 };
801 765
802
803 class LMathFloor final : public LTemplateInstruction<1, 1, 0> { 766 class LMathFloor final : public LTemplateInstruction<1, 1, 0> {
804 public: 767 public:
805 explicit LMathFloor(LOperand* value) { inputs_[0] = value; } 768 explicit LMathFloor(LOperand* value) { inputs_[0] = value; }
806 769
807 LOperand* value() { return inputs_[0]; } 770 LOperand* value() { return inputs_[0]; }
808 771
809 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor") 772 DECLARE_CONCRETE_INSTRUCTION(MathFloor, "math-floor")
810 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 773 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
811 }; 774 };
812 775
813
814 class LMathRound final : public LTemplateInstruction<1, 1, 1> { 776 class LMathRound final : public LTemplateInstruction<1, 1, 1> {
815 public: 777 public:
816 LMathRound(LOperand* value, LOperand* temp) { 778 LMathRound(LOperand* value, LOperand* temp) {
817 inputs_[0] = value; 779 inputs_[0] = value;
818 temps_[0] = temp; 780 temps_[0] = temp;
819 } 781 }
820 782
821 LOperand* value() { return inputs_[0]; } 783 LOperand* value() { return inputs_[0]; }
822 LOperand* temp() { return temps_[0]; } 784 LOperand* temp() { return temps_[0]; }
823 785
824 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round") 786 DECLARE_CONCRETE_INSTRUCTION(MathRound, "math-round")
825 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 787 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
826 }; 788 };
827 789
828
829 class LMathFround final : public LTemplateInstruction<1, 1, 0> { 790 class LMathFround final : public LTemplateInstruction<1, 1, 0> {
830 public: 791 public:
831 explicit LMathFround(LOperand* value) { inputs_[0] = value; } 792 explicit LMathFround(LOperand* value) { inputs_[0] = value; }
832 793
833 LOperand* value() { return inputs_[0]; } 794 LOperand* value() { return inputs_[0]; }
834 795
835 DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround") 796 DECLARE_CONCRETE_INSTRUCTION(MathFround, "math-fround")
836 }; 797 };
837 798
838
839 class LMathAbs final : public LTemplateInstruction<1, 2, 0> { 799 class LMathAbs final : public LTemplateInstruction<1, 2, 0> {
840 public: 800 public:
841 LMathAbs(LOperand* context, LOperand* value) { 801 LMathAbs(LOperand* context, LOperand* value) {
842 inputs_[1] = context; 802 inputs_[1] = context;
843 inputs_[0] = value; 803 inputs_[0] = value;
844 } 804 }
845 805
846 LOperand* context() { return inputs_[1]; } 806 LOperand* context() { return inputs_[1]; }
847 LOperand* value() { return inputs_[0]; } 807 LOperand* value() { return inputs_[0]; }
848 808
849 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs") 809 DECLARE_CONCRETE_INSTRUCTION(MathAbs, "math-abs")
850 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 810 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
851 }; 811 };
852 812
853
854 class LMathLog final : public LTemplateInstruction<1, 1, 0> { 813 class LMathLog final : public LTemplateInstruction<1, 1, 0> {
855 public: 814 public:
856 explicit LMathLog(LOperand* value) { inputs_[0] = value; } 815 explicit LMathLog(LOperand* value) { inputs_[0] = value; }
857 816
858 LOperand* value() { return inputs_[0]; } 817 LOperand* value() { return inputs_[0]; }
859 818
860 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log") 819 DECLARE_CONCRETE_INSTRUCTION(MathLog, "math-log")
861 }; 820 };
862 821
863
864 class LMathClz32 final : public LTemplateInstruction<1, 1, 0> { 822 class LMathClz32 final : public LTemplateInstruction<1, 1, 0> {
865 public: 823 public:
866 explicit LMathClz32(LOperand* value) { inputs_[0] = value; } 824 explicit LMathClz32(LOperand* value) { inputs_[0] = value; }
867 825
868 LOperand* value() { return inputs_[0]; } 826 LOperand* value() { return inputs_[0]; }
869 827
870 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32") 828 DECLARE_CONCRETE_INSTRUCTION(MathClz32, "math-clz32")
871 }; 829 };
872 830
873
874 class LMathExp final : public LTemplateInstruction<1, 1, 3> { 831 class LMathExp final : public LTemplateInstruction<1, 1, 3> {
875 public: 832 public:
876 LMathExp(LOperand* value, LOperand* double_temp, LOperand* temp1, 833 LMathExp(LOperand* value, LOperand* double_temp, LOperand* temp1,
877 LOperand* temp2) { 834 LOperand* temp2) {
878 inputs_[0] = value; 835 inputs_[0] = value;
879 temps_[0] = temp1; 836 temps_[0] = temp1;
880 temps_[1] = temp2; 837 temps_[1] = temp2;
881 temps_[2] = double_temp; 838 temps_[2] = double_temp;
882 ExternalReference::InitializeMathExpData(); 839 ExternalReference::InitializeMathExpData();
883 } 840 }
884 841
885 LOperand* value() { return inputs_[0]; } 842 LOperand* value() { return inputs_[0]; }
886 LOperand* temp1() { return temps_[0]; } 843 LOperand* temp1() { return temps_[0]; }
887 LOperand* temp2() { return temps_[1]; } 844 LOperand* temp2() { return temps_[1]; }
888 LOperand* double_temp() { return temps_[2]; } 845 LOperand* double_temp() { return temps_[2]; }
889 846
890 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp") 847 DECLARE_CONCRETE_INSTRUCTION(MathExp, "math-exp")
891 }; 848 };
892 849
893
894 class LMathSqrt final : public LTemplateInstruction<1, 1, 0> { 850 class LMathSqrt final : public LTemplateInstruction<1, 1, 0> {
895 public: 851 public:
896 explicit LMathSqrt(LOperand* value) { inputs_[0] = value; } 852 explicit LMathSqrt(LOperand* value) { inputs_[0] = value; }
897 853
898 LOperand* value() { return inputs_[0]; } 854 LOperand* value() { return inputs_[0]; }
899 855
900 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt") 856 DECLARE_CONCRETE_INSTRUCTION(MathSqrt, "math-sqrt")
901 }; 857 };
902 858
903
904 class LMathPowHalf final : public LTemplateInstruction<1, 1, 0> { 859 class LMathPowHalf final : public LTemplateInstruction<1, 1, 0> {
905 public: 860 public:
906 explicit LMathPowHalf(LOperand* value) { inputs_[0] = value; } 861 explicit LMathPowHalf(LOperand* value) { inputs_[0] = value; }
907 862
908 LOperand* value() { return inputs_[0]; } 863 LOperand* value() { return inputs_[0]; }
909 864
910 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half") 865 DECLARE_CONCRETE_INSTRUCTION(MathPowHalf, "math-pow-half")
911 }; 866 };
912 867
913
914 class LCmpObjectEqAndBranch final : public LControlInstruction<2, 0> { 868 class LCmpObjectEqAndBranch final : public LControlInstruction<2, 0> {
915 public: 869 public:
916 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { 870 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
917 inputs_[0] = left; 871 inputs_[0] = left;
918 inputs_[1] = right; 872 inputs_[1] = right;
919 } 873 }
920 874
921 LOperand* left() { return inputs_[0]; } 875 LOperand* left() { return inputs_[0]; }
922 LOperand* right() { return inputs_[1]; } 876 LOperand* right() { return inputs_[1]; }
923 877
924 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch") 878 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, "cmp-object-eq-and-branch")
925 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch) 879 DECLARE_HYDROGEN_ACCESSOR(CompareObjectEqAndBranch)
926 }; 880 };
927 881
928
929 class LCmpHoleAndBranch final : public LControlInstruction<1, 0> { 882 class LCmpHoleAndBranch final : public LControlInstruction<1, 0> {
930 public: 883 public:
931 explicit LCmpHoleAndBranch(LOperand* object) { inputs_[0] = object; } 884 explicit LCmpHoleAndBranch(LOperand* object) { inputs_[0] = object; }
932 885
933 LOperand* object() { return inputs_[0]; } 886 LOperand* object() { return inputs_[0]; }
934 887
935 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch") 888 DECLARE_CONCRETE_INSTRUCTION(CmpHoleAndBranch, "cmp-hole-and-branch")
936 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch) 889 DECLARE_HYDROGEN_ACCESSOR(CompareHoleAndBranch)
937 }; 890 };
938 891
939
940 class LIsStringAndBranch final : public LControlInstruction<1, 1> { 892 class LIsStringAndBranch final : public LControlInstruction<1, 1> {
941 public: 893 public:
942 LIsStringAndBranch(LOperand* value, LOperand* temp) { 894 LIsStringAndBranch(LOperand* value, LOperand* temp) {
943 inputs_[0] = value; 895 inputs_[0] = value;
944 temps_[0] = temp; 896 temps_[0] = temp;
945 } 897 }
946 898
947 LOperand* value() { return inputs_[0]; } 899 LOperand* value() { return inputs_[0]; }
948 LOperand* temp() { return temps_[0]; } 900 LOperand* temp() { return temps_[0]; }
949 901
950 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") 902 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
951 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) 903 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
952 904
953 void PrintDataTo(StringStream* stream) override; 905 void PrintDataTo(StringStream* stream) override;
954 }; 906 };
955 907
956
957 class LIsSmiAndBranch final : public LControlInstruction<1, 0> { 908 class LIsSmiAndBranch final : public LControlInstruction<1, 0> {
958 public: 909 public:
959 explicit LIsSmiAndBranch(LOperand* value) { inputs_[0] = value; } 910 explicit LIsSmiAndBranch(LOperand* value) { inputs_[0] = value; }
960 911
961 LOperand* value() { return inputs_[0]; } 912 LOperand* value() { return inputs_[0]; }
962 913
963 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") 914 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
964 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) 915 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
965 916
966 void PrintDataTo(StringStream* stream) override; 917 void PrintDataTo(StringStream* stream) override;
967 }; 918 };
968 919
969
970 class LIsUndetectableAndBranch final : public LControlInstruction<1, 1> { 920 class LIsUndetectableAndBranch final : public LControlInstruction<1, 1> {
971 public: 921 public:
972 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { 922 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
973 inputs_[0] = value; 923 inputs_[0] = value;
974 temps_[0] = temp; 924 temps_[0] = temp;
975 } 925 }
976 926
977 LOperand* value() { return inputs_[0]; } 927 LOperand* value() { return inputs_[0]; }
978 LOperand* temp() { return temps_[0]; } 928 LOperand* temp() { return temps_[0]; }
979 929
980 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, 930 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
981 "is-undetectable-and-branch") 931 "is-undetectable-and-branch")
982 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) 932 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
983 933
984 void PrintDataTo(StringStream* stream) override; 934 void PrintDataTo(StringStream* stream) override;
985 }; 935 };
986 936
987
988 class LStringCompareAndBranch final : public LControlInstruction<3, 0> { 937 class LStringCompareAndBranch final : public LControlInstruction<3, 0> {
989 public: 938 public:
990 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) { 939 LStringCompareAndBranch(LOperand* context, LOperand* left, LOperand* right) {
991 inputs_[0] = context; 940 inputs_[0] = context;
992 inputs_[1] = left; 941 inputs_[1] = left;
993 inputs_[2] = right; 942 inputs_[2] = right;
994 } 943 }
995 944
996 LOperand* context() { return inputs_[0]; } 945 LOperand* context() { return inputs_[0]; }
997 LOperand* left() { return inputs_[1]; } 946 LOperand* left() { return inputs_[1]; }
998 LOperand* right() { return inputs_[2]; } 947 LOperand* right() { return inputs_[2]; }
999 948
1000 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, 949 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
1001 "string-compare-and-branch") 950 "string-compare-and-branch")
1002 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) 951 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
1003 952
1004 Token::Value op() const { return hydrogen()->token(); } 953 Token::Value op() const { return hydrogen()->token(); }
1005 954
1006 void PrintDataTo(StringStream* stream) override; 955 void PrintDataTo(StringStream* stream) override;
1007 }; 956 };
1008 957
1009
1010 class LHasInstanceTypeAndBranch final : public LControlInstruction<1, 0> { 958 class LHasInstanceTypeAndBranch final : public LControlInstruction<1, 0> {
1011 public: 959 public:
1012 explicit LHasInstanceTypeAndBranch(LOperand* value) { inputs_[0] = value; } 960 explicit LHasInstanceTypeAndBranch(LOperand* value) { inputs_[0] = value; }
1013 961
1014 LOperand* value() { return inputs_[0]; } 962 LOperand* value() { return inputs_[0]; }
1015 963
1016 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 964 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
1017 "has-instance-type-and-branch") 965 "has-instance-type-and-branch")
1018 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) 966 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
1019 967
1020 void PrintDataTo(StringStream* stream) override; 968 void PrintDataTo(StringStream* stream) override;
1021 }; 969 };
1022 970
1023
1024 class LGetCachedArrayIndex final : public LTemplateInstruction<1, 1, 0> { 971 class LGetCachedArrayIndex final : public LTemplateInstruction<1, 1, 0> {
1025 public: 972 public:
1026 explicit LGetCachedArrayIndex(LOperand* value) { inputs_[0] = value; } 973 explicit LGetCachedArrayIndex(LOperand* value) { inputs_[0] = value; }
1027 974
1028 LOperand* value() { return inputs_[0]; } 975 LOperand* value() { return inputs_[0]; }
1029 976
1030 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") 977 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
1031 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) 978 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
1032 }; 979 };
1033 980
1034
1035 class LHasCachedArrayIndexAndBranch final : public LControlInstruction<1, 0> { 981 class LHasCachedArrayIndexAndBranch final : public LControlInstruction<1, 0> {
1036 public: 982 public:
1037 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { 983 explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
1038 inputs_[0] = value; 984 inputs_[0] = value;
1039 } 985 }
1040 986
1041 LOperand* value() { return inputs_[0]; } 987 LOperand* value() { return inputs_[0]; }
1042 988
1043 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, 989 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
1044 "has-cached-array-index-and-branch") 990 "has-cached-array-index-and-branch")
1045 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) 991 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
1046 992
1047 void PrintDataTo(StringStream* stream) override; 993 void PrintDataTo(StringStream* stream) override;
1048 }; 994 };
1049 995
1050
1051 class LClassOfTestAndBranch final : public LControlInstruction<1, 1> { 996 class LClassOfTestAndBranch final : public LControlInstruction<1, 1> {
1052 public: 997 public:
1053 LClassOfTestAndBranch(LOperand* value, LOperand* temp) { 998 LClassOfTestAndBranch(LOperand* value, LOperand* temp) {
1054 inputs_[0] = value; 999 inputs_[0] = value;
1055 temps_[0] = temp; 1000 temps_[0] = temp;
1056 } 1001 }
1057 1002
1058 LOperand* value() { return inputs_[0]; } 1003 LOperand* value() { return inputs_[0]; }
1059 LOperand* temp() { return temps_[0]; } 1004 LOperand* temp() { return temps_[0]; }
1060 1005
1061 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, "class-of-test-and-branch") 1006 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, "class-of-test-and-branch")
1062 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) 1007 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
1063 1008
1064 void PrintDataTo(StringStream* stream) override; 1009 void PrintDataTo(StringStream* stream) override;
1065 }; 1010 };
1066 1011
1067
1068 class LCmpT final : public LTemplateInstruction<1, 3, 0> { 1012 class LCmpT final : public LTemplateInstruction<1, 3, 0> {
1069 public: 1013 public:
1070 LCmpT(LOperand* context, LOperand* left, LOperand* right) { 1014 LCmpT(LOperand* context, LOperand* left, LOperand* right) {
1071 inputs_[0] = context; 1015 inputs_[0] = context;
1072 inputs_[1] = left; 1016 inputs_[1] = left;
1073 inputs_[2] = right; 1017 inputs_[2] = right;
1074 } 1018 }
1075 1019
1076 LOperand* context() { return inputs_[0]; } 1020 LOperand* context() { return inputs_[0]; }
1077 LOperand* left() { return inputs_[1]; } 1021 LOperand* left() { return inputs_[1]; }
1078 LOperand* right() { return inputs_[2]; } 1022 LOperand* right() { return inputs_[2]; }
1079 1023
1080 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") 1024 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
1081 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) 1025 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
1082 1026
1083 Token::Value op() const { return hydrogen()->token(); } 1027 Token::Value op() const { return hydrogen()->token(); }
1084 }; 1028 };
1085 1029
1086
1087 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> { 1030 class LInstanceOf final : public LTemplateInstruction<1, 3, 0> {
1088 public: 1031 public:
1089 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) { 1032 LInstanceOf(LOperand* context, LOperand* left, LOperand* right) {
1090 inputs_[0] = context; 1033 inputs_[0] = context;
1091 inputs_[1] = left; 1034 inputs_[1] = left;
1092 inputs_[2] = right; 1035 inputs_[2] = right;
1093 } 1036 }
1094 1037
1095 LOperand* context() const { return inputs_[0]; } 1038 LOperand* context() const { return inputs_[0]; }
1096 LOperand* left() const { return inputs_[1]; } 1039 LOperand* left() const { return inputs_[1]; }
1097 LOperand* right() const { return inputs_[2]; } 1040 LOperand* right() const { return inputs_[2]; }
1098 1041
1099 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 1042 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
1100 }; 1043 };
1101 1044
1102
1103 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 0> { 1045 class LHasInPrototypeChainAndBranch final : public LControlInstruction<2, 0> {
1104 public: 1046 public:
1105 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype) { 1047 LHasInPrototypeChainAndBranch(LOperand* object, LOperand* prototype) {
1106 inputs_[0] = object; 1048 inputs_[0] = object;
1107 inputs_[1] = prototype; 1049 inputs_[1] = prototype;
1108 } 1050 }
1109 1051
1110 LOperand* object() const { return inputs_[0]; } 1052 LOperand* object() const { return inputs_[0]; }
1111 LOperand* prototype() const { return inputs_[1]; } 1053 LOperand* prototype() const { return inputs_[1]; }
1112 1054
1113 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch, 1055 DECLARE_CONCRETE_INSTRUCTION(HasInPrototypeChainAndBranch,
1114 "has-in-prototype-chain-and-branch") 1056 "has-in-prototype-chain-and-branch")
1115 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch) 1057 DECLARE_HYDROGEN_ACCESSOR(HasInPrototypeChainAndBranch)
1116 }; 1058 };
1117 1059
1118
1119 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> { 1060 class LBoundsCheck final : public LTemplateInstruction<0, 2, 0> {
1120 public: 1061 public:
1121 LBoundsCheck(LOperand* index, LOperand* length) { 1062 LBoundsCheck(LOperand* index, LOperand* length) {
1122 inputs_[0] = index; 1063 inputs_[0] = index;
1123 inputs_[1] = length; 1064 inputs_[1] = length;
1124 } 1065 }
1125 1066
1126 LOperand* index() { return inputs_[0]; } 1067 LOperand* index() { return inputs_[0]; }
1127 LOperand* length() { return inputs_[1]; } 1068 LOperand* length() { return inputs_[1]; }
1128 1069
1129 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check") 1070 DECLARE_CONCRETE_INSTRUCTION(BoundsCheck, "bounds-check")
1130 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck) 1071 DECLARE_HYDROGEN_ACCESSOR(BoundsCheck)
1131 }; 1072 };
1132 1073
1133
1134 class LBitI final : public LTemplateInstruction<1, 2, 0> { 1074 class LBitI final : public LTemplateInstruction<1, 2, 0> {
1135 public: 1075 public:
1136 LBitI(LOperand* left, LOperand* right) { 1076 LBitI(LOperand* left, LOperand* right) {
1137 inputs_[0] = left; 1077 inputs_[0] = left;
1138 inputs_[1] = right; 1078 inputs_[1] = right;
1139 } 1079 }
1140 1080
1141 LOperand* left() { return inputs_[0]; } 1081 LOperand* left() { return inputs_[0]; }
1142 LOperand* right() { return inputs_[1]; } 1082 LOperand* right() { return inputs_[1]; }
1143 1083
1144 Token::Value op() const { return hydrogen()->op(); } 1084 Token::Value op() const { return hydrogen()->op(); }
1145 1085
1146 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") 1086 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
1147 DECLARE_HYDROGEN_ACCESSOR(Bitwise) 1087 DECLARE_HYDROGEN_ACCESSOR(Bitwise)
1148 }; 1088 };
1149 1089
1150
1151 class LShiftI final : public LTemplateInstruction<1, 2, 0> { 1090 class LShiftI final : public LTemplateInstruction<1, 2, 0> {
1152 public: 1091 public:
1153 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) 1092 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
1154 : op_(op), can_deopt_(can_deopt) { 1093 : op_(op), can_deopt_(can_deopt) {
1155 inputs_[0] = left; 1094 inputs_[0] = left;
1156 inputs_[1] = right; 1095 inputs_[1] = right;
1157 } 1096 }
1158 1097
1159 Token::Value op() const { return op_; } 1098 Token::Value op() const { return op_; }
1160 LOperand* left() { return inputs_[0]; } 1099 LOperand* left() { return inputs_[0]; }
1161 LOperand* right() { return inputs_[1]; } 1100 LOperand* right() { return inputs_[1]; }
1162 bool can_deopt() const { return can_deopt_; } 1101 bool can_deopt() const { return can_deopt_; }
1163 1102
1164 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") 1103 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
1165 1104
1166 private: 1105 private:
1167 Token::Value op_; 1106 Token::Value op_;
1168 bool can_deopt_; 1107 bool can_deopt_;
1169 }; 1108 };
1170 1109
1171
1172 class LSubI final : public LTemplateInstruction<1, 2, 0> { 1110 class LSubI final : public LTemplateInstruction<1, 2, 0> {
1173 public: 1111 public:
1174 LSubI(LOperand* left, LOperand* right) { 1112 LSubI(LOperand* left, LOperand* right) {
1175 inputs_[0] = left; 1113 inputs_[0] = left;
1176 inputs_[1] = right; 1114 inputs_[1] = right;
1177 } 1115 }
1178 1116
1179 LOperand* left() { return inputs_[0]; } 1117 LOperand* left() { return inputs_[0]; }
1180 LOperand* right() { return inputs_[1]; } 1118 LOperand* right() { return inputs_[1]; }
1181 1119
1182 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") 1120 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
1183 DECLARE_HYDROGEN_ACCESSOR(Sub) 1121 DECLARE_HYDROGEN_ACCESSOR(Sub)
1184 }; 1122 };
1185 1123
1186
1187 class LRSubI final : public LTemplateInstruction<1, 2, 0> { 1124 class LRSubI final : public LTemplateInstruction<1, 2, 0> {
1188 public: 1125 public:
1189 LRSubI(LOperand* left, LOperand* right) { 1126 LRSubI(LOperand* left, LOperand* right) {
1190 inputs_[0] = left; 1127 inputs_[0] = left;
1191 inputs_[1] = right; 1128 inputs_[1] = right;
1192 } 1129 }
1193 1130
1194 LOperand* left() { return inputs_[0]; } 1131 LOperand* left() { return inputs_[0]; }
1195 LOperand* right() { return inputs_[1]; } 1132 LOperand* right() { return inputs_[1]; }
1196 1133
1197 DECLARE_CONCRETE_INSTRUCTION(RSubI, "rsub-i") 1134 DECLARE_CONCRETE_INSTRUCTION(RSubI, "rsub-i")
1198 DECLARE_HYDROGEN_ACCESSOR(Sub) 1135 DECLARE_HYDROGEN_ACCESSOR(Sub)
1199 }; 1136 };
1200 1137
1201
1202 class LConstantI final : public LTemplateInstruction<1, 0, 0> { 1138 class LConstantI final : public LTemplateInstruction<1, 0, 0> {
1203 public: 1139 public:
1204 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") 1140 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
1205 DECLARE_HYDROGEN_ACCESSOR(Constant) 1141 DECLARE_HYDROGEN_ACCESSOR(Constant)
1206 1142
1207 int32_t value() const { return hydrogen()->Integer32Value(); } 1143 int32_t value() const { return hydrogen()->Integer32Value(); }
1208 }; 1144 };
1209 1145
1210
1211 class LConstantS final : public LTemplateInstruction<1, 0, 0> { 1146 class LConstantS final : public LTemplateInstruction<1, 0, 0> {
1212 public: 1147 public:
1213 DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s") 1148 DECLARE_CONCRETE_INSTRUCTION(ConstantS, "constant-s")
1214 DECLARE_HYDROGEN_ACCESSOR(Constant) 1149 DECLARE_HYDROGEN_ACCESSOR(Constant)
1215 1150
1216 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); } 1151 Smi* value() const { return Smi::FromInt(hydrogen()->Integer32Value()); }
1217 }; 1152 };
1218 1153
1219
1220 class LConstantD final : public LTemplateInstruction<1, 0, 0> { 1154 class LConstantD final : public LTemplateInstruction<1, 0, 0> {
1221 public: 1155 public:
1222 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 1156 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
1223 DECLARE_HYDROGEN_ACCESSOR(Constant) 1157 DECLARE_HYDROGEN_ACCESSOR(Constant)
1224 1158
1225 double value() const { return hydrogen()->DoubleValue(); } 1159 double value() const { return hydrogen()->DoubleValue(); }
1160
1226 uint64_t bits() const { return hydrogen()->DoubleValueAsBits(); } 1161 uint64_t bits() const { return hydrogen()->DoubleValueAsBits(); }
1227 }; 1162 };
1228 1163
1229
1230 class LConstantE final : public LTemplateInstruction<1, 0, 0> { 1164 class LConstantE final : public LTemplateInstruction<1, 0, 0> {
1231 public: 1165 public:
1232 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e") 1166 DECLARE_CONCRETE_INSTRUCTION(ConstantE, "constant-e")
1233 DECLARE_HYDROGEN_ACCESSOR(Constant) 1167 DECLARE_HYDROGEN_ACCESSOR(Constant)
1234 1168
1235 ExternalReference value() const { 1169 ExternalReference value() const {
1236 return hydrogen()->ExternalReferenceValue(); 1170 return hydrogen()->ExternalReferenceValue();
1237 } 1171 }
1238 }; 1172 };
1239 1173
1240
1241 class LConstantT final : public LTemplateInstruction<1, 0, 0> { 1174 class LConstantT final : public LTemplateInstruction<1, 0, 0> {
1242 public: 1175 public:
1243 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") 1176 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
1244 DECLARE_HYDROGEN_ACCESSOR(Constant) 1177 DECLARE_HYDROGEN_ACCESSOR(Constant)
1245 1178
1246 Handle<Object> value(Isolate* isolate) const { 1179 Handle<Object> value(Isolate* isolate) const {
1247 return hydrogen()->handle(isolate); 1180 return hydrogen()->handle(isolate);
1248 } 1181 }
1249 }; 1182 };
1250 1183
1251
1252 class LBranch final : public LControlInstruction<1, 0> { 1184 class LBranch final : public LControlInstruction<1, 0> {
1253 public: 1185 public:
1254 explicit LBranch(LOperand* value) { inputs_[0] = value; } 1186 explicit LBranch(LOperand* value) { inputs_[0] = value; }
1255 1187
1256 LOperand* value() { return inputs_[0]; } 1188 LOperand* value() { return inputs_[0]; }
1257 1189
1258 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 1190 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
1259 DECLARE_HYDROGEN_ACCESSOR(Branch) 1191 DECLARE_HYDROGEN_ACCESSOR(Branch)
1260 1192
1261 void PrintDataTo(StringStream* stream) override; 1193 void PrintDataTo(StringStream* stream) override;
1262 }; 1194 };
1263 1195
1264
1265 class LCmpMapAndBranch final : public LControlInstruction<1, 1> { 1196 class LCmpMapAndBranch final : public LControlInstruction<1, 1> {
1266 public: 1197 public:
1267 LCmpMapAndBranch(LOperand* value, LOperand* temp) { 1198 LCmpMapAndBranch(LOperand* value, LOperand* temp) {
1268 inputs_[0] = value; 1199 inputs_[0] = value;
1269 temps_[0] = temp; 1200 temps_[0] = temp;
1270 } 1201 }
1271 1202
1272 LOperand* value() { return inputs_[0]; } 1203 LOperand* value() { return inputs_[0]; }
1273 LOperand* temp() { return temps_[0]; } 1204 LOperand* temp() { return temps_[0]; }
1274 1205
1275 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1206 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
1276 DECLARE_HYDROGEN_ACCESSOR(CompareMap) 1207 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
1277 1208
1278 Handle<Map> map() const { return hydrogen()->map().handle(); } 1209 Handle<Map> map() const { return hydrogen()->map().handle(); }
1279 }; 1210 };
1280 1211
1281
1282 class LSeqStringGetChar final : public LTemplateInstruction<1, 2, 0> { 1212 class LSeqStringGetChar final : public LTemplateInstruction<1, 2, 0> {
1283 public: 1213 public:
1284 LSeqStringGetChar(LOperand* string, LOperand* index) { 1214 LSeqStringGetChar(LOperand* string, LOperand* index) {
1285 inputs_[0] = string; 1215 inputs_[0] = string;
1286 inputs_[1] = index; 1216 inputs_[1] = index;
1287 } 1217 }
1288 1218
1289 LOperand* string() const { return inputs_[0]; } 1219 LOperand* string() const { return inputs_[0]; }
1290 LOperand* index() const { return inputs_[1]; } 1220 LOperand* index() const { return inputs_[1]; }
1291 1221
1292 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char") 1222 DECLARE_CONCRETE_INSTRUCTION(SeqStringGetChar, "seq-string-get-char")
1293 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar) 1223 DECLARE_HYDROGEN_ACCESSOR(SeqStringGetChar)
1294 }; 1224 };
1295 1225
1296
1297 class LSeqStringSetChar final : public LTemplateInstruction<1, 4, 0> { 1226 class LSeqStringSetChar final : public LTemplateInstruction<1, 4, 0> {
1298 public: 1227 public:
1299 LSeqStringSetChar(LOperand* context, LOperand* string, LOperand* index, 1228 LSeqStringSetChar(LOperand* context, LOperand* string, LOperand* index,
1300 LOperand* value) { 1229 LOperand* value) {
1301 inputs_[0] = context; 1230 inputs_[0] = context;
1302 inputs_[1] = string; 1231 inputs_[1] = string;
1303 inputs_[2] = index; 1232 inputs_[2] = index;
1304 inputs_[3] = value; 1233 inputs_[3] = value;
1305 } 1234 }
1306 1235
1307 LOperand* string() { return inputs_[1]; } 1236 LOperand* string() { return inputs_[1]; }
1308 LOperand* index() { return inputs_[2]; } 1237 LOperand* index() { return inputs_[2]; }
1309 LOperand* value() { return inputs_[3]; } 1238 LOperand* value() { return inputs_[3]; }
1310 1239
1311 DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char") 1240 DECLARE_CONCRETE_INSTRUCTION(SeqStringSetChar, "seq-string-set-char")
1312 DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar) 1241 DECLARE_HYDROGEN_ACCESSOR(SeqStringSetChar)
1313 }; 1242 };
1314 1243
1315
1316 class LAddI final : public LTemplateInstruction<1, 2, 0> { 1244 class LAddI final : public LTemplateInstruction<1, 2, 0> {
1317 public: 1245 public:
1318 LAddI(LOperand* left, LOperand* right) { 1246 LAddI(LOperand* left, LOperand* right) {
1319 inputs_[0] = left; 1247 inputs_[0] = left;
1320 inputs_[1] = right; 1248 inputs_[1] = right;
1321 } 1249 }
1322 1250
1323 LOperand* left() { return inputs_[0]; } 1251 LOperand* left() { return inputs_[0]; }
1324 LOperand* right() { return inputs_[1]; } 1252 LOperand* right() { return inputs_[1]; }
1325 1253
1326 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") 1254 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1327 DECLARE_HYDROGEN_ACCESSOR(Add) 1255 DECLARE_HYDROGEN_ACCESSOR(Add)
1328 }; 1256 };
1329 1257
1330
1331 class LMathMinMax final : public LTemplateInstruction<1, 2, 0> { 1258 class LMathMinMax final : public LTemplateInstruction<1, 2, 0> {
1332 public: 1259 public:
1333 LMathMinMax(LOperand* left, LOperand* right) { 1260 LMathMinMax(LOperand* left, LOperand* right) {
1334 inputs_[0] = left; 1261 inputs_[0] = left;
1335 inputs_[1] = right; 1262 inputs_[1] = right;
1336 } 1263 }
1337 1264
1338 LOperand* left() { return inputs_[0]; } 1265 LOperand* left() { return inputs_[0]; }
1339 LOperand* right() { return inputs_[1]; } 1266 LOperand* right() { return inputs_[1]; }
1340 1267
1341 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max") 1268 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "math-min-max")
1342 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) 1269 DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1343 }; 1270 };
1344 1271
1345
1346 class LPower final : public LTemplateInstruction<1, 2, 0> { 1272 class LPower final : public LTemplateInstruction<1, 2, 0> {
1347 public: 1273 public:
1348 LPower(LOperand* left, LOperand* right) { 1274 LPower(LOperand* left, LOperand* right) {
1349 inputs_[0] = left; 1275 inputs_[0] = left;
1350 inputs_[1] = right; 1276 inputs_[1] = right;
1351 } 1277 }
1352 1278
1353 LOperand* left() { return inputs_[0]; } 1279 LOperand* left() { return inputs_[0]; }
1354 LOperand* right() { return inputs_[1]; } 1280 LOperand* right() { return inputs_[1]; }
1355 1281
1356 DECLARE_CONCRETE_INSTRUCTION(Power, "power") 1282 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1357 DECLARE_HYDROGEN_ACCESSOR(Power) 1283 DECLARE_HYDROGEN_ACCESSOR(Power)
1358 }; 1284 };
1359 1285
1360
1361 class LArithmeticD final : public LTemplateInstruction<1, 2, 0> { 1286 class LArithmeticD final : public LTemplateInstruction<1, 2, 0> {
1362 public: 1287 public:
1363 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) : op_(op) { 1288 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) : op_(op) {
1364 inputs_[0] = left; 1289 inputs_[0] = left;
1365 inputs_[1] = right; 1290 inputs_[1] = right;
1366 } 1291 }
1367 1292
1368 Token::Value op() const { return op_; } 1293 Token::Value op() const { return op_; }
1369 LOperand* left() { return inputs_[0]; } 1294 LOperand* left() { return inputs_[0]; }
1370 LOperand* right() { return inputs_[1]; } 1295 LOperand* right() { return inputs_[1]; }
1371 1296
1372 Opcode opcode() const override { return LInstruction::kArithmeticD; } 1297 Opcode opcode() const override { return LInstruction::kArithmeticD; }
1373 void CompileToNative(LCodeGen* generator) override; 1298 void CompileToNative(LCodeGen* generator) override;
1374 const char* Mnemonic() const override; 1299 const char* Mnemonic() const override;
1375 1300
1376 private: 1301 private:
1377 Token::Value op_; 1302 Token::Value op_;
1378 }; 1303 };
1379 1304
1380
1381 class LArithmeticT final : public LTemplateInstruction<1, 3, 0> { 1305 class LArithmeticT final : public LTemplateInstruction<1, 3, 0> {
1382 public: 1306 public:
1383 LArithmeticT(Token::Value op, LOperand* context, LOperand* left, 1307 LArithmeticT(Token::Value op, LOperand* context, LOperand* left,
1384 LOperand* right) 1308 LOperand* right)
1385 : op_(op) { 1309 : op_(op) {
1386 inputs_[0] = context; 1310 inputs_[0] = context;
1387 inputs_[1] = left; 1311 inputs_[1] = left;
1388 inputs_[2] = right; 1312 inputs_[2] = right;
1389 } 1313 }
1390 1314
1391 LOperand* context() { return inputs_[0]; } 1315 LOperand* context() { return inputs_[0]; }
1392 LOperand* left() { return inputs_[1]; } 1316 LOperand* left() { return inputs_[1]; }
1393 LOperand* right() { return inputs_[2]; } 1317 LOperand* right() { return inputs_[2]; }
1394 Token::Value op() const { return op_; } 1318 Token::Value op() const { return op_; }
1395 1319
1396 Opcode opcode() const override { return LInstruction::kArithmeticT; } 1320 Opcode opcode() const override { return LInstruction::kArithmeticT; }
1397 void CompileToNative(LCodeGen* generator) override; 1321 void CompileToNative(LCodeGen* generator) override;
1398 const char* Mnemonic() const override; 1322 const char* Mnemonic() const override;
1399 1323
1400 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation) 1324 DECLARE_HYDROGEN_ACCESSOR(BinaryOperation)
1401 1325
1402 private: 1326 private:
1403 Token::Value op_; 1327 Token::Value op_;
1404 }; 1328 };
1405 1329
1406
1407 class LReturn final : public LTemplateInstruction<0, 3, 0> { 1330 class LReturn final : public LTemplateInstruction<0, 3, 0> {
1408 public: 1331 public:
1409 LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) { 1332 LReturn(LOperand* value, LOperand* context, LOperand* parameter_count) {
1410 inputs_[0] = value; 1333 inputs_[0] = value;
1411 inputs_[1] = context; 1334 inputs_[1] = context;
1412 inputs_[2] = parameter_count; 1335 inputs_[2] = parameter_count;
1413 } 1336 }
1414 1337
1415 LOperand* value() { return inputs_[0]; } 1338 LOperand* value() { return inputs_[0]; }
1416 1339
1417 bool has_constant_parameter_count() { 1340 bool has_constant_parameter_count() {
1418 return parameter_count()->IsConstantOperand(); 1341 return parameter_count()->IsConstantOperand();
1419 } 1342 }
1420 LConstantOperand* constant_parameter_count() { 1343 LConstantOperand* constant_parameter_count() {
1421 DCHECK(has_constant_parameter_count()); 1344 DCHECK(has_constant_parameter_count());
1422 return LConstantOperand::cast(parameter_count()); 1345 return LConstantOperand::cast(parameter_count());
1423 } 1346 }
1424 LOperand* parameter_count() { return inputs_[2]; } 1347 LOperand* parameter_count() { return inputs_[2]; }
1425 1348
1426 DECLARE_CONCRETE_INSTRUCTION(Return, "return") 1349 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1427 }; 1350 };
1428 1351
1429
1430 class LLoadNamedField final : public LTemplateInstruction<1, 1, 0> { 1352 class LLoadNamedField final : public LTemplateInstruction<1, 1, 0> {
1431 public: 1353 public:
1432 explicit LLoadNamedField(LOperand* object) { inputs_[0] = object; } 1354 explicit LLoadNamedField(LOperand* object) { inputs_[0] = object; }
1433 1355
1434 LOperand* object() { return inputs_[0]; } 1356 LOperand* object() { return inputs_[0]; }
1435 1357
1436 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") 1358 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1437 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) 1359 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1438 }; 1360 };
1439 1361
1440
1441 class LLoadNamedGeneric final : public LTemplateInstruction<1, 2, 1> { 1362 class LLoadNamedGeneric final : public LTemplateInstruction<1, 2, 1> {
1442 public: 1363 public:
1443 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) { 1364 LLoadNamedGeneric(LOperand* context, LOperand* object, LOperand* vector) {
1444 inputs_[0] = context; 1365 inputs_[0] = context;
1445 inputs_[1] = object; 1366 inputs_[1] = object;
1446 temps_[0] = vector; 1367 temps_[0] = vector;
1447 } 1368 }
1448 1369
1449 LOperand* context() { return inputs_[0]; } 1370 LOperand* context() { return inputs_[0]; }
1450 LOperand* object() { return inputs_[1]; } 1371 LOperand* object() { return inputs_[1]; }
1451 LOperand* temp_vector() { return temps_[0]; } 1372 LOperand* temp_vector() { return temps_[0]; }
1452 1373
1453 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") 1374 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic")
1454 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) 1375 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric)
1455 1376
1456 Handle<Object> name() const { return hydrogen()->name(); } 1377 Handle<Object> name() const { return hydrogen()->name(); }
1457 }; 1378 };
1458 1379
1459
1460 class LLoadFunctionPrototype final : public LTemplateInstruction<1, 1, 0> { 1380 class LLoadFunctionPrototype final : public LTemplateInstruction<1, 1, 0> {
1461 public: 1381 public:
1462 explicit LLoadFunctionPrototype(LOperand* function) { inputs_[0] = function; } 1382 explicit LLoadFunctionPrototype(LOperand* function) { inputs_[0] = function; }
1463 1383
1464 LOperand* function() { return inputs_[0]; } 1384 LOperand* function() { return inputs_[0]; }
1465 1385
1466 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") 1386 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype")
1467 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) 1387 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype)
1468 }; 1388 };
1469 1389
1470
1471 class LLoadRoot final : public LTemplateInstruction<1, 0, 0> { 1390 class LLoadRoot final : public LTemplateInstruction<1, 0, 0> {
1472 public: 1391 public:
1473 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root") 1392 DECLARE_CONCRETE_INSTRUCTION(LoadRoot, "load-root")
1474 DECLARE_HYDROGEN_ACCESSOR(LoadRoot) 1393 DECLARE_HYDROGEN_ACCESSOR(LoadRoot)
1475 1394
1476 Heap::RootListIndex index() const { return hydrogen()->index(); } 1395 Heap::RootListIndex index() const { return hydrogen()->index(); }
1477 }; 1396 };
1478 1397
1479
1480 class LLoadKeyed final : public LTemplateInstruction<1, 3, 0> { 1398 class LLoadKeyed final : public LTemplateInstruction<1, 3, 0> {
1481 public: 1399 public:
1482 LLoadKeyed(LOperand* elements, LOperand* key, LOperand* backing_store_owner) { 1400 LLoadKeyed(LOperand* elements, LOperand* key, LOperand* backing_store_owner) {
1483 inputs_[0] = elements; 1401 inputs_[0] = elements;
1484 inputs_[1] = key; 1402 inputs_[1] = key;
1485 inputs_[2] = backing_store_owner; 1403 inputs_[2] = backing_store_owner;
1486 } 1404 }
1487 1405
1488 LOperand* elements() { return inputs_[0]; } 1406 LOperand* elements() { return inputs_[0]; }
1489 LOperand* key() { return inputs_[1]; } 1407 LOperand* key() { return inputs_[1]; }
1490 LOperand* backing_store_owner() { return inputs_[2]; } 1408 LOperand* backing_store_owner() { return inputs_[2]; }
1491 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); } 1409 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); }
1492 bool is_fixed_typed_array() const { 1410 bool is_fixed_typed_array() const {
1493 return hydrogen()->is_fixed_typed_array(); 1411 return hydrogen()->is_fixed_typed_array();
1494 } 1412 }
1495 1413
1496 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed") 1414 DECLARE_CONCRETE_INSTRUCTION(LoadKeyed, "load-keyed")
1497 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed) 1415 DECLARE_HYDROGEN_ACCESSOR(LoadKeyed)
1498 1416
1499 void PrintDataTo(StringStream* stream) override; 1417 void PrintDataTo(StringStream* stream) override;
1500 uint32_t base_offset() const { return hydrogen()->base_offset(); } 1418 uint32_t base_offset() const { return hydrogen()->base_offset(); }
1501 }; 1419 };
1502 1420
1503
1504 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> { 1421 class LLoadKeyedGeneric final : public LTemplateInstruction<1, 3, 1> {
1505 public: 1422 public:
1506 LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, 1423 LLoadKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
1507 LOperand* vector) { 1424 LOperand* vector) {
1508 inputs_[0] = context; 1425 inputs_[0] = context;
1509 inputs_[1] = object; 1426 inputs_[1] = object;
1510 inputs_[2] = key; 1427 inputs_[2] = key;
1511 temps_[0] = vector; 1428 temps_[0] = vector;
1512 } 1429 }
1513 1430
1514 LOperand* context() { return inputs_[0]; } 1431 LOperand* context() { return inputs_[0]; }
1515 LOperand* object() { return inputs_[1]; } 1432 LOperand* object() { return inputs_[1]; }
1516 LOperand* key() { return inputs_[2]; } 1433 LOperand* key() { return inputs_[2]; }
1517 LOperand* temp_vector() { return temps_[0]; } 1434 LOperand* temp_vector() { return temps_[0]; }
1518 1435
1519 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic") 1436 DECLARE_CONCRETE_INSTRUCTION(LoadKeyedGeneric, "load-keyed-generic")
1520 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric) 1437 DECLARE_HYDROGEN_ACCESSOR(LoadKeyedGeneric)
1521 }; 1438 };
1522 1439
1523
1524 class LLoadGlobalGeneric final : public LTemplateInstruction<1, 2, 1> { 1440 class LLoadGlobalGeneric final : public LTemplateInstruction<1, 2, 1> {
1525 public: 1441 public:
1526 LLoadGlobalGeneric(LOperand* context, LOperand* global_object, 1442 LLoadGlobalGeneric(LOperand* context, LOperand* global_object,
1527 LOperand* vector) { 1443 LOperand* vector) {
1528 inputs_[0] = context; 1444 inputs_[0] = context;
1529 inputs_[1] = global_object; 1445 inputs_[1] = global_object;
1530 temps_[0] = vector; 1446 temps_[0] = vector;
1531 } 1447 }
1532 1448
1533 LOperand* context() { return inputs_[0]; } 1449 LOperand* context() { return inputs_[0]; }
1534 LOperand* global_object() { return inputs_[1]; } 1450 LOperand* global_object() { return inputs_[1]; }
1535 LOperand* temp_vector() { return temps_[0]; } 1451 LOperand* temp_vector() { return temps_[0]; }
1536 1452
1537 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic") 1453 DECLARE_CONCRETE_INSTRUCTION(LoadGlobalGeneric, "load-global-generic")
1538 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric) 1454 DECLARE_HYDROGEN_ACCESSOR(LoadGlobalGeneric)
1539 1455
1540 Handle<Object> name() const { return hydrogen()->name(); } 1456 Handle<Object> name() const { return hydrogen()->name(); }
1541 TypeofMode typeof_mode() const { return hydrogen()->typeof_mode(); } 1457 TypeofMode typeof_mode() const { return hydrogen()->typeof_mode(); }
1542 }; 1458 };
1543 1459
1544
1545 class LLoadContextSlot final : public LTemplateInstruction<1, 1, 0> { 1460 class LLoadContextSlot final : public LTemplateInstruction<1, 1, 0> {
1546 public: 1461 public:
1547 explicit LLoadContextSlot(LOperand* context) { inputs_[0] = context; } 1462 explicit LLoadContextSlot(LOperand* context) { inputs_[0] = context; }
1548 1463
1549 LOperand* context() { return inputs_[0]; } 1464 LOperand* context() { return inputs_[0]; }
1550 1465
1551 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") 1466 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1552 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) 1467 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1553 1468
1554 int slot_index() { return hydrogen()->slot_index(); } 1469 int slot_index() { return hydrogen()->slot_index(); }
1555 1470
1556 void PrintDataTo(StringStream* stream) override; 1471 void PrintDataTo(StringStream* stream) override;
1557 }; 1472 };
1558 1473
1559
1560 class LStoreContextSlot final : public LTemplateInstruction<0, 2, 0> { 1474 class LStoreContextSlot final : public LTemplateInstruction<0, 2, 0> {
1561 public: 1475 public:
1562 LStoreContextSlot(LOperand* context, LOperand* value) { 1476 LStoreContextSlot(LOperand* context, LOperand* value) {
1563 inputs_[0] = context; 1477 inputs_[0] = context;
1564 inputs_[1] = value; 1478 inputs_[1] = value;
1565 } 1479 }
1566 1480
1567 LOperand* context() { return inputs_[0]; } 1481 LOperand* context() { return inputs_[0]; }
1568 LOperand* value() { return inputs_[1]; } 1482 LOperand* value() { return inputs_[1]; }
1569 1483
1570 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") 1484 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1571 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) 1485 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1572 1486
1573 int slot_index() { return hydrogen()->slot_index(); } 1487 int slot_index() { return hydrogen()->slot_index(); }
1574 1488
1575 void PrintDataTo(StringStream* stream) override; 1489 void PrintDataTo(StringStream* stream) override;
1576 }; 1490 };
1577 1491
1578
1579 class LPushArgument final : public LTemplateInstruction<0, 1, 0> { 1492 class LPushArgument final : public LTemplateInstruction<0, 1, 0> {
1580 public: 1493 public:
1581 explicit LPushArgument(LOperand* value) { inputs_[0] = value; } 1494 explicit LPushArgument(LOperand* value) { inputs_[0] = value; }
1582 1495
1583 LOperand* value() { return inputs_[0]; } 1496 LOperand* value() { return inputs_[0]; }
1584 1497
1585 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1498 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1586 }; 1499 };
1587 1500
1588
1589 class LDrop final : public LTemplateInstruction<0, 0, 0> { 1501 class LDrop final : public LTemplateInstruction<0, 0, 0> {
1590 public: 1502 public:
1591 explicit LDrop(int count) : count_(count) {} 1503 explicit LDrop(int count) : count_(count) {}
1592 1504
1593 int count() const { return count_; } 1505 int count() const { return count_; }
1594 1506
1595 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop") 1507 DECLARE_CONCRETE_INSTRUCTION(Drop, "drop")
1596 1508
1597 private: 1509 private:
1598 int count_; 1510 int count_;
1599 }; 1511 };
1600 1512
1601
1602 class LStoreCodeEntry final : public LTemplateInstruction<0, 2, 0> { 1513 class LStoreCodeEntry final : public LTemplateInstruction<0, 2, 0> {
1603 public: 1514 public:
1604 LStoreCodeEntry(LOperand* function, LOperand* code_object) { 1515 LStoreCodeEntry(LOperand* function, LOperand* code_object) {
1605 inputs_[0] = function; 1516 inputs_[0] = function;
1606 inputs_[1] = code_object; 1517 inputs_[1] = code_object;
1607 } 1518 }
1608 1519
1609 LOperand* function() { return inputs_[0]; } 1520 LOperand* function() { return inputs_[0]; }
1610 LOperand* code_object() { return inputs_[1]; } 1521 LOperand* code_object() { return inputs_[1]; }
1611 1522
1612 void PrintDataTo(StringStream* stream) override; 1523 void PrintDataTo(StringStream* stream) override;
1613 1524
1614 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry") 1525 DECLARE_CONCRETE_INSTRUCTION(StoreCodeEntry, "store-code-entry")
1615 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry) 1526 DECLARE_HYDROGEN_ACCESSOR(StoreCodeEntry)
1616 }; 1527 };
1617 1528
1618
1619 class LInnerAllocatedObject final : public LTemplateInstruction<1, 2, 0> { 1529 class LInnerAllocatedObject final : public LTemplateInstruction<1, 2, 0> {
1620 public: 1530 public:
1621 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) { 1531 LInnerAllocatedObject(LOperand* base_object, LOperand* offset) {
1622 inputs_[0] = base_object; 1532 inputs_[0] = base_object;
1623 inputs_[1] = offset; 1533 inputs_[1] = offset;
1624 } 1534 }
1625 1535
1626 LOperand* base_object() const { return inputs_[0]; } 1536 LOperand* base_object() const { return inputs_[0]; }
1627 LOperand* offset() const { return inputs_[1]; } 1537 LOperand* offset() const { return inputs_[1]; }
1628 1538
1629 void PrintDataTo(StringStream* stream) override; 1539 void PrintDataTo(StringStream* stream) override;
1630 1540
1631 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object") 1541 DECLARE_CONCRETE_INSTRUCTION(InnerAllocatedObject, "inner-allocated-object")
1632 }; 1542 };
1633 1543
1634
1635 class LThisFunction final : public LTemplateInstruction<1, 0, 0> { 1544 class LThisFunction final : public LTemplateInstruction<1, 0, 0> {
1636 public: 1545 public:
1637 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function") 1546 DECLARE_CONCRETE_INSTRUCTION(ThisFunction, "this-function")
1638 DECLARE_HYDROGEN_ACCESSOR(ThisFunction) 1547 DECLARE_HYDROGEN_ACCESSOR(ThisFunction)
1639 }; 1548 };
1640 1549
1641
1642 class LContext final : public LTemplateInstruction<1, 0, 0> { 1550 class LContext final : public LTemplateInstruction<1, 0, 0> {
1643 public: 1551 public:
1644 DECLARE_CONCRETE_INSTRUCTION(Context, "context") 1552 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1645 DECLARE_HYDROGEN_ACCESSOR(Context) 1553 DECLARE_HYDROGEN_ACCESSOR(Context)
1646 }; 1554 };
1647 1555
1648
1649 class LDeclareGlobals final : public LTemplateInstruction<0, 1, 0> { 1556 class LDeclareGlobals final : public LTemplateInstruction<0, 1, 0> {
1650 public: 1557 public:
1651 explicit LDeclareGlobals(LOperand* context) { inputs_[0] = context; } 1558 explicit LDeclareGlobals(LOperand* context) { inputs_[0] = context; }
1652 1559
1653 LOperand* context() { return inputs_[0]; } 1560 LOperand* context() { return inputs_[0]; }
1654 1561
1655 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") 1562 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1656 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) 1563 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1657 }; 1564 };
1658 1565
1659
1660 class LCallWithDescriptor final : public LTemplateResultInstruction<1> { 1566 class LCallWithDescriptor final : public LTemplateResultInstruction<1> {
1661 public: 1567 public:
1662 LCallWithDescriptor(CallInterfaceDescriptor descriptor, 1568 LCallWithDescriptor(CallInterfaceDescriptor descriptor,
1663 const ZoneList<LOperand*>& operands, Zone* zone) 1569 const ZoneList<LOperand*>& operands, Zone* zone)
1664 : descriptor_(descriptor), 1570 : descriptor_(descriptor),
1665 inputs_(descriptor.GetRegisterParameterCount() + 1571 inputs_(descriptor.GetRegisterParameterCount() +
1666 kImplicitRegisterParameterCount, 1572 kImplicitRegisterParameterCount,
1667 zone) { 1573 zone) {
1668 DCHECK(descriptor.GetRegisterParameterCount() + 1574 DCHECK(descriptor.GetRegisterParameterCount() +
1669 kImplicitRegisterParameterCount == 1575 kImplicitRegisterParameterCount ==
(...skipping 22 matching lines...) Expand all
1692 ZoneList<LOperand*> inputs_; 1598 ZoneList<LOperand*> inputs_;
1693 1599
1694 // Iterator support. 1600 // Iterator support.
1695 int InputCount() final { return inputs_.length(); } 1601 int InputCount() final { return inputs_.length(); }
1696 LOperand* InputAt(int i) final { return inputs_[i]; } 1602 LOperand* InputAt(int i) final { return inputs_[i]; }
1697 1603
1698 int TempCount() final { return 0; } 1604 int TempCount() final { return 0; }
1699 LOperand* TempAt(int i) final { return NULL; } 1605 LOperand* TempAt(int i) final { return NULL; }
1700 }; 1606 };
1701 1607
1702
1703 class LInvokeFunction final : public LTemplateInstruction<1, 2, 0> { 1608 class LInvokeFunction final : public LTemplateInstruction<1, 2, 0> {
1704 public: 1609 public:
1705 LInvokeFunction(LOperand* context, LOperand* function) { 1610 LInvokeFunction(LOperand* context, LOperand* function) {
1706 inputs_[0] = context; 1611 inputs_[0] = context;
1707 inputs_[1] = function; 1612 inputs_[1] = function;
1708 } 1613 }
1709 1614
1710 LOperand* context() { return inputs_[0]; } 1615 LOperand* context() { return inputs_[0]; }
1711 LOperand* function() { return inputs_[1]; } 1616 LOperand* function() { return inputs_[1]; }
1712 1617
1713 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") 1618 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1714 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) 1619 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1715 1620
1716 void PrintDataTo(StringStream* stream) override; 1621 void PrintDataTo(StringStream* stream) override;
1717 1622
1718 int arity() const { return hydrogen()->argument_count() - 1; } 1623 int arity() const { return hydrogen()->argument_count() - 1; }
1719 }; 1624 };
1720 1625
1721
1722 class LCallNewArray final : public LTemplateInstruction<1, 2, 0> { 1626 class LCallNewArray final : public LTemplateInstruction<1, 2, 0> {
1723 public: 1627 public:
1724 LCallNewArray(LOperand* context, LOperand* constructor) { 1628 LCallNewArray(LOperand* context, LOperand* constructor) {
1725 inputs_[0] = context; 1629 inputs_[0] = context;
1726 inputs_[1] = constructor; 1630 inputs_[1] = constructor;
1727 } 1631 }
1728 1632
1729 LOperand* context() { return inputs_[0]; } 1633 LOperand* context() { return inputs_[0]; }
1730 LOperand* constructor() { return inputs_[1]; } 1634 LOperand* constructor() { return inputs_[1]; }
1731 1635
1732 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array") 1636 DECLARE_CONCRETE_INSTRUCTION(CallNewArray, "call-new-array")
1733 DECLARE_HYDROGEN_ACCESSOR(CallNewArray) 1637 DECLARE_HYDROGEN_ACCESSOR(CallNewArray)
1734 1638
1735 void PrintDataTo(StringStream* stream) override; 1639 void PrintDataTo(StringStream* stream) override;
1736 1640
1737 int arity() const { return hydrogen()->argument_count() - 1; } 1641 int arity() const { return hydrogen()->argument_count() - 1; }
1738 }; 1642 };
1739 1643
1740
1741 class LCallRuntime final : public LTemplateInstruction<1, 1, 0> { 1644 class LCallRuntime final : public LTemplateInstruction<1, 1, 0> {
1742 public: 1645 public:
1743 explicit LCallRuntime(LOperand* context) { inputs_[0] = context; } 1646 explicit LCallRuntime(LOperand* context) { inputs_[0] = context; }
1744 1647
1745 LOperand* context() { return inputs_[0]; } 1648 LOperand* context() { return inputs_[0]; }
1746 1649
1747 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") 1650 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1748 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) 1651 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1749 1652
1750 bool ClobbersDoubleRegisters(Isolate* isolate) const override { 1653 bool ClobbersDoubleRegisters(Isolate* isolate) const override {
1751 return save_doubles() == kDontSaveFPRegs; 1654 return save_doubles() == kDontSaveFPRegs;
1752 } 1655 }
1753 1656
1754 const Runtime::Function* function() const { return hydrogen()->function(); } 1657 const Runtime::Function* function() const { return hydrogen()->function(); }
1755 int arity() const { return hydrogen()->argument_count(); } 1658 int arity() const { return hydrogen()->argument_count(); }
1756 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); } 1659 SaveFPRegsMode save_doubles() const { return hydrogen()->save_doubles(); }
1757 }; 1660 };
1758 1661
1759
1760 class LInteger32ToDouble final : public LTemplateInstruction<1, 1, 0> { 1662 class LInteger32ToDouble final : public LTemplateInstruction<1, 1, 0> {
1761 public: 1663 public:
1762 explicit LInteger32ToDouble(LOperand* value) { inputs_[0] = value; } 1664 explicit LInteger32ToDouble(LOperand* value) { inputs_[0] = value; }
1763 1665
1764 LOperand* value() { return inputs_[0]; } 1666 LOperand* value() { return inputs_[0]; }
1765 1667
1766 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") 1668 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1767 }; 1669 };
1768 1670
1769
1770 class LUint32ToDouble final : public LTemplateInstruction<1, 1, 0> { 1671 class LUint32ToDouble final : public LTemplateInstruction<1, 1, 0> {
1771 public: 1672 public:
1772 explicit LUint32ToDouble(LOperand* value) { inputs_[0] = value; } 1673 explicit LUint32ToDouble(LOperand* value) { inputs_[0] = value; }
1773 1674
1774 LOperand* value() { return inputs_[0]; } 1675 LOperand* value() { return inputs_[0]; }
1775 1676
1776 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") 1677 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
1777 }; 1678 };
1778 1679
1779
1780 class LNumberTagI final : public LTemplateInstruction<1, 1, 2> { 1680 class LNumberTagI final : public LTemplateInstruction<1, 1, 2> {
1781 public: 1681 public:
1782 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) { 1682 LNumberTagI(LOperand* value, LOperand* temp1, LOperand* temp2) {
1783 inputs_[0] = value; 1683 inputs_[0] = value;
1784 temps_[0] = temp1; 1684 temps_[0] = temp1;
1785 temps_[1] = temp2; 1685 temps_[1] = temp2;
1786 } 1686 }
1787 1687
1788 LOperand* value() { return inputs_[0]; } 1688 LOperand* value() { return inputs_[0]; }
1789 LOperand* temp1() { return temps_[0]; } 1689 LOperand* temp1() { return temps_[0]; }
1790 LOperand* temp2() { return temps_[1]; } 1690 LOperand* temp2() { return temps_[1]; }
1791 1691
1792 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") 1692 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1793 }; 1693 };
1794 1694
1795
1796 class LNumberTagU final : public LTemplateInstruction<1, 1, 2> { 1695 class LNumberTagU final : public LTemplateInstruction<1, 1, 2> {
1797 public: 1696 public:
1798 LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) { 1697 LNumberTagU(LOperand* value, LOperand* temp1, LOperand* temp2) {
1799 inputs_[0] = value; 1698 inputs_[0] = value;
1800 temps_[0] = temp1; 1699 temps_[0] = temp1;
1801 temps_[1] = temp2; 1700 temps_[1] = temp2;
1802 } 1701 }
1803 1702
1804 LOperand* value() { return inputs_[0]; } 1703 LOperand* value() { return inputs_[0]; }
1805 LOperand* temp1() { return temps_[0]; } 1704 LOperand* temp1() { return temps_[0]; }
1806 LOperand* temp2() { return temps_[1]; } 1705 LOperand* temp2() { return temps_[1]; }
1807 1706
1808 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") 1707 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
1809 }; 1708 };
1810 1709
1811
1812 class LNumberTagD final : public LTemplateInstruction<1, 1, 2> { 1710 class LNumberTagD final : public LTemplateInstruction<1, 1, 2> {
1813 public: 1711 public:
1814 LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) { 1712 LNumberTagD(LOperand* value, LOperand* temp, LOperand* temp2) {
1815 inputs_[0] = value; 1713 inputs_[0] = value;
1816 temps_[0] = temp; 1714 temps_[0] = temp;
1817 temps_[1] = temp2; 1715 temps_[1] = temp2;
1818 } 1716 }
1819 1717
1820 LOperand* value() { return inputs_[0]; } 1718 LOperand* value() { return inputs_[0]; }
1821 LOperand* temp() { return temps_[0]; } 1719 LOperand* temp() { return temps_[0]; }
1822 LOperand* temp2() { return temps_[1]; } 1720 LOperand* temp2() { return temps_[1]; }
1823 1721
1824 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") 1722 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1825 DECLARE_HYDROGEN_ACCESSOR(Change) 1723 DECLARE_HYDROGEN_ACCESSOR(Change)
1826 }; 1724 };
1827 1725
1828
1829 class LDoubleToSmi final : public LTemplateInstruction<1, 1, 0> { 1726 class LDoubleToSmi final : public LTemplateInstruction<1, 1, 0> {
1830 public: 1727 public:
1831 explicit LDoubleToSmi(LOperand* value) { inputs_[0] = value; } 1728 explicit LDoubleToSmi(LOperand* value) { inputs_[0] = value; }
1832 1729
1833 LOperand* value() { return inputs_[0]; } 1730 LOperand* value() { return inputs_[0]; }
1834 1731
1835 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi") 1732 DECLARE_CONCRETE_INSTRUCTION(DoubleToSmi, "double-to-smi")
1836 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1733 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1837 1734
1838 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1735 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1839 }; 1736 };
1840 1737
1841
1842 // Sometimes truncating conversion from a tagged value to an int32. 1738 // Sometimes truncating conversion from a tagged value to an int32.
1843 class LDoubleToI final : public LTemplateInstruction<1, 1, 0> { 1739 class LDoubleToI final : public LTemplateInstruction<1, 1, 0> {
1844 public: 1740 public:
1845 explicit LDoubleToI(LOperand* value) { inputs_[0] = value; } 1741 explicit LDoubleToI(LOperand* value) { inputs_[0] = value; }
1846 1742
1847 LOperand* value() { return inputs_[0]; } 1743 LOperand* value() { return inputs_[0]; }
1848 1744
1849 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") 1745 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1850 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1746 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1851 1747
1852 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1748 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1853 }; 1749 };
1854 1750
1855
1856 // Truncating conversion from a tagged value to an int32. 1751 // Truncating conversion from a tagged value to an int32.
1857 class LTaggedToI final : public LTemplateInstruction<1, 1, 2> { 1752 class LTaggedToI final : public LTemplateInstruction<1, 1, 2> {
1858 public: 1753 public:
1859 LTaggedToI(LOperand* value, LOperand* temp, LOperand* temp2) { 1754 LTaggedToI(LOperand* value, LOperand* temp, LOperand* temp2) {
1860 inputs_[0] = value; 1755 inputs_[0] = value;
1861 temps_[0] = temp; 1756 temps_[0] = temp;
1862 temps_[1] = temp2; 1757 temps_[1] = temp2;
1863 } 1758 }
1864 1759
1865 LOperand* value() { return inputs_[0]; } 1760 LOperand* value() { return inputs_[0]; }
1866 LOperand* temp() { return temps_[0]; } 1761 LOperand* temp() { return temps_[0]; }
1867 LOperand* temp2() { return temps_[1]; } 1762 LOperand* temp2() { return temps_[1]; }
1868 1763
1869 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") 1764 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1870 DECLARE_HYDROGEN_ACCESSOR(Change) 1765 DECLARE_HYDROGEN_ACCESSOR(Change)
1871 1766
1872 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1767 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1873 }; 1768 };
1874 1769
1875
1876 class LSmiTag final : public LTemplateInstruction<1, 1, 0> { 1770 class LSmiTag final : public LTemplateInstruction<1, 1, 0> {
1877 public: 1771 public:
1878 explicit LSmiTag(LOperand* value) { inputs_[0] = value; } 1772 explicit LSmiTag(LOperand* value) { inputs_[0] = value; }
1879 1773
1880 LOperand* value() { return inputs_[0]; } 1774 LOperand* value() { return inputs_[0]; }
1881 1775
1882 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") 1776 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1883 DECLARE_HYDROGEN_ACCESSOR(Change) 1777 DECLARE_HYDROGEN_ACCESSOR(Change)
1884 }; 1778 };
1885 1779
1886
1887 class LNumberUntagD final : public LTemplateInstruction<1, 1, 0> { 1780 class LNumberUntagD final : public LTemplateInstruction<1, 1, 0> {
1888 public: 1781 public:
1889 explicit LNumberUntagD(LOperand* value) { inputs_[0] = value; } 1782 explicit LNumberUntagD(LOperand* value) { inputs_[0] = value; }
1890 1783
1891 LOperand* value() { return inputs_[0]; } 1784 LOperand* value() { return inputs_[0]; }
1892 1785
1893 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") 1786 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1894 DECLARE_HYDROGEN_ACCESSOR(Change) 1787 DECLARE_HYDROGEN_ACCESSOR(Change)
1895 }; 1788 };
1896 1789
1897
1898 class LSmiUntag final : public LTemplateInstruction<1, 1, 0> { 1790 class LSmiUntag final : public LTemplateInstruction<1, 1, 0> {
1899 public: 1791 public:
1900 LSmiUntag(LOperand* value, bool needs_check) : needs_check_(needs_check) { 1792 LSmiUntag(LOperand* value, bool needs_check) : needs_check_(needs_check) {
1901 inputs_[0] = value; 1793 inputs_[0] = value;
1902 } 1794 }
1903 1795
1904 LOperand* value() { return inputs_[0]; } 1796 LOperand* value() { return inputs_[0]; }
1905 bool needs_check() const { return needs_check_; } 1797 bool needs_check() const { return needs_check_; }
1906 1798
1907 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") 1799 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1908 1800
1909 private: 1801 private:
1910 bool needs_check_; 1802 bool needs_check_;
1911 }; 1803 };
1912 1804
1913
1914 class LStoreNamedField final : public LTemplateInstruction<0, 2, 1> { 1805 class LStoreNamedField final : public LTemplateInstruction<0, 2, 1> {
1915 public: 1806 public:
1916 LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) { 1807 LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
1917 inputs_[0] = object; 1808 inputs_[0] = object;
1918 inputs_[1] = value; 1809 inputs_[1] = value;
1919 temps_[0] = temp; 1810 temps_[0] = temp;
1920 } 1811 }
1921 1812
1922 LOperand* object() { return inputs_[0]; } 1813 LOperand* object() { return inputs_[0]; }
1923 LOperand* value() { return inputs_[1]; } 1814 LOperand* value() { return inputs_[1]; }
1924 LOperand* temp() { return temps_[0]; } 1815 LOperand* temp() { return temps_[0]; }
1925 1816
1926 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1817 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1927 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) 1818 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1928 1819
1929 void PrintDataTo(StringStream* stream) override; 1820 void PrintDataTo(StringStream* stream) override;
1930 1821
1931 Representation representation() const { 1822 Representation representation() const {
1932 return hydrogen()->field_representation(); 1823 return hydrogen()->field_representation();
1933 } 1824 }
1934 }; 1825 };
1935 1826
1936
1937 class LStoreNamedGeneric final : public LTemplateInstruction<0, 3, 2> { 1827 class LStoreNamedGeneric final : public LTemplateInstruction<0, 3, 2> {
1938 public: 1828 public:
1939 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value, 1829 LStoreNamedGeneric(LOperand* context, LOperand* object, LOperand* value,
1940 LOperand* slot, LOperand* vector) { 1830 LOperand* slot, LOperand* vector) {
1941 inputs_[0] = context; 1831 inputs_[0] = context;
1942 inputs_[1] = object; 1832 inputs_[1] = object;
1943 inputs_[2] = value; 1833 inputs_[2] = value;
1944 temps_[0] = slot; 1834 temps_[0] = slot;
1945 temps_[1] = vector; 1835 temps_[1] = vector;
1946 } 1836 }
1947 1837
1948 LOperand* context() { return inputs_[0]; } 1838 LOperand* context() { return inputs_[0]; }
1949 LOperand* object() { return inputs_[1]; } 1839 LOperand* object() { return inputs_[1]; }
1950 LOperand* value() { return inputs_[2]; } 1840 LOperand* value() { return inputs_[2]; }
1951 LOperand* temp_slot() { return temps_[0]; } 1841 LOperand* temp_slot() { return temps_[0]; }
1952 LOperand* temp_vector() { return temps_[1]; } 1842 LOperand* temp_vector() { return temps_[1]; }
1953 1843
1954 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1844 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1955 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 1845 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1956 1846
1957 void PrintDataTo(StringStream* stream) override; 1847 void PrintDataTo(StringStream* stream) override;
1958 1848
1959 Handle<Object> name() const { return hydrogen()->name(); } 1849 Handle<Object> name() const { return hydrogen()->name(); }
1960 LanguageMode language_mode() { return hydrogen()->language_mode(); } 1850 LanguageMode language_mode() { return hydrogen()->language_mode(); }
1961 }; 1851 };
1962 1852
1963
1964 class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> { 1853 class LStoreKeyed final : public LTemplateInstruction<0, 4, 0> {
1965 public: 1854 public:
1966 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value, 1855 LStoreKeyed(LOperand* object, LOperand* key, LOperand* value,
1967 LOperand* backing_store_owner) { 1856 LOperand* backing_store_owner) {
1968 inputs_[0] = object; 1857 inputs_[0] = object;
1969 inputs_[1] = key; 1858 inputs_[1] = key;
1970 inputs_[2] = value; 1859 inputs_[2] = value;
1971 inputs_[3] = backing_store_owner; 1860 inputs_[3] = backing_store_owner;
1972 } 1861 }
1973 1862
(...skipping 13 matching lines...) Expand all
1987 bool NeedsCanonicalization() { 1876 bool NeedsCanonicalization() {
1988 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() || 1877 if (hydrogen()->value()->IsAdd() || hydrogen()->value()->IsSub() ||
1989 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) { 1878 hydrogen()->value()->IsMul() || hydrogen()->value()->IsDiv()) {
1990 return false; 1879 return false;
1991 } 1880 }
1992 return hydrogen()->NeedsCanonicalization(); 1881 return hydrogen()->NeedsCanonicalization();
1993 } 1882 }
1994 uint32_t base_offset() const { return hydrogen()->base_offset(); } 1883 uint32_t base_offset() const { return hydrogen()->base_offset(); }
1995 }; 1884 };
1996 1885
1997
1998 class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> { 1886 class LStoreKeyedGeneric final : public LTemplateInstruction<0, 4, 2> {
1999 public: 1887 public:
2000 LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key, 1888 LStoreKeyedGeneric(LOperand* context, LOperand* object, LOperand* key,
2001 LOperand* value, LOperand* slot, LOperand* vector) { 1889 LOperand* value, LOperand* slot, LOperand* vector) {
2002 inputs_[0] = context; 1890 inputs_[0] = context;
2003 inputs_[1] = object; 1891 inputs_[1] = object;
2004 inputs_[2] = key; 1892 inputs_[2] = key;
2005 inputs_[3] = value; 1893 inputs_[3] = value;
2006 temps_[0] = slot; 1894 temps_[0] = slot;
2007 temps_[1] = vector; 1895 temps_[1] = vector;
2008 } 1896 }
2009 1897
2010 LOperand* context() { return inputs_[0]; } 1898 LOperand* context() { return inputs_[0]; }
2011 LOperand* object() { return inputs_[1]; } 1899 LOperand* object() { return inputs_[1]; }
2012 LOperand* key() { return inputs_[2]; } 1900 LOperand* key() { return inputs_[2]; }
2013 LOperand* value() { return inputs_[3]; } 1901 LOperand* value() { return inputs_[3]; }
2014 LOperand* temp_slot() { return temps_[0]; } 1902 LOperand* temp_slot() { return temps_[0]; }
2015 LOperand* temp_vector() { return temps_[1]; } 1903 LOperand* temp_vector() { return temps_[1]; }
2016 1904
2017 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 1905 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
2018 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) 1906 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
2019 1907
2020 void PrintDataTo(StringStream* stream) override; 1908 void PrintDataTo(StringStream* stream) override;
2021 1909
2022 LanguageMode language_mode() { return hydrogen()->language_mode(); } 1910 LanguageMode language_mode() { return hydrogen()->language_mode(); }
2023 }; 1911 };
2024 1912
2025
2026 class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> { 1913 class LTransitionElementsKind final : public LTemplateInstruction<0, 2, 1> {
2027 public: 1914 public:
2028 LTransitionElementsKind(LOperand* object, LOperand* context, 1915 LTransitionElementsKind(LOperand* object, LOperand* context,
2029 LOperand* new_map_temp) { 1916 LOperand* new_map_temp) {
2030 inputs_[0] = object; 1917 inputs_[0] = object;
2031 inputs_[1] = context; 1918 inputs_[1] = context;
2032 temps_[0] = new_map_temp; 1919 temps_[0] = new_map_temp;
2033 } 1920 }
2034 1921
2035 LOperand* context() { return inputs_[1]; } 1922 LOperand* context() { return inputs_[1]; }
2036 LOperand* object() { return inputs_[0]; } 1923 LOperand* object() { return inputs_[0]; }
2037 LOperand* new_map_temp() { return temps_[0]; } 1924 LOperand* new_map_temp() { return temps_[0]; }
2038 1925
2039 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, 1926 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
2040 "transition-elements-kind") 1927 "transition-elements-kind")
2041 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) 1928 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
2042 1929
2043 void PrintDataTo(StringStream* stream) override; 1930 void PrintDataTo(StringStream* stream) override;
2044 1931
2045 Handle<Map> original_map() { return hydrogen()->original_map().handle(); } 1932 Handle<Map> original_map() { return hydrogen()->original_map().handle(); }
2046 Handle<Map> transitioned_map() { 1933 Handle<Map> transitioned_map() {
2047 return hydrogen()->transitioned_map().handle(); 1934 return hydrogen()->transitioned_map().handle();
2048 } 1935 }
2049 ElementsKind from_kind() { return hydrogen()->from_kind(); } 1936 ElementsKind from_kind() { return hydrogen()->from_kind(); }
2050 ElementsKind to_kind() { return hydrogen()->to_kind(); } 1937 ElementsKind to_kind() { return hydrogen()->to_kind(); }
2051 }; 1938 };
2052 1939
2053
2054 class LTrapAllocationMemento final : public LTemplateInstruction<0, 1, 1> { 1940 class LTrapAllocationMemento final : public LTemplateInstruction<0, 1, 1> {
2055 public: 1941 public:
2056 LTrapAllocationMemento(LOperand* object, LOperand* temp) { 1942 LTrapAllocationMemento(LOperand* object, LOperand* temp) {
2057 inputs_[0] = object; 1943 inputs_[0] = object;
2058 temps_[0] = temp; 1944 temps_[0] = temp;
2059 } 1945 }
2060 1946
2061 LOperand* object() { return inputs_[0]; } 1947 LOperand* object() { return inputs_[0]; }
2062 LOperand* temp() { return temps_[0]; } 1948 LOperand* temp() { return temps_[0]; }
2063 1949
2064 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento") 1950 DECLARE_CONCRETE_INSTRUCTION(TrapAllocationMemento, "trap-allocation-memento")
2065 }; 1951 };
2066 1952
2067
2068 class LMaybeGrowElements final : public LTemplateInstruction<1, 5, 0> { 1953 class LMaybeGrowElements final : public LTemplateInstruction<1, 5, 0> {
2069 public: 1954 public:
2070 LMaybeGrowElements(LOperand* context, LOperand* object, LOperand* elements, 1955 LMaybeGrowElements(LOperand* context, LOperand* object, LOperand* elements,
2071 LOperand* key, LOperand* current_capacity) { 1956 LOperand* key, LOperand* current_capacity) {
2072 inputs_[0] = context; 1957 inputs_[0] = context;
2073 inputs_[1] = object; 1958 inputs_[1] = object;
2074 inputs_[2] = elements; 1959 inputs_[2] = elements;
2075 inputs_[3] = key; 1960 inputs_[3] = key;
2076 inputs_[4] = current_capacity; 1961 inputs_[4] = current_capacity;
2077 } 1962 }
2078 1963
2079 LOperand* context() { return inputs_[0]; } 1964 LOperand* context() { return inputs_[0]; }
2080 LOperand* object() { return inputs_[1]; } 1965 LOperand* object() { return inputs_[1]; }
2081 LOperand* elements() { return inputs_[2]; } 1966 LOperand* elements() { return inputs_[2]; }
2082 LOperand* key() { return inputs_[3]; } 1967 LOperand* key() { return inputs_[3]; }
2083 LOperand* current_capacity() { return inputs_[4]; } 1968 LOperand* current_capacity() { return inputs_[4]; }
2084 1969
2085 DECLARE_HYDROGEN_ACCESSOR(MaybeGrowElements) 1970 DECLARE_HYDROGEN_ACCESSOR(MaybeGrowElements)
2086 DECLARE_CONCRETE_INSTRUCTION(MaybeGrowElements, "maybe-grow-elements") 1971 DECLARE_CONCRETE_INSTRUCTION(MaybeGrowElements, "maybe-grow-elements")
2087 }; 1972 };
2088 1973
2089
2090 class LStringAdd final : public LTemplateInstruction<1, 3, 0> { 1974 class LStringAdd final : public LTemplateInstruction<1, 3, 0> {
2091 public: 1975 public:
2092 LStringAdd(LOperand* context, LOperand* left, LOperand* right) { 1976 LStringAdd(LOperand* context, LOperand* left, LOperand* right) {
2093 inputs_[0] = context; 1977 inputs_[0] = context;
2094 inputs_[1] = left; 1978 inputs_[1] = left;
2095 inputs_[2] = right; 1979 inputs_[2] = right;
2096 } 1980 }
2097 1981
2098 LOperand* context() { return inputs_[0]; } 1982 LOperand* context() { return inputs_[0]; }
2099 LOperand* left() { return inputs_[1]; } 1983 LOperand* left() { return inputs_[1]; }
2100 LOperand* right() { return inputs_[2]; } 1984 LOperand* right() { return inputs_[2]; }
2101 1985
2102 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") 1986 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
2103 DECLARE_HYDROGEN_ACCESSOR(StringAdd) 1987 DECLARE_HYDROGEN_ACCESSOR(StringAdd)
2104 }; 1988 };
2105 1989
2106
2107 class LStringCharCodeAt final : public LTemplateInstruction<1, 3, 0> { 1990 class LStringCharCodeAt final : public LTemplateInstruction<1, 3, 0> {
2108 public: 1991 public:
2109 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) { 1992 LStringCharCodeAt(LOperand* context, LOperand* string, LOperand* index) {
2110 inputs_[0] = context; 1993 inputs_[0] = context;
2111 inputs_[1] = string; 1994 inputs_[1] = string;
2112 inputs_[2] = index; 1995 inputs_[2] = index;
2113 } 1996 }
2114 1997
2115 LOperand* context() { return inputs_[0]; } 1998 LOperand* context() { return inputs_[0]; }
2116 LOperand* string() { return inputs_[1]; } 1999 LOperand* string() { return inputs_[1]; }
2117 LOperand* index() { return inputs_[2]; } 2000 LOperand* index() { return inputs_[2]; }
2118 2001
2119 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") 2002 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
2120 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) 2003 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
2121 }; 2004 };
2122 2005
2123
2124 class LStringCharFromCode final : public LTemplateInstruction<1, 2, 0> { 2006 class LStringCharFromCode final : public LTemplateInstruction<1, 2, 0> {
2125 public: 2007 public:
2126 explicit LStringCharFromCode(LOperand* context, LOperand* char_code) { 2008 explicit LStringCharFromCode(LOperand* context, LOperand* char_code) {
2127 inputs_[0] = context; 2009 inputs_[0] = context;
2128 inputs_[1] = char_code; 2010 inputs_[1] = char_code;
2129 } 2011 }
2130 2012
2131 LOperand* context() { return inputs_[0]; } 2013 LOperand* context() { return inputs_[0]; }
2132 LOperand* char_code() { return inputs_[1]; } 2014 LOperand* char_code() { return inputs_[1]; }
2133 2015
2134 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") 2016 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
2135 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) 2017 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
2136 }; 2018 };
2137 2019
2138
2139 class LCheckValue final : public LTemplateInstruction<0, 1, 0> { 2020 class LCheckValue final : public LTemplateInstruction<0, 1, 0> {
2140 public: 2021 public:
2141 explicit LCheckValue(LOperand* value) { inputs_[0] = value; } 2022 explicit LCheckValue(LOperand* value) { inputs_[0] = value; }
2142 2023
2143 LOperand* value() { return inputs_[0]; } 2024 LOperand* value() { return inputs_[0]; }
2144 2025
2145 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value") 2026 DECLARE_CONCRETE_INSTRUCTION(CheckValue, "check-value")
2146 DECLARE_HYDROGEN_ACCESSOR(CheckValue) 2027 DECLARE_HYDROGEN_ACCESSOR(CheckValue)
2147 }; 2028 };
2148 2029
2149
2150 class LCheckArrayBufferNotNeutered final 2030 class LCheckArrayBufferNotNeutered final
2151 : public LTemplateInstruction<0, 1, 0> { 2031 : public LTemplateInstruction<0, 1, 0> {
2152 public: 2032 public:
2153 explicit LCheckArrayBufferNotNeutered(LOperand* view) { inputs_[0] = view; } 2033 explicit LCheckArrayBufferNotNeutered(LOperand* view) { inputs_[0] = view; }
2154 2034
2155 LOperand* view() { return inputs_[0]; } 2035 LOperand* view() { return inputs_[0]; }
2156 2036
2157 DECLARE_CONCRETE_INSTRUCTION(CheckArrayBufferNotNeutered, 2037 DECLARE_CONCRETE_INSTRUCTION(CheckArrayBufferNotNeutered,
2158 "check-array-buffer-not-neutered") 2038 "check-array-buffer-not-neutered")
2159 DECLARE_HYDROGEN_ACCESSOR(CheckArrayBufferNotNeutered) 2039 DECLARE_HYDROGEN_ACCESSOR(CheckArrayBufferNotNeutered)
2160 }; 2040 };
2161 2041
2162
2163 class LCheckInstanceType final : public LTemplateInstruction<0, 1, 0> { 2042 class LCheckInstanceType final : public LTemplateInstruction<0, 1, 0> {
2164 public: 2043 public:
2165 explicit LCheckInstanceType(LOperand* value) { inputs_[0] = value; } 2044 explicit LCheckInstanceType(LOperand* value) { inputs_[0] = value; }
2166 2045
2167 LOperand* value() { return inputs_[0]; } 2046 LOperand* value() { return inputs_[0]; }
2168 2047
2169 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") 2048 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
2170 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) 2049 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
2171 }; 2050 };
2172 2051
2173
2174 class LCheckMaps final : public LTemplateInstruction<0, 1, 1> { 2052 class LCheckMaps final : public LTemplateInstruction<0, 1, 1> {
2175 public: 2053 public:
2176 explicit LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) { 2054 explicit LCheckMaps(LOperand* value = NULL, LOperand* temp = NULL) {
2177 inputs_[0] = value; 2055 inputs_[0] = value;
2178 temps_[0] = temp; 2056 temps_[0] = temp;
2179 } 2057 }
2180 2058
2181 LOperand* value() { return inputs_[0]; } 2059 LOperand* value() { return inputs_[0]; }
2182 LOperand* temp() { return temps_[0]; } 2060 LOperand* temp() { return temps_[0]; }
2183 2061
2184 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") 2062 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
2185 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) 2063 DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
2186 }; 2064 };
2187 2065
2188
2189 class LCheckSmi final : public LTemplateInstruction<1, 1, 0> { 2066 class LCheckSmi final : public LTemplateInstruction<1, 1, 0> {
2190 public: 2067 public:
2191 explicit LCheckSmi(LOperand* value) { inputs_[0] = value; } 2068 explicit LCheckSmi(LOperand* value) { inputs_[0] = value; }
2192 2069
2193 LOperand* value() { return inputs_[0]; } 2070 LOperand* value() { return inputs_[0]; }
2194 2071
2195 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") 2072 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
2196 }; 2073 };
2197 2074
2198
2199 class LCheckNonSmi final : public LTemplateInstruction<0, 1, 0> { 2075 class LCheckNonSmi final : public LTemplateInstruction<0, 1, 0> {
2200 public: 2076 public:
2201 explicit LCheckNonSmi(LOperand* value) { inputs_[0] = value; } 2077 explicit LCheckNonSmi(LOperand* value) { inputs_[0] = value; }
2202 2078
2203 LOperand* value() { return inputs_[0]; } 2079 LOperand* value() { return inputs_[0]; }
2204 2080
2205 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") 2081 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2206 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject) 2082 DECLARE_HYDROGEN_ACCESSOR(CheckHeapObject)
2207 }; 2083 };
2208 2084
2209
2210 class LClampDToUint8 final : public LTemplateInstruction<1, 1, 0> { 2085 class LClampDToUint8 final : public LTemplateInstruction<1, 1, 0> {
2211 public: 2086 public:
2212 explicit LClampDToUint8(LOperand* unclamped) { inputs_[0] = unclamped; } 2087 explicit LClampDToUint8(LOperand* unclamped) { inputs_[0] = unclamped; }
2213 2088
2214 LOperand* unclamped() { return inputs_[0]; } 2089 LOperand* unclamped() { return inputs_[0]; }
2215 2090
2216 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") 2091 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
2217 }; 2092 };
2218 2093
2219
2220 class LClampIToUint8 final : public LTemplateInstruction<1, 1, 0> { 2094 class LClampIToUint8 final : public LTemplateInstruction<1, 1, 0> {
2221 public: 2095 public:
2222 explicit LClampIToUint8(LOperand* unclamped) { inputs_[0] = unclamped; } 2096 explicit LClampIToUint8(LOperand* unclamped) { inputs_[0] = unclamped; }
2223 2097
2224 LOperand* unclamped() { return inputs_[0]; } 2098 LOperand* unclamped() { return inputs_[0]; }
2225 2099
2226 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") 2100 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
2227 }; 2101 };
2228 2102
2229
2230 class LClampTToUint8 final : public LTemplateInstruction<1, 1, 1> { 2103 class LClampTToUint8 final : public LTemplateInstruction<1, 1, 1> {
2231 public: 2104 public:
2232 LClampTToUint8(LOperand* unclamped, LOperand* temp) { 2105 LClampTToUint8(LOperand* unclamped, LOperand* temp) {
2233 inputs_[0] = unclamped; 2106 inputs_[0] = unclamped;
2234 temps_[0] = temp; 2107 temps_[0] = temp;
2235 } 2108 }
2236 2109
2237 LOperand* unclamped() { return inputs_[0]; } 2110 LOperand* unclamped() { return inputs_[0]; }
2238 LOperand* temp() { return temps_[0]; } 2111 LOperand* temp() { return temps_[0]; }
2239 2112
2240 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") 2113 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2241 }; 2114 };
2242 2115
2243
2244 class LDoubleBits final : public LTemplateInstruction<1, 1, 0> { 2116 class LDoubleBits final : public LTemplateInstruction<1, 1, 0> {
2245 public: 2117 public:
2246 explicit LDoubleBits(LOperand* value) { inputs_[0] = value; } 2118 explicit LDoubleBits(LOperand* value) { inputs_[0] = value; }
2247 2119
2248 LOperand* value() { return inputs_[0]; } 2120 LOperand* value() { return inputs_[0]; }
2249 2121
2250 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits") 2122 DECLARE_CONCRETE_INSTRUCTION(DoubleBits, "double-bits")
2251 DECLARE_HYDROGEN_ACCESSOR(DoubleBits) 2123 DECLARE_HYDROGEN_ACCESSOR(DoubleBits)
2252 }; 2124 };
2253 2125
2254
2255 class LConstructDouble final : public LTemplateInstruction<1, 2, 0> { 2126 class LConstructDouble final : public LTemplateInstruction<1, 2, 0> {
2256 public: 2127 public:
2257 LConstructDouble(LOperand* hi, LOperand* lo) { 2128 LConstructDouble(LOperand* hi, LOperand* lo) {
2258 inputs_[0] = hi; 2129 inputs_[0] = hi;
2259 inputs_[1] = lo; 2130 inputs_[1] = lo;
2260 } 2131 }
2261 2132
2262 LOperand* hi() { return inputs_[0]; } 2133 LOperand* hi() { return inputs_[0]; }
2263 LOperand* lo() { return inputs_[1]; } 2134 LOperand* lo() { return inputs_[1]; }
2264 2135
2265 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double") 2136 DECLARE_CONCRETE_INSTRUCTION(ConstructDouble, "construct-double")
2266 }; 2137 };
2267 2138
2268
2269 class LAllocate final : public LTemplateInstruction<1, 2, 2> { 2139 class LAllocate final : public LTemplateInstruction<1, 2, 2> {
2270 public: 2140 public:
2271 LAllocate(LOperand* context, LOperand* size, LOperand* temp1, 2141 LAllocate(LOperand* context, LOperand* size, LOperand* temp1,
2272 LOperand* temp2) { 2142 LOperand* temp2) {
2273 inputs_[0] = context; 2143 inputs_[0] = context;
2274 inputs_[1] = size; 2144 inputs_[1] = size;
2275 temps_[0] = temp1; 2145 temps_[0] = temp1;
2276 temps_[1] = temp2; 2146 temps_[1] = temp2;
2277 } 2147 }
2278 2148
2279 LOperand* context() { return inputs_[0]; } 2149 LOperand* context() { return inputs_[0]; }
2280 LOperand* size() { return inputs_[1]; } 2150 LOperand* size() { return inputs_[1]; }
2281 LOperand* temp1() { return temps_[0]; } 2151 LOperand* temp1() { return temps_[0]; }
2282 LOperand* temp2() { return temps_[1]; } 2152 LOperand* temp2() { return temps_[1]; }
2283 2153
2284 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate") 2154 DECLARE_CONCRETE_INSTRUCTION(Allocate, "allocate")
2285 DECLARE_HYDROGEN_ACCESSOR(Allocate) 2155 DECLARE_HYDROGEN_ACCESSOR(Allocate)
2286 }; 2156 };
2287 2157
2288
2289 class LToFastProperties final : public LTemplateInstruction<1, 1, 0> { 2158 class LToFastProperties final : public LTemplateInstruction<1, 1, 0> {
2290 public: 2159 public:
2291 explicit LToFastProperties(LOperand* value) { inputs_[0] = value; } 2160 explicit LToFastProperties(LOperand* value) { inputs_[0] = value; }
2292 2161
2293 LOperand* value() { return inputs_[0]; } 2162 LOperand* value() { return inputs_[0]; }
2294 2163
2295 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") 2164 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2296 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) 2165 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2297 }; 2166 };
2298 2167
2299
2300 class LTypeof final : public LTemplateInstruction<1, 2, 0> { 2168 class LTypeof final : public LTemplateInstruction<1, 2, 0> {
2301 public: 2169 public:
2302 LTypeof(LOperand* context, LOperand* value) { 2170 LTypeof(LOperand* context, LOperand* value) {
2303 inputs_[0] = context; 2171 inputs_[0] = context;
2304 inputs_[1] = value; 2172 inputs_[1] = value;
2305 } 2173 }
2306 2174
2307 LOperand* context() { return inputs_[0]; } 2175 LOperand* context() { return inputs_[0]; }
2308 LOperand* value() { return inputs_[1]; } 2176 LOperand* value() { return inputs_[1]; }
2309 2177
2310 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") 2178 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2311 }; 2179 };
2312 2180
2313
2314 class LTypeofIsAndBranch final : public LControlInstruction<1, 0> { 2181 class LTypeofIsAndBranch final : public LControlInstruction<1, 0> {
2315 public: 2182 public:
2316 explicit LTypeofIsAndBranch(LOperand* value) { inputs_[0] = value; } 2183 explicit LTypeofIsAndBranch(LOperand* value) { inputs_[0] = value; }
2317 2184
2318 LOperand* value() { return inputs_[0]; } 2185 LOperand* value() { return inputs_[0]; }
2319 2186
2320 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") 2187 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2321 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) 2188 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2322 2189
2323 Handle<String> type_literal() { return hydrogen()->type_literal(); } 2190 Handle<String> type_literal() { return hydrogen()->type_literal(); }
2324 2191
2325 void PrintDataTo(StringStream* stream) override; 2192 void PrintDataTo(StringStream* stream) override;
2326 }; 2193 };
2327 2194
2328
2329 class LOsrEntry final : public LTemplateInstruction<0, 0, 0> { 2195 class LOsrEntry final : public LTemplateInstruction<0, 0, 0> {
2330 public: 2196 public:
2331 LOsrEntry() {} 2197 LOsrEntry() {}
2332 2198
2333 bool HasInterestingComment(LCodeGen* gen) const override { return false; } 2199 bool HasInterestingComment(LCodeGen* gen) const override { return false; }
2334 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") 2200 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2335 }; 2201 };
2336 2202
2337
2338 class LStackCheck final : public LTemplateInstruction<0, 1, 0> { 2203 class LStackCheck final : public LTemplateInstruction<0, 1, 0> {
2339 public: 2204 public:
2340 explicit LStackCheck(LOperand* context) { inputs_[0] = context; } 2205 explicit LStackCheck(LOperand* context) { inputs_[0] = context; }
2341 2206
2342 LOperand* context() { return inputs_[0]; } 2207 LOperand* context() { return inputs_[0]; }
2343 2208
2344 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check") 2209 DECLARE_CONCRETE_INSTRUCTION(StackCheck, "stack-check")
2345 DECLARE_HYDROGEN_ACCESSOR(StackCheck) 2210 DECLARE_HYDROGEN_ACCESSOR(StackCheck)
2346 2211
2347 Label* done_label() { return &done_label_; } 2212 Label* done_label() { return &done_label_; }
2348 2213
2349 private: 2214 private:
2350 Label done_label_; 2215 Label done_label_;
2351 }; 2216 };
2352 2217
2353
2354 class LForInPrepareMap final : public LTemplateInstruction<1, 2, 0> { 2218 class LForInPrepareMap final : public LTemplateInstruction<1, 2, 0> {
2355 public: 2219 public:
2356 LForInPrepareMap(LOperand* context, LOperand* object) { 2220 LForInPrepareMap(LOperand* context, LOperand* object) {
2357 inputs_[0] = context; 2221 inputs_[0] = context;
2358 inputs_[1] = object; 2222 inputs_[1] = object;
2359 } 2223 }
2360 2224
2361 LOperand* context() { return inputs_[0]; } 2225 LOperand* context() { return inputs_[0]; }
2362 LOperand* object() { return inputs_[1]; } 2226 LOperand* object() { return inputs_[1]; }
2363 2227
2364 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map") 2228 DECLARE_CONCRETE_INSTRUCTION(ForInPrepareMap, "for-in-prepare-map")
2365 }; 2229 };
2366 2230
2367
2368 class LForInCacheArray final : public LTemplateInstruction<1, 1, 0> { 2231 class LForInCacheArray final : public LTemplateInstruction<1, 1, 0> {
2369 public: 2232 public:
2370 explicit LForInCacheArray(LOperand* map) { inputs_[0] = map; } 2233 explicit LForInCacheArray(LOperand* map) { inputs_[0] = map; }
2371 2234
2372 LOperand* map() { return inputs_[0]; } 2235 LOperand* map() { return inputs_[0]; }
2373 2236
2374 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array") 2237 DECLARE_CONCRETE_INSTRUCTION(ForInCacheArray, "for-in-cache-array")
2375 2238
2376 int idx() { return HForInCacheArray::cast(this->hydrogen_value())->idx(); } 2239 int idx() { return HForInCacheArray::cast(this->hydrogen_value())->idx(); }
2377 }; 2240 };
2378 2241
2379
2380 class LCheckMapValue final : public LTemplateInstruction<0, 2, 0> { 2242 class LCheckMapValue final : public LTemplateInstruction<0, 2, 0> {
2381 public: 2243 public:
2382 LCheckMapValue(LOperand* value, LOperand* map) { 2244 LCheckMapValue(LOperand* value, LOperand* map) {
2383 inputs_[0] = value; 2245 inputs_[0] = value;
2384 inputs_[1] = map; 2246 inputs_[1] = map;
2385 } 2247 }
2386 2248
2387 LOperand* value() { return inputs_[0]; } 2249 LOperand* value() { return inputs_[0]; }
2388 LOperand* map() { return inputs_[1]; } 2250 LOperand* map() { return inputs_[1]; }
2389 2251
2390 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value") 2252 DECLARE_CONCRETE_INSTRUCTION(CheckMapValue, "check-map-value")
2391 }; 2253 };
2392 2254
2393
2394 class LLoadFieldByIndex final : public LTemplateInstruction<1, 2, 0> { 2255 class LLoadFieldByIndex final : public LTemplateInstruction<1, 2, 0> {
2395 public: 2256 public:
2396 LLoadFieldByIndex(LOperand* object, LOperand* index) { 2257 LLoadFieldByIndex(LOperand* object, LOperand* index) {
2397 inputs_[0] = object; 2258 inputs_[0] = object;
2398 inputs_[1] = index; 2259 inputs_[1] = index;
2399 } 2260 }
2400 2261
2401 LOperand* object() { return inputs_[0]; } 2262 LOperand* object() { return inputs_[0]; }
2402 LOperand* index() { return inputs_[1]; } 2263 LOperand* index() { return inputs_[1]; }
2403 2264
2404 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index") 2265 DECLARE_CONCRETE_INSTRUCTION(LoadFieldByIndex, "load-field-by-index")
2405 }; 2266 };
2406 2267
2407
2408 class LStoreFrameContext : public LTemplateInstruction<0, 1, 0> { 2268 class LStoreFrameContext : public LTemplateInstruction<0, 1, 0> {
2409 public: 2269 public:
2410 explicit LStoreFrameContext(LOperand* context) { inputs_[0] = context; } 2270 explicit LStoreFrameContext(LOperand* context) { inputs_[0] = context; }
2411 2271
2412 LOperand* context() { return inputs_[0]; } 2272 LOperand* context() { return inputs_[0]; }
2413 2273
2414 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context") 2274 DECLARE_CONCRETE_INSTRUCTION(StoreFrameContext, "store-frame-context")
2415 }; 2275 };
2416 2276
2417
2418 class LChunkBuilder; 2277 class LChunkBuilder;
2419 class LPlatformChunk final : public LChunk { 2278 class LPlatformChunk final : public LChunk {
2420 public: 2279 public:
2421 LPlatformChunk(CompilationInfo* info, HGraph* graph) : LChunk(info, graph) {} 2280 LPlatformChunk(CompilationInfo* info, HGraph* graph) : LChunk(info, graph) {}
2422 2281
2423 int GetNextSpillIndex(RegisterKind kind); 2282 int GetNextSpillIndex(RegisterKind kind);
2424 LOperand* GetNextSpillSlot(RegisterKind kind); 2283 LOperand* GetNextSpillSlot(RegisterKind kind);
2425 }; 2284 };
2426 2285
2427
2428 class LChunkBuilder final : public LChunkBuilderBase { 2286 class LChunkBuilder final : public LChunkBuilderBase {
2429 public: 2287 public:
2430 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator) 2288 LChunkBuilder(CompilationInfo* info, HGraph* graph, LAllocator* allocator)
2431 : LChunkBuilderBase(info, graph), 2289 : LChunkBuilderBase(info, graph),
2432 current_instruction_(NULL), 2290 current_instruction_(NULL),
2433 current_block_(NULL), 2291 current_block_(NULL),
2434 next_block_(NULL), 2292 next_block_(NULL),
2435 allocator_(allocator) {} 2293 allocator_(allocator) {}
2436 2294
2437 // Build the sequence for the graph. 2295 // Build the sequence for the graph.
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2555 LAllocator* allocator_; 2413 LAllocator* allocator_;
2556 2414
2557 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2415 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2558 }; 2416 };
2559 2417
2560 #undef DECLARE_HYDROGEN_ACCESSOR 2418 #undef DECLARE_HYDROGEN_ACCESSOR
2561 #undef DECLARE_CONCRETE_INSTRUCTION 2419 #undef DECLARE_CONCRETE_INSTRUCTION
2562 } // namespace internal 2420 } // namespace internal
2563 } // namespace v8 2421 } // namespace v8
2564 2422
2565 #endif // V8_CRANKSHAFT_PPC_LITHIUM_PPC_H_ 2423 #endif // V8_CRANKSHAFT_S390_LITHIUM_S390_H_
OLDNEW
« no previous file with comments | « src/crankshaft/s390/lithium-gap-resolver-s390.cc ('k') | src/crankshaft/s390/lithium-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698