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

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

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

Powered by Google App Engine
This is Rietveld 408576698