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