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