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

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

Issue 10933087: Consistently use named getters for Lithium operands on x64 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed review comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 void MarkAsCall() { is_call_ = true; } 255 void MarkAsCall() { is_call_ = true; }
256 256
257 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { } 257 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { }
258 258
259 // Interface to the register allocator and iterators. 259 // Interface to the register allocator and iterators.
260 bool IsMarkedAsCall() const { return is_call_; } 260 bool IsMarkedAsCall() const { return is_call_; }
261 261
262 virtual bool HasResult() const = 0; 262 virtual bool HasResult() const = 0;
263 virtual LOperand* result() = 0; 263 virtual LOperand* result() = 0;
264 264
265 virtual int TempCount() = 0;
266 virtual LOperand* TempAt(int i) = 0;
267
268 LOperand* FirstInput() { return InputAt(0); } 265 LOperand* FirstInput() { return InputAt(0); }
269 LOperand* Output() { return HasResult() ? result() : NULL; } 266 LOperand* Output() { return HasResult() ? result() : NULL; }
270 267
271 #ifdef DEBUG 268 #ifdef DEBUG
272 void VerifyCall(); 269 void VerifyCall();
273 #endif 270 #endif
274 271
275 private: 272 private:
276 // Iterator support. 273 // Iterator support.
277 friend class InputIterator; 274 friend class InputIterator;
278 virtual int InputCount() = 0; 275 virtual int InputCount() = 0;
279 virtual LOperand* InputAt(int i) = 0; 276 virtual LOperand* InputAt(int i) = 0;
280 277
278 friend class TempIterator;
279 virtual int TempCount() = 0;
280 virtual LOperand* TempAt(int i) = 0;
281
281 LEnvironment* environment_; 282 LEnvironment* environment_;
282 SetOncePointer<LPointerMap> pointer_map_; 283 SetOncePointer<LPointerMap> pointer_map_;
283 HValue* hydrogen_value_; 284 HValue* hydrogen_value_;
284 bool is_call_; 285 bool is_call_;
285 }; 286 };
286 287
287 288
288 // R = number of result operands (0 or 1). 289 // R = number of result operands (0 or 1).
289 // I = number of input operands. 290 // I = number of input operands.
290 // T = number of temporary operands. 291 // T = number of temporary operands.
291 template<int R, int I, int T> 292 template<int R, int I, int T>
292 class LTemplateInstruction: public LInstruction { 293 class LTemplateInstruction: public LInstruction {
293 public: 294 public:
294 // Allow 0 or 1 output operands. 295 // Allow 0 or 1 output operands.
295 STATIC_ASSERT(R == 0 || R == 1); 296 STATIC_ASSERT(R == 0 || R == 1);
296 virtual bool HasResult() const { return R != 0; } 297 virtual bool HasResult() const { return R != 0; }
297 void set_result(LOperand* operand) { results_[0] = operand; } 298 void set_result(LOperand* operand) { results_[0] = operand; }
298 LOperand* result() { return results_[0]; } 299 LOperand* result() { return results_[0]; }
299 300
300 LOperand* InputAt(int i) { return inputs_[i]; }
301
302 int TempCount() { return T; }
303 LOperand* TempAt(int i) { return temps_[i]; }
304
305 protected: 301 protected:
306 EmbeddedContainer<LOperand*, R> results_; 302 EmbeddedContainer<LOperand*, R> results_;
307 EmbeddedContainer<LOperand*, I> inputs_; 303 EmbeddedContainer<LOperand*, I> inputs_;
308 EmbeddedContainer<LOperand*, T> temps_; 304 EmbeddedContainer<LOperand*, T> temps_;
309 305
310 private: 306 private:
307 // Iterator support.
311 virtual int InputCount() { return I; } 308 virtual int InputCount() { return I; }
309 virtual LOperand* InputAt(int i) { return inputs_[i]; }
310
311 virtual int TempCount() { return T; }
312 virtual LOperand* TempAt(int i) { return temps_[i]; }
312 }; 313 };
313 314
314 315
315 class LGap: public LTemplateInstruction<0, 0, 0> { 316 class LGap: public LTemplateInstruction<0, 0, 0> {
316 public: 317 public:
317 explicit LGap(HBasicBlock* block) 318 explicit LGap(HBasicBlock* block)
318 : block_(block) { 319 : block_(block) {
319 parallel_moves_[BEFORE] = NULL; 320 parallel_moves_[BEFORE] = NULL;
320 parallel_moves_[START] = NULL; 321 parallel_moves_[START] = NULL;
321 parallel_moves_[END] = NULL; 322 parallel_moves_[END] = NULL;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 }; 469 };
469 470
470 471
471 class LWrapReceiver: public LTemplateInstruction<1, 2, 0> { 472 class LWrapReceiver: public LTemplateInstruction<1, 2, 0> {
472 public: 473 public:
473 LWrapReceiver(LOperand* receiver, LOperand* function) { 474 LWrapReceiver(LOperand* receiver, LOperand* function) {
474 inputs_[0] = receiver; 475 inputs_[0] = receiver;
475 inputs_[1] = function; 476 inputs_[1] = function;
476 } 477 }
477 478
478 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
479
480 LOperand* receiver() { return inputs_[0]; } 479 LOperand* receiver() { return inputs_[0]; }
481 LOperand* function() { return inputs_[1]; } 480 LOperand* function() { return inputs_[1]; }
481
482 DECLARE_CONCRETE_INSTRUCTION(WrapReceiver, "wrap-receiver")
482 }; 483 };
483 484
484 485
485 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { 486 class LApplyArguments: public LTemplateInstruction<1, 4, 0> {
486 public: 487 public:
487 LApplyArguments(LOperand* function, 488 LApplyArguments(LOperand* function,
488 LOperand* receiver, 489 LOperand* receiver,
489 LOperand* length, 490 LOperand* length,
490 LOperand* elements) { 491 LOperand* elements) {
491 inputs_[0] = function; 492 inputs_[0] = function;
492 inputs_[1] = receiver; 493 inputs_[1] = receiver;
493 inputs_[2] = length; 494 inputs_[2] = length;
494 inputs_[3] = elements; 495 inputs_[3] = elements;
495 } 496 }
496 497
497 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
498
499 LOperand* function() { return inputs_[0]; } 498 LOperand* function() { return inputs_[0]; }
500 LOperand* receiver() { return inputs_[1]; } 499 LOperand* receiver() { return inputs_[1]; }
501 LOperand* length() { return inputs_[2]; } 500 LOperand* length() { return inputs_[2]; }
502 LOperand* elements() { return inputs_[3]; } 501 LOperand* elements() { return inputs_[3]; }
502
503 DECLARE_CONCRETE_INSTRUCTION(ApplyArguments, "apply-arguments")
503 }; 504 };
504 505
505 506
506 class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> { 507 class LAccessArgumentsAt: public LTemplateInstruction<1, 3, 0> {
507 public: 508 public:
508 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) { 509 LAccessArgumentsAt(LOperand* arguments, LOperand* length, LOperand* index) {
509 inputs_[0] = arguments; 510 inputs_[0] = arguments;
510 inputs_[1] = length; 511 inputs_[1] = length;
511 inputs_[2] = index; 512 inputs_[2] = index;
512 } 513 }
513 514
514 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
515
516 LOperand* arguments() { return inputs_[0]; } 515 LOperand* arguments() { return inputs_[0]; }
517 LOperand* length() { return inputs_[1]; } 516 LOperand* length() { return inputs_[1]; }
518 LOperand* index() { return inputs_[2]; } 517 LOperand* index() { return inputs_[2]; }
519 518
519 DECLARE_CONCRETE_INSTRUCTION(AccessArgumentsAt, "access-arguments-at")
520
520 virtual void PrintDataTo(StringStream* stream); 521 virtual void PrintDataTo(StringStream* stream);
521 }; 522 };
522 523
523 524
524 class LArgumentsLength: public LTemplateInstruction<1, 1, 0> { 525 class LArgumentsLength: public LTemplateInstruction<1, 1, 0> {
525 public: 526 public:
526 explicit LArgumentsLength(LOperand* elements) { 527 explicit LArgumentsLength(LOperand* elements) {
527 inputs_[0] = elements; 528 inputs_[0] = elements;
528 } 529 }
529 530
531 LOperand* elements() { return inputs_[0]; }
532
530 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length") 533 DECLARE_CONCRETE_INSTRUCTION(ArgumentsLength, "arguments-length")
531 }; 534 };
532 535
533 536
534 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { 537 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> {
535 public: 538 public:
536 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") 539 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements")
537 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements) 540 DECLARE_HYDROGEN_ACCESSOR(ArgumentsElements)
538 }; 541 };
539 542
540 543
541 class LModI: public LTemplateInstruction<1, 2, 1> { 544 class LModI: public LTemplateInstruction<1, 2, 1> {
542 public: 545 public:
543 LModI(LOperand* left, LOperand* right, LOperand* temp) { 546 LModI(LOperand* left, LOperand* right, LOperand* temp) {
544 inputs_[0] = left; 547 inputs_[0] = left;
545 inputs_[1] = right; 548 inputs_[1] = right;
546 temps_[0] = temp; 549 temps_[0] = temp;
547 } 550 }
548 551
552 LOperand* left() { return inputs_[0]; }
553 LOperand* right() { return inputs_[1]; }
554 LOperand* temp() { return temps_[0]; }
555
549 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") 556 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i")
550 DECLARE_HYDROGEN_ACCESSOR(Mod) 557 DECLARE_HYDROGEN_ACCESSOR(Mod)
551 }; 558 };
552 559
553 560
554 class LDivI: public LTemplateInstruction<1, 2, 1> { 561 class LDivI: public LTemplateInstruction<1, 2, 1> {
555 public: 562 public:
556 LDivI(LOperand* left, LOperand* right, LOperand* temp) { 563 LDivI(LOperand* left, LOperand* right, LOperand* temp) {
557 inputs_[0] = left; 564 inputs_[0] = left;
558 inputs_[1] = right; 565 inputs_[1] = right;
559 temps_[0] = temp; 566 temps_[0] = temp;
560 } 567 }
561 568
569 LOperand* left() { return inputs_[0]; }
570 LOperand* right() { return inputs_[1]; }
571 LOperand* temp() { return temps_[0]; }
572
562 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") 573 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i")
563 DECLARE_HYDROGEN_ACCESSOR(Div) 574 DECLARE_HYDROGEN_ACCESSOR(Div)
564 }; 575 };
565 576
566 577
567 class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> { 578 class LMathFloorOfDiv: public LTemplateInstruction<1, 2, 1> {
568 public: 579 public:
569 LMathFloorOfDiv(LOperand* left, 580 LMathFloorOfDiv(LOperand* left,
570 LOperand* right, 581 LOperand* right,
571 LOperand* temp = NULL) { 582 LOperand* temp = NULL) {
572 inputs_[0] = left; 583 inputs_[0] = left;
573 inputs_[1] = right; 584 inputs_[1] = right;
574 temps_[0] = temp; 585 temps_[0] = temp;
575 } 586 }
576 587
588 LOperand* left() { return inputs_[0]; }
589 LOperand* right() { return inputs_[1]; }
590 LOperand* temp() { return temps_[0]; }
591
577 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div") 592 DECLARE_CONCRETE_INSTRUCTION(MathFloorOfDiv, "math-floor-of-div")
578 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv) 593 DECLARE_HYDROGEN_ACCESSOR(MathFloorOfDiv)
579 }; 594 };
580 595
581 596
582 class LMulI: public LTemplateInstruction<1, 2, 0> { 597 class LMulI: public LTemplateInstruction<1, 2, 0> {
583 public: 598 public:
584 LMulI(LOperand* left, LOperand* right) { 599 LMulI(LOperand* left, LOperand* right) {
585 inputs_[0] = left; 600 inputs_[0] = left;
586 inputs_[1] = right; 601 inputs_[1] = right;
587 } 602 }
588 603
604 LOperand* left() { return inputs_[0]; }
605 LOperand* right() { return inputs_[1]; }
606
589 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") 607 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i")
590 DECLARE_HYDROGEN_ACCESSOR(Mul) 608 DECLARE_HYDROGEN_ACCESSOR(Mul)
591 }; 609 };
592 610
593 611
594 class LCmpIDAndBranch: public LControlInstruction<2, 0> { 612 class LCmpIDAndBranch: public LControlInstruction<2, 0> {
595 public: 613 public:
596 LCmpIDAndBranch(LOperand* left, LOperand* right) { 614 LCmpIDAndBranch(LOperand* left, LOperand* right) {
597 inputs_[0] = left; 615 inputs_[0] = left;
598 inputs_[1] = right; 616 inputs_[1] = right;
599 } 617 }
600 618
619 LOperand* left() { return inputs_[0]; }
620 LOperand* right() { return inputs_[1]; }
621
601 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") 622 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch")
602 DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch) 623 DECLARE_HYDROGEN_ACCESSOR(CompareIDAndBranch)
603 624
604 Token::Value op() const { return hydrogen()->token(); } 625 Token::Value op() const { return hydrogen()->token(); }
605 bool is_double() const { 626 bool is_double() const {
606 return hydrogen()->GetInputRepresentation().IsDouble(); 627 return hydrogen()->GetInputRepresentation().IsDouble();
607 } 628 }
608 629
609 virtual void PrintDataTo(StringStream* stream); 630 virtual void PrintDataTo(StringStream* stream);
610 }; 631 };
611 632
612 633
613 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> { 634 class LUnaryMathOperation: public LTemplateInstruction<1, 1, 0> {
614 public: 635 public:
615 explicit LUnaryMathOperation(LOperand* value) { 636 explicit LUnaryMathOperation(LOperand* value) {
616 inputs_[0] = value; 637 inputs_[0] = value;
617 } 638 }
618 639
640 LOperand* value() { return inputs_[0]; }
641
619 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") 642 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation")
620 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) 643 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation)
621 644
622 virtual void PrintDataTo(StringStream* stream); 645 virtual void PrintDataTo(StringStream* stream);
623 BuiltinFunctionId op() const { return hydrogen()->op(); } 646 BuiltinFunctionId op() const { return hydrogen()->op(); }
624 }; 647 };
625 648
626 649
627 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> { 650 class LCmpObjectEqAndBranch: public LControlInstruction<2, 0> {
628 public: 651 public:
629 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) { 652 LCmpObjectEqAndBranch(LOperand* left, LOperand* right) {
630 inputs_[0] = left; 653 inputs_[0] = left;
631 inputs_[1] = right; 654 inputs_[1] = right;
632 } 655 }
633 656
657 LOperand* left() { return inputs_[0]; }
658 LOperand* right() { return inputs_[1]; }
659
634 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch, 660 DECLARE_CONCRETE_INSTRUCTION(CmpObjectEqAndBranch,
635 "cmp-object-eq-and-branch") 661 "cmp-object-eq-and-branch")
636 }; 662 };
637 663
638 664
639 class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> { 665 class LCmpConstantEqAndBranch: public LControlInstruction<1, 0> {
640 public: 666 public:
641 explicit LCmpConstantEqAndBranch(LOperand* left) { 667 explicit LCmpConstantEqAndBranch(LOperand* left) {
642 inputs_[0] = left; 668 inputs_[0] = left;
643 } 669 }
644 670
671 LOperand* left() { return inputs_[0]; }
672
645 DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch, 673 DECLARE_CONCRETE_INSTRUCTION(CmpConstantEqAndBranch,
646 "cmp-constant-eq-and-branch") 674 "cmp-constant-eq-and-branch")
647 DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch) 675 DECLARE_HYDROGEN_ACCESSOR(CompareConstantEqAndBranch)
648 }; 676 };
649 677
650 678
651 class LIsNilAndBranch: public LControlInstruction<1, 1> { 679 class LIsNilAndBranch: public LControlInstruction<1, 1> {
652 public: 680 public:
653 LIsNilAndBranch(LOperand* value, LOperand* temp) { 681 LIsNilAndBranch(LOperand* value, LOperand* temp) {
654 inputs_[0] = value; 682 inputs_[0] = value;
655 temps_[0] = temp; 683 temps_[0] = temp;
656 } 684 }
657 685
686 LOperand* value() { return inputs_[0]; }
687 LOperand* temp() { return temps_[0]; }
688
658 DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch") 689 DECLARE_CONCRETE_INSTRUCTION(IsNilAndBranch, "is-nil-and-branch")
659 DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch) 690 DECLARE_HYDROGEN_ACCESSOR(IsNilAndBranch)
660 691
661 EqualityKind kind() const { return hydrogen()->kind(); } 692 EqualityKind kind() const { return hydrogen()->kind(); }
662 NilValue nil() const { return hydrogen()->nil(); } 693 NilValue nil() const { return hydrogen()->nil(); }
663 694
664 virtual void PrintDataTo(StringStream* stream); 695 virtual void PrintDataTo(StringStream* stream);
665 }; 696 };
666 697
667 698
668 class LIsObjectAndBranch: public LControlInstruction<1, 0> { 699 class LIsObjectAndBranch: public LControlInstruction<1, 0> {
669 public: 700 public:
670 explicit LIsObjectAndBranch(LOperand* value) { 701 explicit LIsObjectAndBranch(LOperand* value) {
671 inputs_[0] = value; 702 inputs_[0] = value;
672 } 703 }
673 704
705 LOperand* value() { return inputs_[0]; }
706
674 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") 707 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch")
675 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch) 708 DECLARE_HYDROGEN_ACCESSOR(IsObjectAndBranch)
676 709
677 virtual void PrintDataTo(StringStream* stream); 710 virtual void PrintDataTo(StringStream* stream);
678 }; 711 };
679 712
680 713
681 class LIsStringAndBranch: public LControlInstruction<1, 1> { 714 class LIsStringAndBranch: public LControlInstruction<1, 1> {
682 public: 715 public:
683 explicit LIsStringAndBranch(LOperand* value, LOperand* temp) { 716 explicit LIsStringAndBranch(LOperand* value, LOperand* temp) {
684 inputs_[0] = value; 717 inputs_[0] = value;
685 temps_[0] = temp; 718 temps_[0] = temp;
686 } 719 }
687 720
721 LOperand* value() { return inputs_[0]; }
722 LOperand* temp() { return temps_[0]; }
723
688 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch") 724 DECLARE_CONCRETE_INSTRUCTION(IsStringAndBranch, "is-string-and-branch")
689 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch) 725 DECLARE_HYDROGEN_ACCESSOR(IsStringAndBranch)
690 726
691 virtual void PrintDataTo(StringStream* stream); 727 virtual void PrintDataTo(StringStream* stream);
692 }; 728 };
693 729
694 730
695 class LIsSmiAndBranch: public LControlInstruction<1, 0> { 731 class LIsSmiAndBranch: public LControlInstruction<1, 0> {
696 public: 732 public:
697 explicit LIsSmiAndBranch(LOperand* value) { 733 explicit LIsSmiAndBranch(LOperand* value) {
698 inputs_[0] = value; 734 inputs_[0] = value;
699 } 735 }
700 736
737 LOperand* value() { return inputs_[0]; }
738
701 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") 739 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch")
702 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch) 740 DECLARE_HYDROGEN_ACCESSOR(IsSmiAndBranch)
703 741
704 virtual void PrintDataTo(StringStream* stream); 742 virtual void PrintDataTo(StringStream* stream);
705 }; 743 };
706 744
707 745
708 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> { 746 class LIsUndetectableAndBranch: public LControlInstruction<1, 1> {
709 public: 747 public:
710 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) { 748 explicit LIsUndetectableAndBranch(LOperand* value, LOperand* temp) {
711 inputs_[0] = value; 749 inputs_[0] = value;
712 temps_[0] = temp; 750 temps_[0] = temp;
713 } 751 }
714 752
753 LOperand* value() { return inputs_[0]; }
754 LOperand* temp() { return temps_[0]; }
755
715 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch, 756 DECLARE_CONCRETE_INSTRUCTION(IsUndetectableAndBranch,
716 "is-undetectable-and-branch") 757 "is-undetectable-and-branch")
717 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch) 758 DECLARE_HYDROGEN_ACCESSOR(IsUndetectableAndBranch)
718 759
719 virtual void PrintDataTo(StringStream* stream); 760 virtual void PrintDataTo(StringStream* stream);
720 }; 761 };
721 762
722 763
723 class LStringCompareAndBranch: public LControlInstruction<2, 0> { 764 class LStringCompareAndBranch: public LControlInstruction<2, 0> {
724 public: 765 public:
725 explicit LStringCompareAndBranch(LOperand* left, LOperand* right) { 766 explicit LStringCompareAndBranch(LOperand* left, LOperand* right) {
726 inputs_[0] = left; 767 inputs_[0] = left;
727 inputs_[1] = right; 768 inputs_[1] = right;
728 } 769 }
729 770
771 LOperand* left() { return inputs_[0]; }
772 LOperand* right() { return inputs_[1]; }
773
730 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch, 774 DECLARE_CONCRETE_INSTRUCTION(StringCompareAndBranch,
731 "string-compare-and-branch") 775 "string-compare-and-branch")
732 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch) 776 DECLARE_HYDROGEN_ACCESSOR(StringCompareAndBranch)
733 777
734 virtual void PrintDataTo(StringStream* stream); 778 virtual void PrintDataTo(StringStream* stream);
735 779
736 Token::Value op() const { return hydrogen()->token(); } 780 Token::Value op() const { return hydrogen()->token(); }
737 }; 781 };
738 782
739 783
740 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> { 784 class LHasInstanceTypeAndBranch: public LControlInstruction<1, 0> {
741 public: 785 public:
742 explicit LHasInstanceTypeAndBranch(LOperand* value) { 786 explicit LHasInstanceTypeAndBranch(LOperand* value) {
743 inputs_[0] = value; 787 inputs_[0] = value;
744 } 788 }
745 789
790 LOperand* value() { return inputs_[0]; }
791
746 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, 792 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch,
747 "has-instance-type-and-branch") 793 "has-instance-type-and-branch")
748 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch) 794 DECLARE_HYDROGEN_ACCESSOR(HasInstanceTypeAndBranch)
749 795
750 virtual void PrintDataTo(StringStream* stream); 796 virtual void PrintDataTo(StringStream* stream);
751 }; 797 };
752 798
753 799
754 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> { 800 class LGetCachedArrayIndex: public LTemplateInstruction<1, 1, 0> {
755 public: 801 public:
756 explicit LGetCachedArrayIndex(LOperand* value) { 802 explicit LGetCachedArrayIndex(LOperand* value) {
757 inputs_[0] = value; 803 inputs_[0] = value;
758 } 804 }
759 805
806 LOperand* value() { return inputs_[0]; }
807
760 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index") 808 DECLARE_CONCRETE_INSTRUCTION(GetCachedArrayIndex, "get-cached-array-index")
761 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex) 809 DECLARE_HYDROGEN_ACCESSOR(GetCachedArrayIndex)
762 }; 810 };
763 811
764 812
765 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> { 813 class LHasCachedArrayIndexAndBranch: public LControlInstruction<1, 0> {
766 public: 814 public:
767 explicit LHasCachedArrayIndexAndBranch(LOperand* value) { 815 explicit LHasCachedArrayIndexAndBranch(LOperand* value) {
768 inputs_[0] = value; 816 inputs_[0] = value;
769 } 817 }
770 818
819 LOperand* value() { return inputs_[0]; }
820
771 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, 821 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch,
772 "has-cached-array-index-and-branch") 822 "has-cached-array-index-and-branch")
773 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch) 823 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndexAndBranch)
774 824
775 virtual void PrintDataTo(StringStream* stream); 825 virtual void PrintDataTo(StringStream* stream);
776 }; 826 };
777 827
778 828
779 class LClassOfTestAndBranch: public LControlInstruction<1, 2> { 829 class LClassOfTestAndBranch: public LControlInstruction<1, 2> {
780 public: 830 public:
781 LClassOfTestAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) { 831 LClassOfTestAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) {
782 inputs_[0] = value; 832 inputs_[0] = value;
783 temps_[0] = temp; 833 temps_[0] = temp;
784 temps_[1] = temp2; 834 temps_[1] = temp2;
785 } 835 }
786 836
837 LOperand* value() { return inputs_[0]; }
838 LOperand* temp() { return temps_[0]; }
839 LOperand* temp2() { return temps_[1]; }
840
787 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, 841 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch,
788 "class-of-test-and-branch") 842 "class-of-test-and-branch")
789 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch) 843 DECLARE_HYDROGEN_ACCESSOR(ClassOfTestAndBranch)
790 844
791 virtual void PrintDataTo(StringStream* stream); 845 virtual void PrintDataTo(StringStream* stream);
792 }; 846 };
793 847
794 848
795 class LCmpT: public LTemplateInstruction<1, 2, 0> { 849 class LCmpT: public LTemplateInstruction<1, 2, 0> {
796 public: 850 public:
797 LCmpT(LOperand* left, LOperand* right) { 851 LCmpT(LOperand* left, LOperand* right) {
798 inputs_[0] = left; 852 inputs_[0] = left;
799 inputs_[1] = right; 853 inputs_[1] = right;
800 } 854 }
801 855
856 LOperand* left() { return inputs_[0]; }
857 LOperand* right() { return inputs_[1]; }
858
802 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") 859 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t")
803 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric) 860 DECLARE_HYDROGEN_ACCESSOR(CompareGeneric)
804 861
805 Token::Value op() const { return hydrogen()->token(); } 862 Token::Value op() const { return hydrogen()->token(); }
806 }; 863 };
807 864
808 865
809 class LIn: public LTemplateInstruction<1, 2, 0> { 866 class LIn: public LTemplateInstruction<1, 2, 0> {
810 public: 867 public:
811 LIn(LOperand* key, LOperand* object) { 868 LIn(LOperand* key, LOperand* object) {
812 inputs_[0] = key; 869 inputs_[0] = key;
813 inputs_[1] = object; 870 inputs_[1] = object;
814 } 871 }
815 872
816 LOperand* key() { return inputs_[0]; } 873 LOperand* key() { return inputs_[0]; }
817 LOperand* object() { return inputs_[1]; } 874 LOperand* object() { return inputs_[1]; }
818 875
819 DECLARE_CONCRETE_INSTRUCTION(In, "in") 876 DECLARE_CONCRETE_INSTRUCTION(In, "in")
820 }; 877 };
821 878
822 879
823 class LInstanceOf: public LTemplateInstruction<1, 2, 0> { 880 class LInstanceOf: public LTemplateInstruction<1, 2, 0> {
824 public: 881 public:
825 LInstanceOf(LOperand* left, LOperand* right) { 882 LInstanceOf(LOperand* left, LOperand* right) {
826 inputs_[0] = left; 883 inputs_[0] = left;
827 inputs_[1] = right; 884 inputs_[1] = right;
828 } 885 }
829 886
887 LOperand* left() { return inputs_[0]; }
888 LOperand* right() { return inputs_[1]; }
889
830 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") 890 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of")
831 }; 891 };
832 892
833 893
834 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> { 894 class LInstanceOfKnownGlobal: public LTemplateInstruction<1, 1, 1> {
835 public: 895 public:
836 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) { 896 LInstanceOfKnownGlobal(LOperand* value, LOperand* temp) {
837 inputs_[0] = value; 897 inputs_[0] = value;
838 temps_[0] = temp; 898 temps_[0] = temp;
839 } 899 }
840 900
901 LOperand* value() { return inputs_[0]; }
902 LOperand* temp() { return temps_[0]; }
903
841 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, 904 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal,
842 "instance-of-known-global") 905 "instance-of-known-global")
843 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) 906 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal)
844 907
845 Handle<JSFunction> function() const { return hydrogen()->function(); } 908 Handle<JSFunction> function() const { return hydrogen()->function(); }
846 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() { 909 LEnvironment* GetDeferredLazyDeoptimizationEnvironment() {
847 return lazy_deopt_env_; 910 return lazy_deopt_env_;
848 } 911 }
849 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) { 912 virtual void SetDeferredLazyDeoptimizationEnvironment(LEnvironment* env) {
850 lazy_deopt_env_ = env; 913 lazy_deopt_env_ = env;
(...skipping 19 matching lines...) Expand all
870 }; 933 };
871 934
872 935
873 class LBitI: public LTemplateInstruction<1, 2, 0> { 936 class LBitI: public LTemplateInstruction<1, 2, 0> {
874 public: 937 public:
875 LBitI(LOperand* left, LOperand* right) { 938 LBitI(LOperand* left, LOperand* right) {
876 inputs_[0] = left; 939 inputs_[0] = left;
877 inputs_[1] = right; 940 inputs_[1] = right;
878 } 941 }
879 942
943 LOperand* left() { return inputs_[0]; }
944 LOperand* right() { return inputs_[1]; }
945
880 Token::Value op() const { return hydrogen()->op(); } 946 Token::Value op() const { return hydrogen()->op(); }
881 947
882 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i") 948 DECLARE_CONCRETE_INSTRUCTION(BitI, "bit-i")
883 DECLARE_HYDROGEN_ACCESSOR(Bitwise) 949 DECLARE_HYDROGEN_ACCESSOR(Bitwise)
884 }; 950 };
885 951
886 952
887 class LShiftI: public LTemplateInstruction<1, 2, 0> { 953 class LShiftI: public LTemplateInstruction<1, 2, 0> {
888 public: 954 public:
889 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt) 955 LShiftI(Token::Value op, LOperand* left, LOperand* right, bool can_deopt)
890 : op_(op), can_deopt_(can_deopt) { 956 : op_(op), can_deopt_(can_deopt) {
891 inputs_[0] = left; 957 inputs_[0] = left;
892 inputs_[1] = right; 958 inputs_[1] = right;
893 } 959 }
894 960
895 Token::Value op() const { return op_; } 961 Token::Value op() const { return op_; }
896 962 LOperand* left() { return inputs_[0]; }
963 LOperand* right() { return inputs_[1]; }
897 bool can_deopt() const { return can_deopt_; } 964 bool can_deopt() const { return can_deopt_; }
898 965
899 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i") 966 DECLARE_CONCRETE_INSTRUCTION(ShiftI, "shift-i")
900 967
901 private: 968 private:
902 Token::Value op_; 969 Token::Value op_;
903 bool can_deopt_; 970 bool can_deopt_;
904 }; 971 };
905 972
906 973
907 class LSubI: public LTemplateInstruction<1, 2, 0> { 974 class LSubI: public LTemplateInstruction<1, 2, 0> {
908 public: 975 public:
909 LSubI(LOperand* left, LOperand* right) { 976 LSubI(LOperand* left, LOperand* right) {
910 inputs_[0] = left; 977 inputs_[0] = left;
911 inputs_[1] = right; 978 inputs_[1] = right;
912 } 979 }
913 980
981 LOperand* left() { return inputs_[0]; }
982 LOperand* right() { return inputs_[1]; }
983
914 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i") 984 DECLARE_CONCRETE_INSTRUCTION(SubI, "sub-i")
915 DECLARE_HYDROGEN_ACCESSOR(Sub) 985 DECLARE_HYDROGEN_ACCESSOR(Sub)
916 }; 986 };
917 987
918 988
919 class LConstantI: public LTemplateInstruction<1, 0, 0> { 989 class LConstantI: public LTemplateInstruction<1, 0, 0> {
920 public: 990 public:
921 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i") 991 DECLARE_CONCRETE_INSTRUCTION(ConstantI, "constant-i")
922 DECLARE_HYDROGEN_ACCESSOR(Constant) 992 DECLARE_HYDROGEN_ACCESSOR(Constant)
923 993
924 int32_t value() const { return hydrogen()->Integer32Value(); } 994 int32_t value() const { return hydrogen()->Integer32Value(); }
925 }; 995 };
926 996
927 997
928 class LConstantD: public LTemplateInstruction<1, 0, 1> { 998 class LConstantD: public LTemplateInstruction<1, 0, 1> {
929 public: 999 public:
930 explicit LConstantD(LOperand* temp) { 1000 explicit LConstantD(LOperand* temp) {
931 temps_[0] = temp; 1001 temps_[0] = temp;
932 } 1002 }
1003
1004 LOperand* temp() { return temps_[0]; }
1005
933 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d") 1006 DECLARE_CONCRETE_INSTRUCTION(ConstantD, "constant-d")
934 DECLARE_HYDROGEN_ACCESSOR(Constant) 1007 DECLARE_HYDROGEN_ACCESSOR(Constant)
935 1008
936 double value() const { return hydrogen()->DoubleValue(); } 1009 double value() const { return hydrogen()->DoubleValue(); }
937 }; 1010 };
938 1011
939 1012
940 class LConstantT: public LTemplateInstruction<1, 0, 0> { 1013 class LConstantT: public LTemplateInstruction<1, 0, 0> {
941 public: 1014 public:
942 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") 1015 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t")
943 DECLARE_HYDROGEN_ACCESSOR(Constant) 1016 DECLARE_HYDROGEN_ACCESSOR(Constant)
944 1017
945 Handle<Object> value() const { return hydrogen()->handle(); } 1018 Handle<Object> value() const { return hydrogen()->handle(); }
946 }; 1019 };
947 1020
948 1021
949 class LBranch: public LControlInstruction<1, 0> { 1022 class LBranch: public LControlInstruction<1, 0> {
950 public: 1023 public:
951 explicit LBranch(LOperand* value) { 1024 explicit LBranch(LOperand* value) {
952 inputs_[0] = value; 1025 inputs_[0] = value;
953 } 1026 }
954 1027
1028 LOperand* value() { return inputs_[0]; }
1029
955 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") 1030 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch")
956 DECLARE_HYDROGEN_ACCESSOR(Branch) 1031 DECLARE_HYDROGEN_ACCESSOR(Branch)
957 1032
958 virtual void PrintDataTo(StringStream* stream); 1033 virtual void PrintDataTo(StringStream* stream);
959 }; 1034 };
960 1035
961 1036
962 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> { 1037 class LCmpMapAndBranch: public LTemplateInstruction<0, 1, 0> {
963 public: 1038 public:
964 explicit LCmpMapAndBranch(LOperand* value) { 1039 explicit LCmpMapAndBranch(LOperand* value) {
965 inputs_[0] = value; 1040 inputs_[0] = value;
966 } 1041 }
967 1042
1043 LOperand* value() { return inputs_[0]; }
1044
968 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") 1045 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch")
969 DECLARE_HYDROGEN_ACCESSOR(CompareMap) 1046 DECLARE_HYDROGEN_ACCESSOR(CompareMap)
970 1047
971 virtual bool IsControl() const { return true; } 1048 virtual bool IsControl() const { return true; }
972 1049
973 Handle<Map> map() const { return hydrogen()->map(); } 1050 Handle<Map> map() const { return hydrogen()->map(); }
974 int true_block_id() const { 1051 int true_block_id() const {
975 return hydrogen()->FirstSuccessor()->block_id(); 1052 return hydrogen()->FirstSuccessor()->block_id();
976 } 1053 }
977 int false_block_id() const { 1054 int false_block_id() const {
978 return hydrogen()->SecondSuccessor()->block_id(); 1055 return hydrogen()->SecondSuccessor()->block_id();
979 } 1056 }
980 }; 1057 };
981 1058
982 1059
983 class LJSArrayLength: public LTemplateInstruction<1, 1, 0> { 1060 class LJSArrayLength: public LTemplateInstruction<1, 1, 0> {
984 public: 1061 public:
985 explicit LJSArrayLength(LOperand* value) { 1062 explicit LJSArrayLength(LOperand* value) {
986 inputs_[0] = value; 1063 inputs_[0] = value;
987 } 1064 }
988 1065
1066 LOperand* value() { return inputs_[0]; }
1067
989 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length") 1068 DECLARE_CONCRETE_INSTRUCTION(JSArrayLength, "js-array-length")
990 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength) 1069 DECLARE_HYDROGEN_ACCESSOR(JSArrayLength)
991 }; 1070 };
992 1071
993 1072
994 class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> { 1073 class LFixedArrayBaseLength: public LTemplateInstruction<1, 1, 0> {
995 public: 1074 public:
996 explicit LFixedArrayBaseLength(LOperand* value) { 1075 explicit LFixedArrayBaseLength(LOperand* value) {
997 inputs_[0] = value; 1076 inputs_[0] = value;
998 } 1077 }
999 1078
1079 LOperand* value() { return inputs_[0]; }
1080
1000 DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength, 1081 DECLARE_CONCRETE_INSTRUCTION(FixedArrayBaseLength,
1001 "fixed-array-base-length") 1082 "fixed-array-base-length")
1002 DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength) 1083 DECLARE_HYDROGEN_ACCESSOR(FixedArrayBaseLength)
1003 }; 1084 };
1004 1085
1005 1086
1006 class LMapEnumLength: public LTemplateInstruction<1, 1, 0> { 1087 class LMapEnumLength: public LTemplateInstruction<1, 1, 0> {
1007 public: 1088 public:
1008 explicit LMapEnumLength(LOperand* value) { 1089 explicit LMapEnumLength(LOperand* value) {
1009 inputs_[0] = value; 1090 inputs_[0] = value;
1010 } 1091 }
1011 1092
1093 LOperand* value() { return inputs_[0]; }
1094
1012 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length") 1095 DECLARE_CONCRETE_INSTRUCTION(MapEnumLength, "map-enum-length")
1013 }; 1096 };
1014 1097
1015 1098
1016 class LElementsKind: public LTemplateInstruction<1, 1, 0> { 1099 class LElementsKind: public LTemplateInstruction<1, 1, 0> {
1017 public: 1100 public:
1018 explicit LElementsKind(LOperand* value) { 1101 explicit LElementsKind(LOperand* value) {
1019 inputs_[0] = value; 1102 inputs_[0] = value;
1020 } 1103 }
1021 1104
1105 LOperand* value() { return inputs_[0]; }
1106
1022 DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind") 1107 DECLARE_CONCRETE_INSTRUCTION(ElementsKind, "elements-kind")
1023 DECLARE_HYDROGEN_ACCESSOR(ElementsKind) 1108 DECLARE_HYDROGEN_ACCESSOR(ElementsKind)
1024 }; 1109 };
1025 1110
1026 1111
1027 class LValueOf: public LTemplateInstruction<1, 1, 0> { 1112 class LValueOf: public LTemplateInstruction<1, 1, 0> {
1028 public: 1113 public:
1029 explicit LValueOf(LOperand* value) { 1114 explicit LValueOf(LOperand* value) {
1030 inputs_[0] = value; 1115 inputs_[0] = value;
1031 } 1116 }
1032 1117
1118 LOperand* value() { return inputs_[0]; }
1119
1033 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") 1120 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of")
1034 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 1121 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1035 }; 1122 };
1036 1123
1037 1124
1038 class LDateField: public LTemplateInstruction<1, 1, 0> { 1125 class LDateField: public LTemplateInstruction<1, 1, 0> {
1039 public: 1126 public:
1040 LDateField(LOperand* date, Smi* index) : index_(index) { 1127 LDateField(LOperand* date, Smi* index) : index_(index) {
1041 inputs_[0] = date; 1128 inputs_[0] = date;
1042 } 1129 }
1043 1130
1131 LOperand* date() { return inputs_[0]; }
1132 Smi* index() const { return index_; }
1133
1044 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field") 1134 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "date-field")
1045 DECLARE_HYDROGEN_ACCESSOR(ValueOf) 1135 DECLARE_HYDROGEN_ACCESSOR(ValueOf)
1046 1136
1047 Smi* index() const { return index_; }
1048
1049 private: 1137 private:
1050 Smi* index_; 1138 Smi* index_;
1051 }; 1139 };
1052 1140
1053 1141
1054 class LThrow: public LTemplateInstruction<0, 1, 0> { 1142 class LThrow: public LTemplateInstruction<0, 1, 0> {
1055 public: 1143 public:
1056 explicit LThrow(LOperand* value) { 1144 explicit LThrow(LOperand* value) {
1057 inputs_[0] = value; 1145 inputs_[0] = value;
1058 } 1146 }
1059 1147
1148 LOperand* value() { return inputs_[0]; }
1149
1060 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") 1150 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw")
1061 }; 1151 };
1062 1152
1063 1153
1064 class LBitNotI: public LTemplateInstruction<1, 1, 0> { 1154 class LBitNotI: public LTemplateInstruction<1, 1, 0> {
1065 public: 1155 public:
1066 explicit LBitNotI(LOperand* value) { 1156 explicit LBitNotI(LOperand* value) {
1067 inputs_[0] = value; 1157 inputs_[0] = value;
1068 } 1158 }
1069 1159
1160 LOperand* value() { return inputs_[0]; }
1161
1070 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i") 1162 DECLARE_CONCRETE_INSTRUCTION(BitNotI, "bit-not-i")
1071 }; 1163 };
1072 1164
1073 1165
1074 class LAddI: public LTemplateInstruction<1, 2, 0> { 1166 class LAddI: public LTemplateInstruction<1, 2, 0> {
1075 public: 1167 public:
1076 LAddI(LOperand* left, LOperand* right) { 1168 LAddI(LOperand* left, LOperand* right) {
1077 inputs_[0] = left; 1169 inputs_[0] = left;
1078 inputs_[1] = right; 1170 inputs_[1] = right;
1079 } 1171 }
1080 1172
1173 LOperand* left() { return inputs_[0]; }
1174 LOperand* right() { return inputs_[1]; }
1175
1081 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i") 1176 DECLARE_CONCRETE_INSTRUCTION(AddI, "add-i")
1082 DECLARE_HYDROGEN_ACCESSOR(Add) 1177 DECLARE_HYDROGEN_ACCESSOR(Add)
1083 }; 1178 };
1084 1179
1085 1180
1086 class LMathMinMax: public LTemplateInstruction<1, 2, 0> { 1181 class LMathMinMax: public LTemplateInstruction<1, 2, 0> {
1087 public: 1182 public:
1088 LMathMinMax(LOperand* left, LOperand* right) { 1183 LMathMinMax(LOperand* left, LOperand* right) {
1089 inputs_[0] = left; 1184 inputs_[0] = left;
1090 inputs_[1] = right; 1185 inputs_[1] = right;
1091 } 1186 }
1092 1187
1188 LOperand* left() { return inputs_[0]; }
1189 LOperand* right() { return inputs_[1]; }
1190
1093 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max") 1191 DECLARE_CONCRETE_INSTRUCTION(MathMinMax, "min-max")
1094 DECLARE_HYDROGEN_ACCESSOR(MathMinMax) 1192 DECLARE_HYDROGEN_ACCESSOR(MathMinMax)
1095 }; 1193 };
1096 1194
1097 1195
1098 class LPower: public LTemplateInstruction<1, 2, 0> { 1196 class LPower: public LTemplateInstruction<1, 2, 0> {
1099 public: 1197 public:
1100 LPower(LOperand* left, LOperand* right) { 1198 LPower(LOperand* left, LOperand* right) {
1101 inputs_[0] = left; 1199 inputs_[0] = left;
1102 inputs_[1] = right; 1200 inputs_[1] = right;
1103 } 1201 }
1104 1202
1203 LOperand* left() { return inputs_[0]; }
1204 LOperand* right() { return inputs_[1]; }
1205
1105 DECLARE_CONCRETE_INSTRUCTION(Power, "power") 1206 DECLARE_CONCRETE_INSTRUCTION(Power, "power")
1106 DECLARE_HYDROGEN_ACCESSOR(Power) 1207 DECLARE_HYDROGEN_ACCESSOR(Power)
1107 }; 1208 };
1108 1209
1109 1210
1110 class LRandom: public LTemplateInstruction<1, 1, 0> { 1211 class LRandom: public LTemplateInstruction<1, 1, 0> {
1111 public: 1212 public:
1112 explicit LRandom(LOperand* global_object) { 1213 explicit LRandom(LOperand* global_object) {
1113 inputs_[0] = global_object; 1214 inputs_[0] = global_object;
1114 } 1215 }
1115 1216
1217 LOperand* global_object() { return inputs_[0]; }
1218
1116 DECLARE_CONCRETE_INSTRUCTION(Random, "random") 1219 DECLARE_CONCRETE_INSTRUCTION(Random, "random")
1117 DECLARE_HYDROGEN_ACCESSOR(Random) 1220 DECLARE_HYDROGEN_ACCESSOR(Random)
1118 }; 1221 };
1119 1222
1120 1223
1121 class LArithmeticD: public LTemplateInstruction<1, 2, 0> { 1224 class LArithmeticD: public LTemplateInstruction<1, 2, 0> {
1122 public: 1225 public:
1123 LArithmeticD(Token::Value op, LOperand* left, LOperand* right) 1226 LArithmeticD(Token::Value op, LOperand* left, LOperand* right)
1124 : op_(op) { 1227 : op_(op) {
1125 inputs_[0] = left; 1228 inputs_[0] = left;
1126 inputs_[1] = right; 1229 inputs_[1] = right;
1127 } 1230 }
1128 1231
1129 Token::Value op() const { return op_; } 1232 Token::Value op() const { return op_; }
1233 LOperand* left() { return inputs_[0]; }
1234 LOperand* right() { return inputs_[1]; }
1130 1235
1131 virtual Opcode opcode() const { return LInstruction::kArithmeticD; } 1236 virtual Opcode opcode() const { return LInstruction::kArithmeticD; }
1132 virtual void CompileToNative(LCodeGen* generator); 1237 virtual void CompileToNative(LCodeGen* generator);
1133 virtual const char* Mnemonic() const; 1238 virtual const char* Mnemonic() const;
1134 1239
1135 private: 1240 private:
1136 Token::Value op_; 1241 Token::Value op_;
1137 }; 1242 };
1138 1243
1139 1244
1140 class LArithmeticT: public LTemplateInstruction<1, 2, 0> { 1245 class LArithmeticT: public LTemplateInstruction<1, 2, 0> {
1141 public: 1246 public:
1142 LArithmeticT(Token::Value op, LOperand* left, LOperand* right) 1247 LArithmeticT(Token::Value op, LOperand* left, LOperand* right)
1143 : op_(op) { 1248 : op_(op) {
1144 inputs_[0] = left; 1249 inputs_[0] = left;
1145 inputs_[1] = right; 1250 inputs_[1] = right;
1146 } 1251 }
1147 1252
1253 Token::Value op() const { return op_; }
1254 LOperand* left() { return inputs_[0]; }
1255 LOperand* right() { return inputs_[1]; }
1256
1148 virtual Opcode opcode() const { return LInstruction::kArithmeticT; } 1257 virtual Opcode opcode() const { return LInstruction::kArithmeticT; }
1149 virtual void CompileToNative(LCodeGen* generator); 1258 virtual void CompileToNative(LCodeGen* generator);
1150 virtual const char* Mnemonic() const; 1259 virtual const char* Mnemonic() const;
1151 1260
1152 Token::Value op() const { return op_; }
1153
1154 private: 1261 private:
1155 Token::Value op_; 1262 Token::Value op_;
1156 }; 1263 };
1157 1264
1158 1265
1159 class LReturn: public LTemplateInstruction<0, 1, 0> { 1266 class LReturn: public LTemplateInstruction<0, 1, 0> {
1160 public: 1267 public:
1161 explicit LReturn(LOperand* value) { 1268 explicit LReturn(LOperand* value) {
1162 inputs_[0] = value; 1269 inputs_[0] = value;
1163 } 1270 }
1164 1271
1272 LOperand* value() { return inputs_[0]; }
1273
1165 DECLARE_CONCRETE_INSTRUCTION(Return, "return") 1274 DECLARE_CONCRETE_INSTRUCTION(Return, "return")
1166 }; 1275 };
1167 1276
1168 1277
1169 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> { 1278 class LLoadNamedField: public LTemplateInstruction<1, 1, 0> {
1170 public: 1279 public:
1171 explicit LLoadNamedField(LOperand* object) { 1280 explicit LLoadNamedField(LOperand* object) {
1172 inputs_[0] = object; 1281 inputs_[0] = object;
1173 } 1282 }
1174 1283
1284 LOperand* object() { return inputs_[0]; }
1285
1175 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field") 1286 DECLARE_CONCRETE_INSTRUCTION(LoadNamedField, "load-named-field")
1176 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField) 1287 DECLARE_HYDROGEN_ACCESSOR(LoadNamedField)
1177 }; 1288 };
1178 1289
1179 1290
1180 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> { 1291 class LLoadNamedFieldPolymorphic: public LTemplateInstruction<1, 1, 0> {
1181 public: 1292 public:
1182 explicit LLoadNamedFieldPolymorphic(LOperand* object) { 1293 explicit LLoadNamedFieldPolymorphic(LOperand* object) {
1183 inputs_[0] = object; 1294 inputs_[0] = object;
1184 } 1295 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 LOperand* function() { return inputs_[0]; } 1327 LOperand* function() { return inputs_[0]; }
1217 }; 1328 };
1218 1329
1219 1330
1220 class LLoadElements: public LTemplateInstruction<1, 1, 0> { 1331 class LLoadElements: public LTemplateInstruction<1, 1, 0> {
1221 public: 1332 public:
1222 explicit LLoadElements(LOperand* object) { 1333 explicit LLoadElements(LOperand* object) {
1223 inputs_[0] = object; 1334 inputs_[0] = object;
1224 } 1335 }
1225 1336
1337 LOperand* object() { return inputs_[0]; }
1338
1226 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") 1339 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements")
1227 }; 1340 };
1228 1341
1229 1342
1230 class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> { 1343 class LLoadExternalArrayPointer: public LTemplateInstruction<1, 1, 0> {
1231 public: 1344 public:
1232 explicit LLoadExternalArrayPointer(LOperand* object) { 1345 explicit LLoadExternalArrayPointer(LOperand* object) {
1233 inputs_[0] = object; 1346 inputs_[0] = object;
1234 } 1347 }
1235 1348
1349 LOperand* object() { return inputs_[0]; }
1350
1236 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer, 1351 DECLARE_CONCRETE_INSTRUCTION(LoadExternalArrayPointer,
1237 "load-external-array-pointer") 1352 "load-external-array-pointer")
1238 }; 1353 };
1239 1354
1240 1355
1241 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> { 1356 class LLoadKeyedFastElement: public LTemplateInstruction<1, 2, 0> {
1242 public: 1357 public:
1243 LLoadKeyedFastElement(LOperand* elements, LOperand* key) { 1358 LLoadKeyedFastElement(LOperand* elements, LOperand* key) {
1244 inputs_[0] = elements; 1359 inputs_[0] = elements;
1245 inputs_[1] = key; 1360 inputs_[1] = key;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 }; 1442 };
1328 1443
1329 1444
1330 class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> { 1445 class LStoreGlobalCell: public LTemplateInstruction<0, 1, 1> {
1331 public: 1446 public:
1332 explicit LStoreGlobalCell(LOperand* value, LOperand* temp) { 1447 explicit LStoreGlobalCell(LOperand* value, LOperand* temp) {
1333 inputs_[0] = value; 1448 inputs_[0] = value;
1334 temps_[0] = temp; 1449 temps_[0] = temp;
1335 } 1450 }
1336 1451
1452 LOperand* value() { return inputs_[0]; }
1453 LOperand* temp() { return temps_[0]; }
1454
1337 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell") 1455 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalCell, "store-global-cell")
1338 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell) 1456 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalCell)
1339
1340 LOperand* value() { return inputs_[0]; }
1341 }; 1457 };
1342 1458
1343 1459
1344 class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> { 1460 class LStoreGlobalGeneric: public LTemplateInstruction<0, 2, 0> {
1345 public: 1461 public:
1346 explicit LStoreGlobalGeneric(LOperand* global_object, 1462 explicit LStoreGlobalGeneric(LOperand* global_object,
1347 LOperand* value) { 1463 LOperand* value) {
1348 inputs_[0] = global_object; 1464 inputs_[0] = global_object;
1349 inputs_[1] = value; 1465 inputs_[1] = value;
1350 } 1466 }
1351 1467
1468 LOperand* global_object() { return inputs_[0]; }
1469 LOperand* value() { return inputs_[1]; }
1470
1352 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic") 1471 DECLARE_CONCRETE_INSTRUCTION(StoreGlobalGeneric, "store-global-generic")
1353 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric) 1472 DECLARE_HYDROGEN_ACCESSOR(StoreGlobalGeneric)
1354 1473
1355 LOperand* global_object() { return InputAt(0); }
1356 Handle<Object> name() const { return hydrogen()->name(); } 1474 Handle<Object> name() const { return hydrogen()->name(); }
1357 LOperand* value() { return InputAt(1); }
1358 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } 1475 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1359 }; 1476 };
1360 1477
1361 1478
1362 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> { 1479 class LLoadContextSlot: public LTemplateInstruction<1, 1, 0> {
1363 public: 1480 public:
1364 explicit LLoadContextSlot(LOperand* context) { 1481 explicit LLoadContextSlot(LOperand* context) {
1365 inputs_[0] = context; 1482 inputs_[0] = context;
1366 } 1483 }
1367 1484
1485 LOperand* context() { return inputs_[0]; }
1486
1368 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot") 1487 DECLARE_CONCRETE_INSTRUCTION(LoadContextSlot, "load-context-slot")
1369 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot) 1488 DECLARE_HYDROGEN_ACCESSOR(LoadContextSlot)
1370 1489
1371 LOperand* context() { return InputAt(0); }
1372 int slot_index() { return hydrogen()->slot_index(); } 1490 int slot_index() { return hydrogen()->slot_index(); }
1373 1491
1374 virtual void PrintDataTo(StringStream* stream); 1492 virtual void PrintDataTo(StringStream* stream);
1375 }; 1493 };
1376 1494
1377 1495
1378 class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> { 1496 class LStoreContextSlot: public LTemplateInstruction<0, 2, 1> {
1379 public: 1497 public:
1380 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) { 1498 LStoreContextSlot(LOperand* context, LOperand* value, LOperand* temp) {
1381 inputs_[0] = context; 1499 inputs_[0] = context;
1382 inputs_[1] = value; 1500 inputs_[1] = value;
1383 temps_[0] = temp; 1501 temps_[0] = temp;
1384 } 1502 }
1385 1503
1504 LOperand* context() { return inputs_[0]; }
1505 LOperand* value() { return inputs_[1]; }
1506 LOperand* temp() { return temps_[0]; }
1507
1386 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot") 1508 DECLARE_CONCRETE_INSTRUCTION(StoreContextSlot, "store-context-slot")
1387 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot) 1509 DECLARE_HYDROGEN_ACCESSOR(StoreContextSlot)
1388 1510
1389 LOperand* context() { return InputAt(0); }
1390 LOperand* value() { return InputAt(1); }
1391 int slot_index() { return hydrogen()->slot_index(); } 1511 int slot_index() { return hydrogen()->slot_index(); }
1392 1512
1393 virtual void PrintDataTo(StringStream* stream); 1513 virtual void PrintDataTo(StringStream* stream);
1394 }; 1514 };
1395 1515
1396 1516
1397 class LPushArgument: public LTemplateInstruction<0, 1, 0> { 1517 class LPushArgument: public LTemplateInstruction<0, 1, 0> {
1398 public: 1518 public:
1399 explicit LPushArgument(LOperand* value) { 1519 explicit LPushArgument(LOperand* value) {
1400 inputs_[0] = value; 1520 inputs_[0] = value;
1401 } 1521 }
1402 1522
1523 LOperand* value() { return inputs_[0]; }
1524
1403 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument") 1525 DECLARE_CONCRETE_INSTRUCTION(PushArgument, "push-argument")
1404 }; 1526 };
1405 1527
1406 1528
1407 class LDrop: public LTemplateInstruction<0, 0, 0> { 1529 class LDrop: public LTemplateInstruction<0, 0, 0> {
1408 public: 1530 public:
1409 explicit LDrop(int count) : count_(count) { } 1531 explicit LDrop(int count) : count_(count) { }
1410 1532
1411 int count() const { return count_; } 1533 int count() const { return count_; }
1412 1534
(...skipping 16 matching lines...) Expand all
1429 DECLARE_CONCRETE_INSTRUCTION(Context, "context") 1551 DECLARE_CONCRETE_INSTRUCTION(Context, "context")
1430 }; 1552 };
1431 1553
1432 1554
1433 class LOuterContext: public LTemplateInstruction<1, 1, 0> { 1555 class LOuterContext: public LTemplateInstruction<1, 1, 0> {
1434 public: 1556 public:
1435 explicit LOuterContext(LOperand* context) { 1557 explicit LOuterContext(LOperand* context) {
1436 inputs_[0] = context; 1558 inputs_[0] = context;
1437 } 1559 }
1438 1560
1561 LOperand* context() { return inputs_[0]; }
1562
1439 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context") 1563 DECLARE_CONCRETE_INSTRUCTION(OuterContext, "outer-context")
1440
1441 LOperand* context() { return InputAt(0); }
1442 }; 1564 };
1443 1565
1444 1566
1445 class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> { 1567 class LDeclareGlobals: public LTemplateInstruction<0, 0, 0> {
1446 public: 1568 public:
1447 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals") 1569 DECLARE_CONCRETE_INSTRUCTION(DeclareGlobals, "declare-globals")
1448 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals) 1570 DECLARE_HYDROGEN_ACCESSOR(DeclareGlobals)
1449 }; 1571 };
1450 1572
1451 1573
1452 class LGlobalObject: public LTemplateInstruction<1, 0, 0> { 1574 class LGlobalObject: public LTemplateInstruction<1, 0, 0> {
1453 public: 1575 public:
1454 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object") 1576 DECLARE_CONCRETE_INSTRUCTION(GlobalObject, "global-object")
1455 }; 1577 };
1456 1578
1457 1579
1458 class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> { 1580 class LGlobalReceiver: public LTemplateInstruction<1, 1, 0> {
1459 public: 1581 public:
1460 explicit LGlobalReceiver(LOperand* global_object) { 1582 explicit LGlobalReceiver(LOperand* global_object) {
1461 inputs_[0] = global_object; 1583 inputs_[0] = global_object;
1462 } 1584 }
1463 1585
1586 LOperand* global() { return inputs_[0]; }
1587
1464 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver") 1588 DECLARE_CONCRETE_INSTRUCTION(GlobalReceiver, "global-receiver")
1465
1466 LOperand* global() { return InputAt(0); }
1467 }; 1589 };
1468 1590
1469 1591
1470 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> { 1592 class LCallConstantFunction: public LTemplateInstruction<1, 0, 0> {
1471 public: 1593 public:
1472 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") 1594 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function")
1473 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) 1595 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction)
1474 1596
1475 virtual void PrintDataTo(StringStream* stream); 1597 virtual void PrintDataTo(StringStream* stream);
1476 1598
1477 Handle<JSFunction> function() { return hydrogen()->function(); } 1599 Handle<JSFunction> function() { return hydrogen()->function(); }
1478 int arity() const { return hydrogen()->argument_count() - 1; } 1600 int arity() const { return hydrogen()->argument_count() - 1; }
1479 }; 1601 };
1480 1602
1481 1603
1482 class LInvokeFunction: public LTemplateInstruction<1, 1, 0> { 1604 class LInvokeFunction: public LTemplateInstruction<1, 1, 0> {
1483 public: 1605 public:
1484 explicit LInvokeFunction(LOperand* function) { 1606 explicit LInvokeFunction(LOperand* function) {
1485 inputs_[0] = function; 1607 inputs_[0] = function;
1486 } 1608 }
1487 1609
1610 LOperand* function() { return inputs_[0]; }
1611
1488 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function") 1612 DECLARE_CONCRETE_INSTRUCTION(InvokeFunction, "invoke-function")
1489 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction) 1613 DECLARE_HYDROGEN_ACCESSOR(InvokeFunction)
1490 1614
1491 LOperand* function() { return inputs_[0]; }
1492
1493 virtual void PrintDataTo(StringStream* stream); 1615 virtual void PrintDataTo(StringStream* stream);
1494 1616
1495 int arity() const { return hydrogen()->argument_count() - 1; } 1617 int arity() const { return hydrogen()->argument_count() - 1; }
1496 Handle<JSFunction> known_function() { return hydrogen()->known_function(); } 1618 Handle<JSFunction> known_function() { return hydrogen()->known_function(); }
1497 }; 1619 };
1498 1620
1499 1621
1500 class LCallKeyed: public LTemplateInstruction<1, 1, 0> { 1622 class LCallKeyed: public LTemplateInstruction<1, 1, 0> {
1501 public: 1623 public:
1502 explicit LCallKeyed(LOperand* key) { 1624 explicit LCallKeyed(LOperand* key) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1563 int arity() const { return hydrogen()->argument_count() - 1; } 1685 int arity() const { return hydrogen()->argument_count() - 1; }
1564 }; 1686 };
1565 1687
1566 1688
1567 class LCallNew: public LTemplateInstruction<1, 1, 0> { 1689 class LCallNew: public LTemplateInstruction<1, 1, 0> {
1568 public: 1690 public:
1569 explicit LCallNew(LOperand* constructor) { 1691 explicit LCallNew(LOperand* constructor) {
1570 inputs_[0] = constructor; 1692 inputs_[0] = constructor;
1571 } 1693 }
1572 1694
1695 LOperand* constructor() { return inputs_[0]; }
1696
1573 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new") 1697 DECLARE_CONCRETE_INSTRUCTION(CallNew, "call-new")
1574 DECLARE_HYDROGEN_ACCESSOR(CallNew) 1698 DECLARE_HYDROGEN_ACCESSOR(CallNew)
1575 1699
1576 virtual void PrintDataTo(StringStream* stream); 1700 virtual void PrintDataTo(StringStream* stream);
1577 1701
1578 int arity() const { return hydrogen()->argument_count() - 1; } 1702 int arity() const { return hydrogen()->argument_count() - 1; }
1579 }; 1703 };
1580 1704
1581 1705
1582 class LCallRuntime: public LTemplateInstruction<1, 0, 0> { 1706 class LCallRuntime: public LTemplateInstruction<1, 0, 0> {
1583 public: 1707 public:
1584 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime") 1708 DECLARE_CONCRETE_INSTRUCTION(CallRuntime, "call-runtime")
1585 DECLARE_HYDROGEN_ACCESSOR(CallRuntime) 1709 DECLARE_HYDROGEN_ACCESSOR(CallRuntime)
1586 1710
1587 const Runtime::Function* function() const { return hydrogen()->function(); } 1711 const Runtime::Function* function() const { return hydrogen()->function(); }
1588 int arity() const { return hydrogen()->argument_count(); } 1712 int arity() const { return hydrogen()->argument_count(); }
1589 }; 1713 };
1590 1714
1591 1715
1592 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> { 1716 class LInteger32ToDouble: public LTemplateInstruction<1, 1, 0> {
1593 public: 1717 public:
1594 explicit LInteger32ToDouble(LOperand* value) { 1718 explicit LInteger32ToDouble(LOperand* value) {
1595 inputs_[0] = value; 1719 inputs_[0] = value;
1596 } 1720 }
1597 1721
1722 LOperand* value() { return inputs_[0]; }
1723
1598 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double") 1724 DECLARE_CONCRETE_INSTRUCTION(Integer32ToDouble, "int32-to-double")
1599 }; 1725 };
1600 1726
1601 1727
1602 class LUint32ToDouble: public LTemplateInstruction<1, 1, 1> { 1728 class LUint32ToDouble: public LTemplateInstruction<1, 1, 1> {
1603 public: 1729 public:
1604 explicit LUint32ToDouble(LOperand* value, LOperand* temp) { 1730 explicit LUint32ToDouble(LOperand* value, LOperand* temp) {
1605 inputs_[0] = value; 1731 inputs_[0] = value;
1606 temps_[0] = temp; 1732 temps_[0] = temp;
1607 } 1733 }
1608 1734
1735 LOperand* value() { return inputs_[0]; }
1736 LOperand* temp() { return temps_[0]; }
1737
1609 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double") 1738 DECLARE_CONCRETE_INSTRUCTION(Uint32ToDouble, "uint32-to-double")
1610 }; 1739 };
1611 1740
1612 1741
1613 class LNumberTagI: public LTemplateInstruction<1, 1, 0> { 1742 class LNumberTagI: public LTemplateInstruction<1, 1, 0> {
1614 public: 1743 public:
1615 explicit LNumberTagI(LOperand* value) { 1744 explicit LNumberTagI(LOperand* value) {
1616 inputs_[0] = value; 1745 inputs_[0] = value;
1617 } 1746 }
1618 1747
1748 LOperand* value() { return inputs_[0]; }
1749
1619 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") 1750 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i")
1620 }; 1751 };
1621 1752
1622 1753
1623 class LNumberTagU: public LTemplateInstruction<1, 1, 1> { 1754 class LNumberTagU: public LTemplateInstruction<1, 1, 1> {
1624 public: 1755 public:
1625 explicit LNumberTagU(LOperand* value, LOperand* temp) { 1756 explicit LNumberTagU(LOperand* value, LOperand* temp) {
1626 inputs_[0] = value; 1757 inputs_[0] = value;
1627 temps_[0] = temp; 1758 temps_[0] = temp;
1628 } 1759 }
1629 1760
1761 LOperand* value() { return inputs_[0]; }
1762 LOperand* temp() { return temps_[0]; }
1763
1630 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u") 1764 DECLARE_CONCRETE_INSTRUCTION(NumberTagU, "number-tag-u")
1631 }; 1765 };
1632 1766
1633 1767
1634 class LNumberTagD: public LTemplateInstruction<1, 1, 1> { 1768 class LNumberTagD: public LTemplateInstruction<1, 1, 1> {
1635 public: 1769 public:
1636 explicit LNumberTagD(LOperand* value, LOperand* temp) { 1770 explicit LNumberTagD(LOperand* value, LOperand* temp) {
1637 inputs_[0] = value; 1771 inputs_[0] = value;
1638 temps_[0] = temp; 1772 temps_[0] = temp;
1639 } 1773 }
1640 1774
1775 LOperand* value() { return inputs_[0]; }
1776 LOperand* temp() { return temps_[0]; }
1777
1641 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") 1778 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d")
1642 }; 1779 };
1643 1780
1644 1781
1645 // Sometimes truncating conversion from a tagged value to an int32. 1782 // Sometimes truncating conversion from a tagged value to an int32.
1646 class LDoubleToI: public LTemplateInstruction<1, 1, 0> { 1783 class LDoubleToI: public LTemplateInstruction<1, 1, 0> {
1647 public: 1784 public:
1648 explicit LDoubleToI(LOperand* value) { 1785 explicit LDoubleToI(LOperand* value) {
1649 inputs_[0] = value; 1786 inputs_[0] = value;
1650 } 1787 }
1651 1788
1789 LOperand* value() { return inputs_[0]; }
1790
1652 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") 1791 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i")
1653 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1792 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1654 1793
1655 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1794 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1656 }; 1795 };
1657 1796
1658 1797
1659 // Truncating conversion from a tagged value to an int32. 1798 // Truncating conversion from a tagged value to an int32.
1660 class LTaggedToI: public LTemplateInstruction<1, 1, 1> { 1799 class LTaggedToI: public LTemplateInstruction<1, 1, 1> {
1661 public: 1800 public:
1662 LTaggedToI(LOperand* value, LOperand* temp) { 1801 LTaggedToI(LOperand* value, LOperand* temp) {
1663 inputs_[0] = value; 1802 inputs_[0] = value;
1664 temps_[0] = temp; 1803 temps_[0] = temp;
1665 } 1804 }
1666 1805
1806 LOperand* value() { return inputs_[0]; }
1807 LOperand* temp() { return temps_[0]; }
1808
1667 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") 1809 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i")
1668 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation) 1810 DECLARE_HYDROGEN_ACCESSOR(UnaryOperation)
1669 1811
1670 bool truncating() { return hydrogen()->CanTruncateToInt32(); } 1812 bool truncating() { return hydrogen()->CanTruncateToInt32(); }
1671 }; 1813 };
1672 1814
1673 1815
1674 class LSmiTag: public LTemplateInstruction<1, 1, 0> { 1816 class LSmiTag: public LTemplateInstruction<1, 1, 0> {
1675 public: 1817 public:
1676 explicit LSmiTag(LOperand* value) { 1818 explicit LSmiTag(LOperand* value) {
1677 inputs_[0] = value; 1819 inputs_[0] = value;
1678 } 1820 }
1679 1821
1822 LOperand* value() { return inputs_[0]; }
1823
1680 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") 1824 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag")
1681 }; 1825 };
1682 1826
1683 1827
1684 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> { 1828 class LNumberUntagD: public LTemplateInstruction<1, 1, 0> {
1685 public: 1829 public:
1686 explicit LNumberUntagD(LOperand* value) { 1830 explicit LNumberUntagD(LOperand* value) {
1687 inputs_[0] = value; 1831 inputs_[0] = value;
1688 } 1832 }
1689 1833
1834 LOperand* value() { return inputs_[0]; }
1835
1690 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag") 1836 DECLARE_CONCRETE_INSTRUCTION(NumberUntagD, "double-untag")
1691 DECLARE_HYDROGEN_ACCESSOR(Change); 1837 DECLARE_HYDROGEN_ACCESSOR(Change);
1692 }; 1838 };
1693 1839
1694 1840
1695 class LSmiUntag: public LTemplateInstruction<1, 1, 0> { 1841 class LSmiUntag: public LTemplateInstruction<1, 1, 0> {
1696 public: 1842 public:
1697 LSmiUntag(LOperand* value, bool needs_check) 1843 LSmiUntag(LOperand* value, bool needs_check)
1698 : needs_check_(needs_check) { 1844 : needs_check_(needs_check) {
1699 inputs_[0] = value; 1845 inputs_[0] = value;
1700 } 1846 }
1701 1847
1848 LOperand* value() { return inputs_[0]; }
1849 bool needs_check() const { return needs_check_; }
1850
1702 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") 1851 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag")
1703 1852
1704 bool needs_check() const { return needs_check_; }
1705
1706 private: 1853 private:
1707 bool needs_check_; 1854 bool needs_check_;
1708 }; 1855 };
1709 1856
1710 1857
1711 class LStoreNamedField: public LTemplateInstruction<0, 2, 1> { 1858 class LStoreNamedField: public LTemplateInstruction<0, 2, 1> {
1712 public: 1859 public:
1713 LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) { 1860 LStoreNamedField(LOperand* object, LOperand* value, LOperand* temp) {
1714 inputs_[0] = object; 1861 inputs_[0] = object;
1715 inputs_[1] = value; 1862 inputs_[1] = value;
1716 temps_[0] = temp; 1863 temps_[0] = temp;
1717 } 1864 }
1718 1865
1866 LOperand* object() { return inputs_[0]; }
1867 LOperand* value() { return inputs_[1]; }
1868 LOperand* temp() { return temps_[0]; }
1869
1719 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") 1870 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field")
1720 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) 1871 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField)
1721 1872
1722 virtual void PrintDataTo(StringStream* stream); 1873 virtual void PrintDataTo(StringStream* stream);
1723 1874
1724 LOperand* object() { return inputs_[0]; }
1725 LOperand* value() { return inputs_[1]; }
1726
1727 Handle<Object> name() const { return hydrogen()->name(); } 1875 Handle<Object> name() const { return hydrogen()->name(); }
1728 bool is_in_object() { return hydrogen()->is_in_object(); } 1876 bool is_in_object() { return hydrogen()->is_in_object(); }
1729 int offset() { return hydrogen()->offset(); } 1877 int offset() { return hydrogen()->offset(); }
1730 Handle<Map> transition() const { return hydrogen()->transition(); } 1878 Handle<Map> transition() const { return hydrogen()->transition(); }
1731 }; 1879 };
1732 1880
1733 1881
1734 class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> { 1882 class LStoreNamedGeneric: public LTemplateInstruction<0, 2, 0> {
1735 public: 1883 public:
1736 LStoreNamedGeneric(LOperand* object, LOperand* value) { 1884 LStoreNamedGeneric(LOperand* object, LOperand* value) {
1737 inputs_[0] = object; 1885 inputs_[0] = object;
1738 inputs_[1] = value; 1886 inputs_[1] = value;
1739 } 1887 }
1740 1888
1889 LOperand* object() { return inputs_[0]; }
1890 LOperand* value() { return inputs_[1]; }
1891
1741 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") 1892 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic")
1742 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) 1893 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric)
1743 1894
1744 virtual void PrintDataTo(StringStream* stream); 1895 virtual void PrintDataTo(StringStream* stream);
1745 1896
1746 LOperand* object() { return inputs_[0]; }
1747 LOperand* value() { return inputs_[1]; }
1748 Handle<Object> name() const { return hydrogen()->name(); } 1897 Handle<Object> name() const { return hydrogen()->name(); }
1749 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } 1898 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1750 }; 1899 };
1751 1900
1752 1901
1753 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> { 1902 class LStoreKeyedFastElement: public LTemplateInstruction<0, 3, 0> {
1754 public: 1903 public:
1755 LStoreKeyedFastElement(LOperand* obj, LOperand* key, LOperand* val) { 1904 LStoreKeyedFastElement(LOperand* object, LOperand* key, LOperand* value) {
1756 inputs_[0] = obj; 1905 inputs_[0] = object;
1757 inputs_[1] = key; 1906 inputs_[1] = key;
1758 inputs_[2] = val; 1907 inputs_[2] = value;
1759 } 1908 }
1760 1909
1910 LOperand* object() { return inputs_[0]; }
1911 LOperand* key() { return inputs_[1]; }
1912 LOperand* value() { return inputs_[2]; }
1913
1761 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement, 1914 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastElement,
1762 "store-keyed-fast-element") 1915 "store-keyed-fast-element")
1763 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement) 1916 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastElement)
1764 1917
1765 virtual void PrintDataTo(StringStream* stream); 1918 virtual void PrintDataTo(StringStream* stream);
1766 1919
1767 LOperand* object() { return inputs_[0]; }
1768 LOperand* key() { return inputs_[1]; }
1769 LOperand* value() { return inputs_[2]; }
1770 uint32_t additional_index() const { return hydrogen()->index_offset(); } 1920 uint32_t additional_index() const { return hydrogen()->index_offset(); }
1771 }; 1921 };
1772 1922
1773 1923
1774 class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> { 1924 class LStoreKeyedFastDoubleElement: public LTemplateInstruction<0, 3, 0> {
1775 public: 1925 public:
1776 LStoreKeyedFastDoubleElement(LOperand* elements, 1926 LStoreKeyedFastDoubleElement(LOperand* elements,
1777 LOperand* key, 1927 LOperand* key,
1778 LOperand* val) { 1928 LOperand* value) {
1779 inputs_[0] = elements; 1929 inputs_[0] = elements;
1780 inputs_[1] = key; 1930 inputs_[1] = key;
1781 inputs_[2] = val; 1931 inputs_[2] = value;
1782 } 1932 }
1783 1933
1934 LOperand* elements() { return inputs_[0]; }
1935 LOperand* key() { return inputs_[1]; }
1936 LOperand* value() { return inputs_[2]; }
1937
1784 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement, 1938 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedFastDoubleElement,
1785 "store-keyed-fast-double-element") 1939 "store-keyed-fast-double-element")
1786 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement) 1940 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedFastDoubleElement)
1787 1941
1788 virtual void PrintDataTo(StringStream* stream); 1942 virtual void PrintDataTo(StringStream* stream);
1789 1943
1790 LOperand* elements() { return inputs_[0]; }
1791 LOperand* key() { return inputs_[1]; }
1792 LOperand* value() { return inputs_[2]; }
1793
1794 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); } 1944 bool NeedsCanonicalization() { return hydrogen()->NeedsCanonicalization(); }
1795 uint32_t additional_index() const { return hydrogen()->index_offset(); } 1945 uint32_t additional_index() const { return hydrogen()->index_offset(); }
1796 }; 1946 };
1797 1947
1798 1948
1799 class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> { 1949 class LStoreKeyedSpecializedArrayElement: public LTemplateInstruction<0, 3, 0> {
1800 public: 1950 public:
1801 LStoreKeyedSpecializedArrayElement(LOperand* external_pointer, 1951 LStoreKeyedSpecializedArrayElement(LOperand* external_pointer,
1802 LOperand* key, 1952 LOperand* key,
1803 LOperand* val) { 1953 LOperand* value) {
1804 inputs_[0] = external_pointer; 1954 inputs_[0] = external_pointer;
1805 inputs_[1] = key; 1955 inputs_[1] = key;
1806 inputs_[2] = val; 1956 inputs_[2] = value;
1807 } 1957 }
1808 1958
1959 LOperand* external_pointer() { return inputs_[0]; }
1960 LOperand* key() { return inputs_[1]; }
1961 LOperand* value() { return inputs_[2]; }
1962
1809 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement, 1963 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedSpecializedArrayElement,
1810 "store-keyed-specialized-array-element") 1964 "store-keyed-specialized-array-element")
1811 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement) 1965 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedSpecializedArrayElement)
1812 1966
1813 LOperand* external_pointer() { return inputs_[0]; } 1967 ElementsKind elements_kind() const { return hydrogen()->elements_kind(); }
1814 LOperand* key() { return inputs_[1]; }
1815 LOperand* value() { return inputs_[2]; }
1816 ElementsKind elements_kind() const {
1817 return hydrogen()->elements_kind();
1818 }
1819 uint32_t additional_index() const { return hydrogen()->index_offset(); } 1968 uint32_t additional_index() const { return hydrogen()->index_offset(); }
1820 }; 1969 };
1821 1970
1822 1971
1823 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> { 1972 class LStoreKeyedGeneric: public LTemplateInstruction<0, 3, 0> {
1824 public: 1973 public:
1825 LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) { 1974 LStoreKeyedGeneric(LOperand* object, LOperand* key, LOperand* value) {
1826 inputs_[0] = object; 1975 inputs_[0] = object;
1827 inputs_[1] = key; 1976 inputs_[1] = key;
1828 inputs_[2] = value; 1977 inputs_[2] = value;
1829 } 1978 }
1830 1979
1980 LOperand* object() { return inputs_[0]; }
1981 LOperand* key() { return inputs_[1]; }
1982 LOperand* value() { return inputs_[2]; }
1983
1831 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic") 1984 DECLARE_CONCRETE_INSTRUCTION(StoreKeyedGeneric, "store-keyed-generic")
1832 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric) 1985 DECLARE_HYDROGEN_ACCESSOR(StoreKeyedGeneric)
1833 1986
1834 virtual void PrintDataTo(StringStream* stream); 1987 virtual void PrintDataTo(StringStream* stream);
1835 1988
1836 LOperand* object() { return inputs_[0]; }
1837 LOperand* key() { return inputs_[1]; }
1838 LOperand* value() { return inputs_[2]; }
1839 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); } 1989 StrictModeFlag strict_mode_flag() { return hydrogen()->strict_mode_flag(); }
1840 }; 1990 };
1841 1991
1842 1992
1843 class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> { 1993 class LTransitionElementsKind: public LTemplateInstruction<1, 1, 2> {
1844 public: 1994 public:
1845 LTransitionElementsKind(LOperand* object, 1995 LTransitionElementsKind(LOperand* object,
1846 LOperand* new_map_temp, 1996 LOperand* new_map_temp,
1847 LOperand* temp_reg) { 1997 LOperand* temp) {
1848 inputs_[0] = object; 1998 inputs_[0] = object;
1849 temps_[0] = new_map_temp; 1999 temps_[0] = new_map_temp;
1850 temps_[1] = temp_reg; 2000 temps_[1] = temp;
1851 } 2001 }
1852 2002
2003 LOperand* object() { return inputs_[0]; }
2004 LOperand* new_map_temp() { return temps_[0]; }
2005 LOperand* temp() { return temps_[1]; }
2006
1853 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind, 2007 DECLARE_CONCRETE_INSTRUCTION(TransitionElementsKind,
1854 "transition-elements-kind") 2008 "transition-elements-kind")
1855 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind) 2009 DECLARE_HYDROGEN_ACCESSOR(TransitionElementsKind)
1856 2010
1857 virtual void PrintDataTo(StringStream* stream); 2011 virtual void PrintDataTo(StringStream* stream);
1858 2012
1859 LOperand* object() { return inputs_[0]; }
1860 LOperand* new_map_reg() { return temps_[0]; }
1861 LOperand* temp_reg() { return temps_[1]; }
1862 Handle<Map> original_map() { return hydrogen()->original_map(); } 2013 Handle<Map> original_map() { return hydrogen()->original_map(); }
1863 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); } 2014 Handle<Map> transitioned_map() { return hydrogen()->transitioned_map(); }
1864 }; 2015 };
1865 2016
1866 2017
1867 class LStringAdd: public LTemplateInstruction<1, 2, 0> { 2018 class LStringAdd: public LTemplateInstruction<1, 2, 0> {
1868 public: 2019 public:
1869 LStringAdd(LOperand* left, LOperand* right) { 2020 LStringAdd(LOperand* left, LOperand* right) {
1870 inputs_[0] = left; 2021 inputs_[0] = left;
1871 inputs_[1] = right; 2022 inputs_[1] = right;
1872 } 2023 }
1873 2024
2025 LOperand* left() { return inputs_[0]; }
2026 LOperand* right() { return inputs_[1]; }
2027
1874 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add") 2028 DECLARE_CONCRETE_INSTRUCTION(StringAdd, "string-add")
1875 DECLARE_HYDROGEN_ACCESSOR(StringAdd) 2029 DECLARE_HYDROGEN_ACCESSOR(StringAdd)
1876
1877 LOperand* left() { return inputs_[0]; }
1878 LOperand* right() { return inputs_[1]; }
1879 }; 2030 };
1880 2031
1881 2032
1882 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> { 2033 class LStringCharCodeAt: public LTemplateInstruction<1, 2, 0> {
1883 public: 2034 public:
1884 LStringCharCodeAt(LOperand* string, LOperand* index) { 2035 LStringCharCodeAt(LOperand* string, LOperand* index) {
1885 inputs_[0] = string; 2036 inputs_[0] = string;
1886 inputs_[1] = index; 2037 inputs_[1] = index;
1887 } 2038 }
1888 2039
2040 LOperand* string() { return inputs_[0]; }
2041 LOperand* index() { return inputs_[1]; }
2042
1889 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at") 2043 DECLARE_CONCRETE_INSTRUCTION(StringCharCodeAt, "string-char-code-at")
1890 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt) 2044 DECLARE_HYDROGEN_ACCESSOR(StringCharCodeAt)
1891
1892 LOperand* string() { return inputs_[0]; }
1893 LOperand* index() { return inputs_[1]; }
1894 }; 2045 };
1895 2046
1896 2047
1897 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> { 2048 class LStringCharFromCode: public LTemplateInstruction<1, 1, 0> {
1898 public: 2049 public:
1899 explicit LStringCharFromCode(LOperand* char_code) { 2050 explicit LStringCharFromCode(LOperand* char_code) {
1900 inputs_[0] = char_code; 2051 inputs_[0] = char_code;
1901 } 2052 }
1902 2053
2054 LOperand* char_code() { return inputs_[0]; }
2055
1903 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code") 2056 DECLARE_CONCRETE_INSTRUCTION(StringCharFromCode, "string-char-from-code")
1904 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode) 2057 DECLARE_HYDROGEN_ACCESSOR(StringCharFromCode)
1905
1906 LOperand* char_code() { return inputs_[0]; }
1907 }; 2058 };
1908 2059
1909 2060
1910 class LStringLength: public LTemplateInstruction<1, 1, 0> { 2061 class LStringLength: public LTemplateInstruction<1, 1, 0> {
1911 public: 2062 public:
1912 explicit LStringLength(LOperand* string) { 2063 explicit LStringLength(LOperand* string) {
1913 inputs_[0] = string; 2064 inputs_[0] = string;
1914 } 2065 }
1915 2066
2067 LOperand* string() { return inputs_[0]; }
2068
1916 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length") 2069 DECLARE_CONCRETE_INSTRUCTION(StringLength, "string-length")
1917 DECLARE_HYDROGEN_ACCESSOR(StringLength) 2070 DECLARE_HYDROGEN_ACCESSOR(StringLength)
1918
1919 LOperand* string() { return inputs_[0]; }
1920 }; 2071 };
1921 2072
1922 2073
1923 class LCheckFunction: public LTemplateInstruction<0, 1, 0> { 2074 class LCheckFunction: public LTemplateInstruction<0, 1, 0> {
1924 public: 2075 public:
1925 explicit LCheckFunction(LOperand* value) { 2076 explicit LCheckFunction(LOperand* value) {
1926 inputs_[0] = value; 2077 inputs_[0] = value;
1927 } 2078 }
1928 2079
1929 LOperand* value() { return InputAt(0); } 2080 LOperand* value() { return inputs_[0]; }
1930 2081
1931 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") 2082 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function")
1932 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) 2083 DECLARE_HYDROGEN_ACCESSOR(CheckFunction)
1933 }; 2084 };
1934 2085
1935 2086
1936 class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> { 2087 class LCheckInstanceType: public LTemplateInstruction<0, 1, 0> {
1937 public: 2088 public:
1938 explicit LCheckInstanceType(LOperand* value) { 2089 explicit LCheckInstanceType(LOperand* value) {
1939 inputs_[0] = value; 2090 inputs_[0] = value;
1940 } 2091 }
1941 2092
2093 LOperand* value() { return inputs_[0]; }
2094
1942 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") 2095 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type")
1943 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) 2096 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType)
1944 }; 2097 };
1945 2098
1946 2099
1947 class LCheckMaps: public LTemplateInstruction<0, 1, 0> { 2100 class LCheckMaps: public LTemplateInstruction<0, 1, 0> {
1948 public: 2101 public:
1949 explicit LCheckMaps(LOperand* value) { 2102 explicit LCheckMaps(LOperand* value) {
1950 inputs_[0] = value; 2103 inputs_[0] = value;
1951 } 2104 }
1952 2105
2106 LOperand* value() { return inputs_[0]; }
2107
1953 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps") 2108 DECLARE_CONCRETE_INSTRUCTION(CheckMaps, "check-maps")
1954 DECLARE_HYDROGEN_ACCESSOR(CheckMaps) 2109 DECLARE_HYDROGEN_ACCESSOR(CheckMaps)
1955 }; 2110 };
1956 2111
1957 2112
1958 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> { 2113 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> {
1959 public: 2114 public:
1960 explicit LCheckPrototypeMaps(LOperand* temp) { 2115 explicit LCheckPrototypeMaps(LOperand* temp) {
1961 temps_[0] = temp; 2116 temps_[0] = temp;
1962 } 2117 }
1963 2118
2119 LOperand* temp() { return temps_[0]; }
2120
1964 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") 2121 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps")
1965 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) 2122 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps)
1966 2123
1967 Handle<JSObject> prototype() const { return hydrogen()->prototype(); } 2124 Handle<JSObject> prototype() const { return hydrogen()->prototype(); }
1968 Handle<JSObject> holder() const { return hydrogen()->holder(); } 2125 Handle<JSObject> holder() const { return hydrogen()->holder(); }
1969 }; 2126 };
1970 2127
1971 2128
1972 class LCheckSmi: public LTemplateInstruction<0, 1, 0> { 2129 class LCheckSmi: public LTemplateInstruction<0, 1, 0> {
1973 public: 2130 public:
1974 explicit LCheckSmi(LOperand* value) { 2131 explicit LCheckSmi(LOperand* value) {
1975 inputs_[0] = value; 2132 inputs_[0] = value;
1976 } 2133 }
1977 2134
2135 LOperand* value() { return inputs_[0]; }
2136
1978 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi") 2137 DECLARE_CONCRETE_INSTRUCTION(CheckSmi, "check-smi")
1979 }; 2138 };
1980 2139
1981 2140
1982 class LClampDToUint8: public LTemplateInstruction<1, 1, 1> { 2141 class LClampDToUint8: public LTemplateInstruction<1, 1, 1> {
1983 public: 2142 public:
1984 LClampDToUint8(LOperand* value, LOperand* temp) { 2143 LClampDToUint8(LOperand* unclamped, LOperand* temp) {
1985 inputs_[0] = value; 2144 inputs_[0] = unclamped;
1986 temps_[0] = temp; 2145 temps_[0] = temp;
1987 } 2146 }
1988 2147
1989 LOperand* unclamped() { return inputs_[0]; } 2148 LOperand* unclamped() { return inputs_[0]; }
2149 LOperand* temp() { return temps_[0]; }
1990 2150
1991 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8") 2151 DECLARE_CONCRETE_INSTRUCTION(ClampDToUint8, "clamp-d-to-uint8")
1992 }; 2152 };
1993 2153
1994 2154
1995 class LClampIToUint8: public LTemplateInstruction<1, 1, 0> { 2155 class LClampIToUint8: public LTemplateInstruction<1, 1, 0> {
1996 public: 2156 public:
1997 explicit LClampIToUint8(LOperand* value) { 2157 explicit LClampIToUint8(LOperand* unclamped) {
1998 inputs_[0] = value; 2158 inputs_[0] = unclamped;
1999 } 2159 }
2000 2160
2001 LOperand* unclamped() { return inputs_[0]; } 2161 LOperand* unclamped() { return inputs_[0]; }
2002 2162
2003 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8") 2163 DECLARE_CONCRETE_INSTRUCTION(ClampIToUint8, "clamp-i-to-uint8")
2004 }; 2164 };
2005 2165
2006 2166
2007 class LClampTToUint8: public LTemplateInstruction<1, 1, 2> { 2167 class LClampTToUint8: public LTemplateInstruction<1, 1, 2> {
2008 public: 2168 public:
2009 LClampTToUint8(LOperand* value, 2169 LClampTToUint8(LOperand* unclamped,
2010 LOperand* temp, 2170 LOperand* temp,
2011 LOperand* temp2) { 2171 LOperand* temp2) {
2012 inputs_[0] = value; 2172 inputs_[0] = unclamped;
2013 temps_[0] = temp; 2173 temps_[0] = temp;
2014 temps_[1] = temp2; 2174 temps_[1] = temp2;
2015 } 2175 }
2016 2176
2017 LOperand* unclamped() { return inputs_[0]; } 2177 LOperand* unclamped() { return inputs_[0]; }
2178 LOperand* temp() { return temps_[0]; }
2179 LOperand* temp2() { return temps_[1]; }
2018 2180
2019 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8") 2181 DECLARE_CONCRETE_INSTRUCTION(ClampTToUint8, "clamp-t-to-uint8")
2020 }; 2182 };
2021 2183
2022 2184
2023 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> { 2185 class LCheckNonSmi: public LTemplateInstruction<0, 1, 0> {
2024 public: 2186 public:
2025 explicit LCheckNonSmi(LOperand* value) { 2187 explicit LCheckNonSmi(LOperand* value) {
2026 inputs_[0] = value; 2188 inputs_[0] = value;
2027 } 2189 }
2028 2190
2191 LOperand* value() { return inputs_[0]; }
2192
2029 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi") 2193 DECLARE_CONCRETE_INSTRUCTION(CheckNonSmi, "check-non-smi")
2030 }; 2194 };
2031 2195
2032 2196
2033 class LAllocateObject: public LTemplateInstruction<1, 0, 1> { 2197 class LAllocateObject: public LTemplateInstruction<1, 0, 1> {
2034 public: 2198 public:
2035 explicit LAllocateObject(LOperand* temp) { 2199 explicit LAllocateObject(LOperand* temp) {
2036 temps_[0] = temp; 2200 temps_[0] = temp;
2037 } 2201 }
2038 2202
2203 LOperand* temp() { return temps_[0]; }
2204
2039 DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object") 2205 DECLARE_CONCRETE_INSTRUCTION(AllocateObject, "allocate-object")
2040 DECLARE_HYDROGEN_ACCESSOR(AllocateObject) 2206 DECLARE_HYDROGEN_ACCESSOR(AllocateObject)
2041 }; 2207 };
2042 2208
2043 2209
2044 class LFastLiteral: public LTemplateInstruction<1, 0, 0> { 2210 class LFastLiteral: public LTemplateInstruction<1, 0, 0> {
2045 public: 2211 public:
2046 DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal") 2212 DECLARE_CONCRETE_INSTRUCTION(FastLiteral, "fast-literal")
2047 DECLARE_HYDROGEN_ACCESSOR(FastLiteral) 2213 DECLARE_HYDROGEN_ACCESSOR(FastLiteral)
2048 }; 2214 };
(...skipping 28 matching lines...) Expand all
2077 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); } 2243 Handle<SharedFunctionInfo> shared_info() { return hydrogen()->shared_info(); }
2078 }; 2244 };
2079 2245
2080 2246
2081 class LToFastProperties: public LTemplateInstruction<1, 1, 0> { 2247 class LToFastProperties: public LTemplateInstruction<1, 1, 0> {
2082 public: 2248 public:
2083 explicit LToFastProperties(LOperand* value) { 2249 explicit LToFastProperties(LOperand* value) {
2084 inputs_[0] = value; 2250 inputs_[0] = value;
2085 } 2251 }
2086 2252
2253 LOperand* value() { return inputs_[0]; }
2254
2087 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties") 2255 DECLARE_CONCRETE_INSTRUCTION(ToFastProperties, "to-fast-properties")
2088 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties) 2256 DECLARE_HYDROGEN_ACCESSOR(ToFastProperties)
2089 }; 2257 };
2090 2258
2091 2259
2092 class LTypeof: public LTemplateInstruction<1, 1, 0> { 2260 class LTypeof: public LTemplateInstruction<1, 1, 0> {
2093 public: 2261 public:
2094 explicit LTypeof(LOperand* value) { 2262 explicit LTypeof(LOperand* value) {
2095 inputs_[0] = value; 2263 inputs_[0] = value;
2096 } 2264 }
2097 2265
2266 LOperand* value() { return inputs_[0]; }
2267
2098 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") 2268 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof")
2099 }; 2269 };
2100 2270
2101 2271
2102 class LTypeofIsAndBranch: public LControlInstruction<1, 0> { 2272 class LTypeofIsAndBranch: public LControlInstruction<1, 0> {
2103 public: 2273 public:
2104 explicit LTypeofIsAndBranch(LOperand* value) { 2274 explicit LTypeofIsAndBranch(LOperand* value) {
2105 inputs_[0] = value; 2275 inputs_[0] = value;
2106 } 2276 }
2107 2277
2278 LOperand* value() { return inputs_[0]; }
2279
2108 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") 2280 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch")
2109 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch) 2281 DECLARE_HYDROGEN_ACCESSOR(TypeofIsAndBranch)
2110 2282
2111 Handle<String> type_literal() { return hydrogen()->type_literal(); } 2283 Handle<String> type_literal() { return hydrogen()->type_literal(); }
2112 2284
2113 virtual void PrintDataTo(StringStream* stream); 2285 virtual void PrintDataTo(StringStream* stream);
2114 }; 2286 };
2115 2287
2116 2288
2117 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> { 2289 class LIsConstructCallAndBranch: public LControlInstruction<0, 1> {
2118 public: 2290 public:
2119 explicit LIsConstructCallAndBranch(LOperand* temp) { 2291 explicit LIsConstructCallAndBranch(LOperand* temp) {
2120 temps_[0] = temp; 2292 temps_[0] = temp;
2121 } 2293 }
2122 2294
2295 LOperand* temp() { return temps_[0]; }
2296
2123 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch, 2297 DECLARE_CONCRETE_INSTRUCTION(IsConstructCallAndBranch,
2124 "is-construct-call-and-branch") 2298 "is-construct-call-and-branch")
2125 DECLARE_HYDROGEN_ACCESSOR(IsConstructCallAndBranch) 2299 DECLARE_HYDROGEN_ACCESSOR(IsConstructCallAndBranch)
2126 }; 2300 };
2127 2301
2128 2302
2129 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> { 2303 class LDeleteProperty: public LTemplateInstruction<1, 2, 0> {
2130 public: 2304 public:
2131 LDeleteProperty(LOperand* obj, LOperand* key) { 2305 LDeleteProperty(LOperand* obj, LOperand* key) {
2132 inputs_[0] = obj; 2306 inputs_[0] = obj;
2133 inputs_[1] = key; 2307 inputs_[1] = key;
2134 } 2308 }
2135 2309
2136 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2137
2138 LOperand* object() { return inputs_[0]; } 2310 LOperand* object() { return inputs_[0]; }
2139 LOperand* key() { return inputs_[1]; } 2311 LOperand* key() { return inputs_[1]; }
2312
2313 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property")
2140 }; 2314 };
2141 2315
2142 2316
2143 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { 2317 class LOsrEntry: public LTemplateInstruction<0, 0, 0> {
2144 public: 2318 public:
2145 LOsrEntry(); 2319 LOsrEntry();
2146 2320
2147 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") 2321 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry")
2148 2322
2149 LOperand** SpilledRegisterArray() { return register_spills_; } 2323 LOperand** SpilledRegisterArray() { return register_spills_; }
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2398 2572
2399 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); 2573 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder);
2400 }; 2574 };
2401 2575
2402 #undef DECLARE_HYDROGEN_ACCESSOR 2576 #undef DECLARE_HYDROGEN_ACCESSOR
2403 #undef DECLARE_CONCRETE_INSTRUCTION 2577 #undef DECLARE_CONCRETE_INSTRUCTION
2404 2578
2405 } } // namespace v8::int 2579 } } // namespace v8::int
2406 2580
2407 #endif // V8_X64_LITHIUM_X64_H_ 2581 #endif // V8_X64_LITHIUM_X64_H_
OLDNEW
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | src/x64/lithium-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698