Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 142 // LTaggedToI | 142 // LTaggedToI | 
| 143 // LThrow | 143 // LThrow | 
| 144 // LTypeof | 144 // LTypeof | 
| 145 // LTypeofIs | 145 // LTypeofIs | 
| 146 // LTypeofIsAndBranch | 146 // LTypeofIsAndBranch | 
| 147 // LUnaryMathOperation | 147 // LUnaryMathOperation | 
| 148 // LValueOf | 148 // LValueOf | 
| 149 // LUnknownOSRValue | 149 // LUnknownOSRValue | 
| 150 | 150 | 
| 151 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 151 #define LITHIUM_ALL_INSTRUCTION_LIST(V) \ | 
| 152 V(BinaryControlInstruction) \ | |
| 152 V(BinaryOperation) \ | 153 V(BinaryOperation) \ | 
| 153 V(Constant) \ | 154 V(Constant) \ | 
| 154 V(Call) \ | 155 V(Call) \ | 
| 155 V(MaterializedLiteral) \ | 156 V(MaterializedLiteral) \ | 
| 156 V(StoreKeyed) \ | 157 V(StoreKeyed) \ | 
| 157 V(StoreNamed) \ | 158 V(StoreNamed) \ | 
| 159 V(UnaryControlInstruction) \ | |
| 158 V(UnaryOperation) \ | 160 V(UnaryOperation) \ | 
| 159 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 161 LITHIUM_CONCRETE_INSTRUCTION_LIST(V) | 
| 160 | 162 | 
| 161 | 163 | 
| 162 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 164 #define LITHIUM_CONCRETE_INSTRUCTION_LIST(V) \ | 
| 163 V(AccessArgumentsAt) \ | 165 V(AccessArgumentsAt) \ | 
| 164 V(AddI) \ | 166 V(AddI) \ | 
| 165 V(ApplyArguments) \ | 167 V(ApplyArguments) \ | 
| 166 V(ArgumentsElements) \ | 168 V(ArgumentsElements) \ | 
| 167 V(ArgumentsLength) \ | 169 V(ArgumentsLength) \ | 
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 293 virtual void CompileToNative(LCodeGen* generator) = 0; | 295 virtual void CompileToNative(LCodeGen* generator) = 0; | 
| 294 virtual const char* Mnemonic() const = 0; | 296 virtual const char* Mnemonic() const = 0; | 
| 295 virtual void PrintTo(StringStream* stream); | 297 virtual void PrintTo(StringStream* stream); | 
| 296 virtual void PrintDataTo(StringStream* stream) = 0; | 298 virtual void PrintDataTo(StringStream* stream) = 0; | 
| 297 virtual void PrintOutputOperandTo(StringStream* stream) = 0; | 299 virtual void PrintOutputOperandTo(StringStream* stream) = 0; | 
| 298 | 300 | 
| 299 // Declare virtual type testers. | 301 // Declare virtual type testers. | 
| 300 #define DECLARE_DO(type) virtual bool Is##type() const { return false; } | 302 #define DECLARE_DO(type) virtual bool Is##type() const { return false; } | 
| 301 LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO) | 303 LITHIUM_ALL_INSTRUCTION_LIST(DECLARE_DO) | 
| 302 #undef DECLARE_DO | 304 #undef DECLARE_DO | 
| 305 | |
| 303 virtual bool IsControl() const { return false; } | 306 virtual bool IsControl() const { return false; } | 
| 307 virtual void SetBranchTargets(int true_block_id, int false_block_id) { } | |
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
Does this need to be on LInstruction?  I would exp
 
fschneider
2011/01/13 13:03:25
The problem is that I can't cast to a LControlInst
 
 | |
| 304 | 308 | 
| 305 void set_environment(LEnvironment* env) { environment_.set(env); } | 309 void set_environment(LEnvironment* env) { environment_.set(env); } | 
| 306 LEnvironment* environment() const { return environment_.get(); } | 310 LEnvironment* environment() const { return environment_.get(); } | 
| 307 bool HasEnvironment() const { return environment_.is_set(); } | 311 bool HasEnvironment() const { return environment_.is_set(); } | 
| 308 | 312 | 
| 309 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 313 void set_pointer_map(LPointerMap* p) { pointer_map_.set(p); } | 
| 310 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 314 LPointerMap* pointer_map() const { return pointer_map_.get(); } | 
| 311 bool HasPointerMap() const { return pointer_map_.is_set(); } | 315 bool HasPointerMap() const { return pointer_map_.is_set(); } | 
| 312 | 316 | 
| 313 virtual bool HasResult() const = 0; | 317 virtual bool HasResult() const = 0; | 
| (...skipping 19 matching lines...) Expand all Loading... | |
| 333 }; | 337 }; | 
| 334 | 338 | 
| 335 | 339 | 
| 336 template<typename T, int N> | 340 template<typename T, int N> | 
| 337 class OperandContainer { | 341 class OperandContainer { | 
| 338 public: | 342 public: | 
| 339 OperandContainer() { | 343 OperandContainer() { | 
| 340 for (int i = 0; i < N; i++) elems_[i] = NULL; | 344 for (int i = 0; i < N; i++) elems_[i] = NULL; | 
| 341 } | 345 } | 
| 342 int length() const { return N; } | 346 int length() const { return N; } | 
| 343 T at(int i) const { return elems_[i]; } | 347 T at(int i) const { return elems_[i]; } | 
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
This seems like a place that you could legitimatel
 
fschneider
2011/01/13 13:03:25
Done.
 
 | |
| 344 void set_at(int i, T value) { elems_[i] = value; } | 348 void set_at(int i, T value) { elems_[i] = value; } | 
| 349 void PrintOperandsTo(StringStream* stream); | |
| 345 private: | 350 private: | 
| 346 T elems_[N]; | 351 T elems_[N]; | 
| 347 }; | 352 }; | 
| 348 | 353 | 
| 349 | 354 | 
| 350 template<typename T> | 355 template<typename T> | 
| 351 class OperandContainer<T, 0> { | 356 class OperandContainer<T, 0> { | 
| 352 public: | 357 public: | 
| 353 int length() const { return 0; } | 358 int length() const { return 0; } | 
| 354 T at(int i) const { | 359 void PrintOperandsTo(StringStream* stream) { } | 
| 355 UNREACHABLE(); | |
| 356 return NULL; | |
| 357 } | |
| 358 void set_at(int i, T value) { | |
| 359 UNREACHABLE(); | |
| 360 } | |
| 361 }; | 360 }; | 
| 362 | 361 | 
| 363 | 362 | 
| 364 template<int R, int I, int T> | 363 template<int R, int I, int T> | 
| 365 class LTemplateInstruction: public LInstruction { | 364 class LTemplateInstruction: public LInstruction { | 
| 366 public: | 365 public: | 
| 367 // Allow 0 or 1 output operands. | 366 // Allow 0 or 1 output operands. | 
| 368 STATIC_ASSERT(R == 0 || R == 1); | 367 STATIC_ASSERT(R == 0 || R == 1); | 
| 369 virtual bool HasResult() const { return R != 0; } | 368 virtual bool HasResult() const { return R != 0; } | 
| 370 void set_result(LOperand* operand) { outputs_.set_at(0, operand); } | 369 void set_result(LOperand* operand) { outputs_.set_at(0, operand); } | 
| 371 LOperand* result() const { return outputs_.at(0); } | 370 LOperand* result() const { return outputs_.at(0); } | 
| 372 | 371 | 
| 373 int InputCount() const { return inputs_.length(); } | 372 int InputCount() const { return inputs_.length(); } | 
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
"return I" seems more direct.
 
fschneider
2011/01/13 13:03:25
Done.
 
 | |
| 374 LOperand* InputAt(int i) const { return inputs_.at(i); } | 373 LOperand* InputAt(int i) const { return inputs_.at(i); } | 
| 375 void SetInputAt(int i, LOperand* operand) { inputs_.set_at(i, operand); } | 374 void SetInputAt(int i, LOperand* operand) { inputs_.set_at(i, operand); } | 
| 376 | 375 | 
| 377 int TempCount() const { return temps_.length(); } | 376 int TempCount() const { return temps_.length(); } | 
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
"return T"?
 
fschneider
2011/01/13 13:03:25
Done.
 
 | |
| 378 LOperand* TempAt(int i) const { return temps_.at(i); } | 377 LOperand* TempAt(int i) const { return temps_.at(i); } | 
| 378 void SetTempAt(int i, LOperand* operand) { temps_.set_at(i, operand); } | |
| 379 | 379 | 
| 380 virtual void PrintDataTo(StringStream* stream); | 380 virtual void PrintDataTo(StringStream* stream); | 
| 381 virtual void PrintOutputOperandTo(StringStream* stream); | 381 virtual void PrintOutputOperandTo(StringStream* stream); | 
| 382 | 382 | 
| 383 private: | 383 private: | 
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
It also seems legitimate to make these protected s
 
fschneider
2011/01/13 13:03:25
Done.
 
 | |
| 384 OperandContainer<LOperand*, R> outputs_; | 384 OperandContainer<LOperand*, R> outputs_; | 
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
Perhaps outputs_ should be results_ (or R should b
 
fschneider
2011/01/13 13:03:25
Done.
 
 | |
| 385 OperandContainer<LOperand*, I> inputs_; | 385 OperandContainer<LOperand*, I> inputs_; | 
| 386 OperandContainer<LOperand*, T> temps_; | 386 OperandContainer<LOperand*, T> temps_; | 
| 387 }; | 387 }; | 
| 388 | 388 | 
| 389 | 389 | 
| 390 class LGap: public LTemplateInstruction<0, 0, 0> { | 390 class LGap: public LTemplateInstruction<0, 0, 0> { | 
| 391 public: | 391 public: | 
| 392 explicit LGap(HBasicBlock* block) | 392 explicit LGap(HBasicBlock* block) | 
| 393 : block_(block) { | 393 : block_(block) { | 
| 394 parallel_moves_[BEFORE] = NULL; | 394 parallel_moves_[BEFORE] = NULL; | 
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 506 } | 506 } | 
| 507 }; | 507 }; | 
| 508 | 508 | 
| 509 | 509 | 
| 510 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 510 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 
| 511 public: | 511 public: | 
| 512 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 512 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 
| 513 }; | 513 }; | 
| 514 | 514 | 
| 515 | 515 | 
| 516 template<int R> | 516 template<int R, int T = 0> | 
| 517 class LUnaryOperation: public LTemplateInstruction<R, 1, 0> { | 517 class LUnaryOperation: public LTemplateInstruction<R, 1, T> { | 
| 518 public: | 518 public: | 
| 519 explicit LUnaryOperation<R>(LOperand* input) { | 519 explicit LUnaryOperation(LOperand* input) { | 
| 520 this->SetInputAt(0, input); | 520 this->SetInputAt(0, input); | 
| 521 } | 521 } | 
| 522 | 522 | 
| 523 LOperand* input() const { return this->InputAt(0); } | 523 LOperand* input() const { return this->InputAt(0); } | 
| 524 | 524 | 
| 525 DECLARE_INSTRUCTION(UnaryOperation) | 525 DECLARE_INSTRUCTION(UnaryOperation) | 
| 526 }; | 526 }; | 
| 527 | 527 | 
| 528 | 528 | 
| 529 template<int R> | 529 template<int R, int T = 0> | 
| 
 
Kevin Millikin (Chromium)
2011/01/13 08:45:59
We should strongly consider getting rid of classes
 
fschneider
2011/01/13 13:03:25
Done.
 
 | |
| 530 class LBinaryOperation: public LTemplateInstruction<R, 2, 0> { | 530 class LBinaryOperation: public LTemplateInstruction<R, 2, T> { | 
| 531 public: | 531 public: | 
| 532 LBinaryOperation(LOperand* left, LOperand* right) { | 532 LBinaryOperation(LOperand* left, LOperand* right) { | 
| 533 this->SetInputAt(0, left); | 533 this->SetInputAt(0, left); | 
| 
 
Vitaly Repeshko
2011/01/13 11:44:07
We could have a convenience function SetInputs(inp
 
fschneider
2011/01/13 13:03:25
For this change I'd like to leave it more verbose
 
Vitaly Repeshko
2011/01/13 13:06:51
To implement this you define the function N times
 
 | |
| 534 this->SetInputAt(1, right); | 534 this->SetInputAt(1, right); | 
| 535 } | 535 } | 
| 536 | 536 | 
| 537 DECLARE_INSTRUCTION(BinaryOperation) | 537 DECLARE_INSTRUCTION(BinaryOperation) | 
| 538 | 538 | 
| 539 LOperand* left() const { return this->InputAt(0); } | 539 LOperand* left() const { return this->InputAt(0); } | 
| 540 LOperand* right() const { return this->InputAt(1); } | 540 LOperand* right() const { return this->InputAt(1); } | 
| 541 }; | 541 }; | 
| 542 | 542 | 
| 543 | 543 | 
| 544 template<int T = 0> | |
| 545 class LUnaryControlInstruction: public LUnaryOperation<0, T> { | |
| 546 public: | |
| 547 explicit LUnaryControlInstruction(LOperand* input) | |
| 548 : LUnaryOperation<0, T>(input), | |
| 549 true_block_id_(-1), | |
| 550 false_block_id_(-1) { } | |
| 551 | |
| 552 DECLARE_INSTRUCTION(UnaryControlInstruction) | |
| 553 virtual bool IsControl() const { return true; } | |
| 554 | |
| 555 int true_block_id() const { return true_block_id_; } | |
| 556 int false_block_id() const { return false_block_id_; } | |
| 557 void SetBranchTargets(int true_block_id, int false_block_id) { | |
| 558 true_block_id_ = true_block_id; | |
| 559 false_block_id_ = false_block_id; | |
| 560 } | |
| 561 | |
| 562 private: | |
| 563 int true_block_id_; | |
| 564 int false_block_id_; | |
| 565 }; | |
| 566 | |
| 567 | |
| 568 template<int T = 0> | |
| 569 class LBinaryControlInstruction: public LBinaryOperation<0, T> { | |
| 570 public: | |
| 571 LBinaryControlInstruction(LOperand* left, LOperand* right) | |
| 572 : LBinaryOperation<0, T>(left, right), | |
| 573 true_block_id_(-1), | |
| 574 false_block_id_(-1) { } | |
| 575 | |
| 576 DECLARE_INSTRUCTION(BinaryControlInstruction) | |
| 577 virtual bool IsControl() const { return true; } | |
| 578 | |
| 579 int true_block_id() const { return true_block_id_; } | |
| 580 int false_block_id() const { return false_block_id_; } | |
| 581 void SetBranchTargets(int true_block_id, int false_block_id) { | |
| 582 true_block_id_ = true_block_id; | |
| 583 false_block_id_ = false_block_id; | |
| 584 } | |
| 585 | |
| 586 private: | |
| 587 int true_block_id_; | |
| 588 int false_block_id_; | |
| 589 }; | |
| 590 | |
| 591 | |
| 544 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { | 592 class LApplyArguments: public LTemplateInstruction<1, 4, 0> { | 
| 545 public: | 593 public: | 
| 546 LApplyArguments(LOperand* function, | 594 LApplyArguments(LOperand* function, | 
| 547 LOperand* receiver, | 595 LOperand* receiver, | 
| 548 LOperand* length, | 596 LOperand* length, | 
| 549 LOperand* elements) { | 597 LOperand* elements) { | 
| 550 this->SetInputAt(0, function); | 598 this->SetInputAt(0, function); | 
| 551 this->SetInputAt(1, receiver); | 599 this->SetInputAt(1, receiver); | 
| 552 this->SetInputAt(2, length); | 600 this->SetInputAt(2, length); | 
| 553 this->SetInputAt(3, elements); | 601 this->SetInputAt(3, elements); | 
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 590 | 638 | 
| 591 | 639 | 
| 592 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { | 640 class LArgumentsElements: public LTemplateInstruction<1, 0, 0> { | 
| 593 public: | 641 public: | 
| 594 LArgumentsElements() { } | 642 LArgumentsElements() { } | 
| 595 | 643 | 
| 596 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") | 644 DECLARE_CONCRETE_INSTRUCTION(ArgumentsElements, "arguments-elements") | 
| 597 }; | 645 }; | 
| 598 | 646 | 
| 599 | 647 | 
| 600 class LModI: public LBinaryOperation<1> { | 648 class LModI: public LBinaryOperation<1, 1> { | 
| 601 public: | 649 public: | 
| 602 LModI(LOperand* left, LOperand* right) : LBinaryOperation<1>(left, right) { } | 650 LModI(LOperand* left, LOperand* right, LOperand* temp) | 
| 651 : LBinaryOperation<1, 1>(left, right) { | |
| 652 SetTempAt(0, temp); | |
| 653 } | |
| 603 | 654 | 
| 604 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") | 655 DECLARE_CONCRETE_INSTRUCTION(ModI, "mod-i") | 
| 605 DECLARE_HYDROGEN_ACCESSOR(Mod) | 656 DECLARE_HYDROGEN_ACCESSOR(Mod) | 
| 606 }; | 657 }; | 
| 607 | 658 | 
| 608 | 659 | 
| 609 class LDivI: public LBinaryOperation<1> { | 660 class LDivI: public LBinaryOperation<1, 1> { | 
| 610 public: | 661 public: | 
| 611 LDivI(LOperand* left, LOperand* right) | 662 LDivI(LOperand* left, LOperand* right, LOperand* temp) | 
| 612 : LBinaryOperation<1>(left, right) { } | 663 : LBinaryOperation<1, 1>(left, right) { | 
| 664 SetTempAt(0, temp); | |
| 665 } | |
| 613 | 666 | 
| 614 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 667 DECLARE_CONCRETE_INSTRUCTION(DivI, "div-i") | 
| 615 DECLARE_HYDROGEN_ACCESSOR(Div) | 668 DECLARE_HYDROGEN_ACCESSOR(Div) | 
| 616 }; | 669 }; | 
| 617 | 670 | 
| 618 | 671 | 
| 619 class LMulI: public LBinaryOperation<1> { | 672 class LMulI: public LBinaryOperation<1, 1> { | 
| 620 public: | 673 public: | 
| 621 LMulI(LOperand* left, LOperand* right, LOperand* temp) | 674 LMulI(LOperand* left, LOperand* right, LOperand* temp) | 
| 622 : LBinaryOperation<1>(left, right), temp_(temp) { } | 675 : LBinaryOperation<1, 1>(left, right) { | 
| 676 SetTempAt(0, temp); | |
| 677 } | |
| 623 | 678 | 
| 624 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") | 679 DECLARE_CONCRETE_INSTRUCTION(MulI, "mul-i") | 
| 625 DECLARE_HYDROGEN_ACCESSOR(Mul) | 680 DECLARE_HYDROGEN_ACCESSOR(Mul) | 
| 626 | |
| 627 LOperand* temp() const { return temp_; } | |
| 628 | |
| 629 private: | |
| 630 LOperand* temp_; | |
| 631 }; | 681 }; | 
| 632 | 682 | 
| 633 | 683 | 
| 634 class LCmpID: public LBinaryOperation<1> { | 684 class LCmpID: public LBinaryOperation<1> { | 
| 635 public: | 685 public: | 
| 636 LCmpID(LOperand* left, LOperand* right) | 686 LCmpID(LOperand* left, LOperand* right) | 
| 637 : LBinaryOperation<1>(left, right) { } | 687 : LBinaryOperation<1>(left, right) { } | 
| 638 | 688 | 
| 689 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") | |
| 690 DECLARE_HYDROGEN_ACCESSOR(Compare) | |
| 691 | |
| 692 Token::Value op() const { return hydrogen()->token(); } | |
| 693 bool is_double() const { | |
| 694 return hydrogen()->GetInputRepresentation().IsDouble(); | |
| 695 } | |
| 696 }; | |
| 697 | |
| 698 | |
| 699 class LCmpIDAndBranch: public LBinaryControlInstruction<> { | |
| 700 public: | |
| 701 LCmpIDAndBranch(LOperand* left, LOperand* right) | |
| 702 : LBinaryControlInstruction<>(left, right) { } | |
| 703 | |
| 704 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") | |
| 705 DECLARE_HYDROGEN_ACCESSOR(Compare) | |
| 706 | |
| 639 Token::Value op() const { return hydrogen()->token(); } | 707 Token::Value op() const { return hydrogen()->token(); } | 
| 640 bool is_double() const { | 708 bool is_double() const { | 
| 641 return hydrogen()->GetInputRepresentation().IsDouble(); | 709 return hydrogen()->GetInputRepresentation().IsDouble(); | 
| 642 } | 710 } | 
| 643 | 711 | 
| 644 DECLARE_CONCRETE_INSTRUCTION(CmpID, "cmp-id") | 712 virtual void PrintDataTo(StringStream* stream); | 
| 645 DECLARE_HYDROGEN_ACCESSOR(Compare) | |
| 646 }; | 713 }; | 
| 647 | 714 | 
| 648 | 715 | 
| 649 class LCmpIDAndBranch: public LCmpID { | |
| 650 public: | |
| 651 LCmpIDAndBranch(LOperand* left, | |
| 652 LOperand* right, | |
| 653 int true_block_id, | |
| 654 int false_block_id) | |
| 655 : LCmpID(left, right), | |
| 656 true_block_id_(true_block_id), | |
| 657 false_block_id_(false_block_id) { } | |
| 658 | |
| 659 DECLARE_CONCRETE_INSTRUCTION(CmpIDAndBranch, "cmp-id-and-branch") | |
| 660 virtual void PrintDataTo(StringStream* stream); | |
| 661 virtual bool IsControl() const { return true; } | |
| 662 | |
| 663 int true_block_id() const { return true_block_id_; } | |
| 664 int false_block_id() const { return false_block_id_; } | |
| 665 | |
| 666 private: | |
| 667 int true_block_id_; | |
| 668 int false_block_id_; | |
| 669 }; | |
| 670 | |
| 671 | |
| 672 class LUnaryMathOperation: public LUnaryOperation<1> { | 716 class LUnaryMathOperation: public LUnaryOperation<1> { | 
| 673 public: | 717 public: | 
| 674 explicit LUnaryMathOperation(LOperand* value) | 718 explicit LUnaryMathOperation(LOperand* value) | 
| 675 : LUnaryOperation<1>(value) { } | 719 : LUnaryOperation<1>(value) { } | 
| 676 | 720 | 
| 677 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 721 DECLARE_CONCRETE_INSTRUCTION(UnaryMathOperation, "unary-math-operation") | 
| 678 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 722 DECLARE_HYDROGEN_ACCESSOR(UnaryMathOperation) | 
| 679 | 723 | 
| 680 virtual void PrintDataTo(StringStream* stream); | 724 virtual void PrintDataTo(StringStream* stream); | 
| 681 BuiltinFunctionId op() const { return hydrogen()->op(); } | 725 BuiltinFunctionId op() const { return hydrogen()->op(); } | 
| 682 }; | 726 }; | 
| 683 | 727 | 
| 684 | 728 | 
| 685 class LCmpJSObjectEq: public LBinaryOperation<1> { | 729 class LCmpJSObjectEq: public LBinaryOperation<1> { | 
| 686 public: | 730 public: | 
| 687 LCmpJSObjectEq(LOperand* left, LOperand* right) | 731 LCmpJSObjectEq(LOperand* left, LOperand* right) | 
| 688 : LBinaryOperation<1>(left, right) {} | 732 : LBinaryOperation<1>(left, right) {} | 
| 689 | 733 | 
| 690 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") | 734 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEq, "cmp-jsobject-eq") | 
| 691 }; | 735 }; | 
| 692 | 736 | 
| 693 | 737 | 
| 694 class LCmpJSObjectEqAndBranch: public LCmpJSObjectEq { | 738 class LCmpJSObjectEqAndBranch: public LBinaryControlInstruction<> { | 
| 695 public: | 739 public: | 
| 696 LCmpJSObjectEqAndBranch(LOperand* left, | 740 LCmpJSObjectEqAndBranch(LOperand* left, LOperand* right) | 
| 697 LOperand* right, | 741 : LBinaryControlInstruction<>(left, right) { } | 
| 698 int true_block_id, | |
| 699 int false_block_id) | |
| 700 : LCmpJSObjectEq(left, right), | |
| 701 true_block_id_(true_block_id), | |
| 702 false_block_id_(false_block_id) { } | |
| 703 | 742 | 
| 704 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, | 743 DECLARE_CONCRETE_INSTRUCTION(CmpJSObjectEqAndBranch, | 
| 705 "cmp-jsobject-eq-and-branch") | 744 "cmp-jsobject-eq-and-branch") | 
| 706 | |
| 707 int true_block_id() const { return true_block_id_; } | |
| 708 int false_block_id() const { return false_block_id_; } | |
| 709 | |
| 710 private: | |
| 711 int true_block_id_; | |
| 712 int false_block_id_; | |
| 713 }; | 745 }; | 
| 714 | 746 | 
| 715 | 747 | 
| 716 class LIsNull: public LUnaryOperation<1> { | 748 class LIsNull: public LUnaryOperation<1> { | 
| 717 public: | 749 public: | 
| 718 explicit LIsNull(LOperand* value) : LUnaryOperation<1>(value) { } | 750 explicit LIsNull(LOperand* value) : LUnaryOperation<1>(value) { } | 
| 719 | 751 | 
| 720 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") | 752 DECLARE_CONCRETE_INSTRUCTION(IsNull, "is-null") | 
| 721 DECLARE_HYDROGEN_ACCESSOR(IsNull) | 753 DECLARE_HYDROGEN_ACCESSOR(IsNull) | 
| 722 | 754 | 
| 723 bool is_strict() const { return hydrogen()->is_strict(); } | 755 bool is_strict() const { return hydrogen()->is_strict(); } | 
| 724 }; | 756 }; | 
| 725 | 757 | 
| 726 | 758 | 
| 727 class LIsNullAndBranch: public LIsNull { | 759 class LIsNullAndBranch: public LUnaryControlInstruction<1> { | 
| 728 public: | 760 public: | 
| 729 LIsNullAndBranch(LOperand* value, | 761 LIsNullAndBranch(LOperand* value, LOperand* temp) | 
| 730 LOperand* temp, | 762 : LUnaryControlInstruction<1>(value) { | 
| 731 int true_block_id, | 763 SetTempAt(0, temp); | 
| 732 int false_block_id) | 764 } | 
| 733 : LIsNull(value), | |
| 734 temp_(temp), | |
| 735 true_block_id_(true_block_id), | |
| 736 false_block_id_(false_block_id) { } | |
| 737 | 765 | 
| 738 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") | 766 DECLARE_CONCRETE_INSTRUCTION(IsNullAndBranch, "is-null-and-branch") | 
| 767 DECLARE_HYDROGEN_ACCESSOR(IsNull) | |
| 768 | |
| 769 bool is_strict() const { return hydrogen()->is_strict(); } | |
| 770 | |
| 739 virtual void PrintDataTo(StringStream* stream); | 771 virtual void PrintDataTo(StringStream* stream); | 
| 740 virtual bool IsControl() const { return true; } | |
| 741 | |
| 742 int true_block_id() const { return true_block_id_; } | |
| 743 int false_block_id() const { return false_block_id_; } | |
| 744 | |
| 745 LOperand* temp() const { return temp_; } | |
| 746 | |
| 747 private: | |
| 748 LOperand* temp_; | |
| 749 int true_block_id_; | |
| 750 int false_block_id_; | |
| 751 }; | 772 }; | 
| 752 | 773 | 
| 753 | 774 | 
| 754 class LIsObject: public LUnaryOperation<1> { | 775 class LIsObject: public LUnaryOperation<1, 1> { | 
| 755 public: | 776 public: | 
| 756 LIsObject(LOperand* value, LOperand* temp) | 777 LIsObject(LOperand* value, LOperand* temp) | 
| 757 : LUnaryOperation<1>(value), temp_(temp) {} | 778 : LUnaryOperation<1, 1>(value) { | 
| 779 SetTempAt(0, temp); | |
| 780 } | |
| 758 | 781 | 
| 759 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object") | 782 DECLARE_CONCRETE_INSTRUCTION(IsObject, "is-object") | 
| 760 | |
| 761 LOperand* temp() const { return temp_; } | |
| 762 | |
| 763 private: | |
| 764 LOperand* temp_; | |
| 765 }; | 783 }; | 
| 766 | 784 | 
| 767 | 785 | 
| 768 class LIsObjectAndBranch: public LIsObject { | 786 class LIsObjectAndBranch: public LUnaryControlInstruction<2> { | 
| 769 public: | 787 public: | 
| 770 LIsObjectAndBranch(LOperand* value, | 788 LIsObjectAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) | 
| 771 LOperand* temp, | 789 : LUnaryControlInstruction<2>(value) { | 
| 772 LOperand* temp2, | 790 SetTempAt(0, temp); | 
| 773 int true_block_id, | 791 SetTempAt(1, temp2); | 
| 774 int false_block_id) | 792 } | 
| 775 : LIsObject(value, temp), | |
| 776 temp2_(temp2), | |
| 777 true_block_id_(true_block_id), | |
| 778 false_block_id_(false_block_id) { } | |
| 779 | 793 | 
| 780 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") | 794 DECLARE_CONCRETE_INSTRUCTION(IsObjectAndBranch, "is-object-and-branch") | 
| 795 | |
| 781 virtual void PrintDataTo(StringStream* stream); | 796 virtual void PrintDataTo(StringStream* stream); | 
| 782 virtual bool IsControl() const { return true; } | |
| 783 | |
| 784 int true_block_id() const { return true_block_id_; } | |
| 785 int false_block_id() const { return false_block_id_; } | |
| 786 | |
| 787 LOperand* temp2() const { return temp2_; } | |
| 788 | |
| 789 private: | |
| 790 LOperand* temp2_; | |
| 791 int true_block_id_; | |
| 792 int false_block_id_; | |
| 793 }; | 797 }; | 
| 794 | 798 | 
| 795 | 799 | 
| 796 class LIsSmi: public LUnaryOperation<1> { | 800 class LIsSmi: public LUnaryOperation<1> { | 
| 797 public: | 801 public: | 
| 798 explicit LIsSmi(LOperand* value) : LUnaryOperation<1>(value) {} | 802 explicit LIsSmi(LOperand* value) : LUnaryOperation<1>(value) {} | 
| 799 | 803 | 
| 800 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") | 804 DECLARE_CONCRETE_INSTRUCTION(IsSmi, "is-smi") | 
| 801 DECLARE_HYDROGEN_ACCESSOR(IsSmi) | 805 DECLARE_HYDROGEN_ACCESSOR(IsSmi) | 
| 802 }; | 806 }; | 
| 803 | 807 | 
| 804 | 808 | 
| 805 class LIsSmiAndBranch: public LIsSmi { | 809 class LIsSmiAndBranch: public LUnaryControlInstruction<> { | 
| 806 public: | 810 public: | 
| 807 LIsSmiAndBranch(LOperand* value, | 811 explicit LIsSmiAndBranch(LOperand* value) | 
| 808 int true_block_id, | 812 : LUnaryControlInstruction<>(value) { } | 
| 809 int false_block_id) | |
| 810 : LIsSmi(value), | |
| 811 true_block_id_(true_block_id), | |
| 812 false_block_id_(false_block_id) { } | |
| 813 | 813 | 
| 814 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 814 DECLARE_CONCRETE_INSTRUCTION(IsSmiAndBranch, "is-smi-and-branch") | 
| 815 | |
| 815 virtual void PrintDataTo(StringStream* stream); | 816 virtual void PrintDataTo(StringStream* stream); | 
| 816 virtual bool IsControl() const { return true; } | |
| 817 | |
| 818 int true_block_id() const { return true_block_id_; } | |
| 819 int false_block_id() const { return false_block_id_; } | |
| 820 | |
| 821 private: | |
| 822 int true_block_id_; | |
| 823 int false_block_id_; | |
| 824 }; | 817 }; | 
| 825 | 818 | 
| 826 | 819 | 
| 827 class LHasInstanceType: public LUnaryOperation<1> { | 820 class LHasInstanceType: public LUnaryOperation<1> { | 
| 828 public: | 821 public: | 
| 829 explicit LHasInstanceType(LOperand* value) | 822 explicit LHasInstanceType(LOperand* value) | 
| 830 : LUnaryOperation<1>(value) { } | 823 : LUnaryOperation<1>(value) { } | 
| 831 | 824 | 
| 832 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") | 825 DECLARE_CONCRETE_INSTRUCTION(HasInstanceType, "has-instance-type") | 
| 833 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 826 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | 
| 834 | |
| 835 InstanceType TestType(); // The type to test against when generating code. | |
| 836 Condition BranchCondition(); // The branch condition for 'true'. | |
| 837 }; | 827 }; | 
| 838 | 828 | 
| 839 | 829 | 
| 840 class LHasInstanceTypeAndBranch: public LHasInstanceType { | 830 class LHasInstanceTypeAndBranch: public LUnaryControlInstruction<1> { | 
| 841 public: | 831 public: | 
| 842 LHasInstanceTypeAndBranch(LOperand* value, | 832 LHasInstanceTypeAndBranch(LOperand* value, LOperand* temp) | 
| 843 LOperand* temporary, | 833 : LUnaryControlInstruction<1>(value) { | 
| 844 int true_block_id, | 834 SetTempAt(0, temp); | 
| 845 int false_block_id) | 835 } | 
| 846 : LHasInstanceType(value), | |
| 847 temp_(temporary), | |
| 848 true_block_id_(true_block_id), | |
| 849 false_block_id_(false_block_id) { } | |
| 850 | 836 | 
| 851 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 837 DECLARE_CONCRETE_INSTRUCTION(HasInstanceTypeAndBranch, | 
| 852 "has-instance-type-and-branch") | 838 "has-instance-type-and-branch") | 
| 839 DECLARE_HYDROGEN_ACCESSOR(HasInstanceType) | |
| 840 | |
| 853 virtual void PrintDataTo(StringStream* stream); | 841 virtual void PrintDataTo(StringStream* stream); | 
| 854 virtual bool IsControl() const { return true; } | |
| 855 | |
| 856 int true_block_id() const { return true_block_id_; } | |
| 857 int false_block_id() const { return false_block_id_; } | |
| 858 | |
| 859 LOperand* temp() { return temp_; } | |
| 860 | |
| 861 private: | |
| 862 LOperand* temp_; | |
| 863 int true_block_id_; | |
| 864 int false_block_id_; | |
| 865 }; | 842 }; | 
| 866 | 843 | 
| 867 | 844 | 
| 868 class LHasCachedArrayIndex: public LUnaryOperation<1> { | 845 class LHasCachedArrayIndex: public LUnaryOperation<1> { | 
| 869 public: | 846 public: | 
| 870 explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation<1>(value) {} | 847 explicit LHasCachedArrayIndex(LOperand* value) : LUnaryOperation<1>(value) {} | 
| 871 | 848 | 
| 872 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") | 849 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndex, "has-cached-array-index") | 
| 873 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) | 850 DECLARE_HYDROGEN_ACCESSOR(HasCachedArrayIndex) | 
| 874 }; | 851 }; | 
| 875 | 852 | 
| 876 | 853 | 
| 877 class LHasCachedArrayIndexAndBranch: public LHasCachedArrayIndex { | 854 class LHasCachedArrayIndexAndBranch: public LUnaryControlInstruction<> { | 
| 878 public: | 855 public: | 
| 879 LHasCachedArrayIndexAndBranch(LOperand* value, | 856 explicit LHasCachedArrayIndexAndBranch(LOperand* value) | 
| 880 int true_block_id, | 857 : LUnaryControlInstruction<>(value) { } | 
| 881 int false_block_id) | |
| 882 : LHasCachedArrayIndex(value), | |
| 883 true_block_id_(true_block_id), | |
| 884 false_block_id_(false_block_id) { } | |
| 885 | 858 | 
| 886 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 859 DECLARE_CONCRETE_INSTRUCTION(HasCachedArrayIndexAndBranch, | 
| 887 "has-cached-array-index-and-branch") | 860 "has-cached-array-index-and-branch") | 
| 888 virtual void PrintDataTo(StringStream* stream); | 861 virtual void PrintDataTo(StringStream* stream); | 
| 889 virtual bool IsControl() const { return true; } | |
| 890 | |
| 891 int true_block_id() const { return true_block_id_; } | |
| 892 int false_block_id() const { return false_block_id_; } | |
| 893 | |
| 894 private: | |
| 895 int true_block_id_; | |
| 896 int false_block_id_; | |
| 897 }; | 862 }; | 
| 898 | 863 | 
| 899 | 864 | 
| 900 class LClassOfTest: public LUnaryOperation<1> { | 865 class LClassOfTest: public LUnaryOperation<1, 1> { | 
| 901 public: | 866 public: | 
| 902 LClassOfTest(LOperand* value, LOperand* temp) | 867 LClassOfTest(LOperand* value, LOperand* temp) : LUnaryOperation<1, 1>(value) { | 
| 903 : LUnaryOperation<1>(value), temporary_(temp) {} | 868 SetTempAt(0, temp); | 
| 869 } | |
| 904 | 870 | 
| 905 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") | 871 DECLARE_CONCRETE_INSTRUCTION(ClassOfTest, "class-of-test") | 
| 906 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | 872 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | 
| 907 | 873 | 
| 908 virtual void PrintDataTo(StringStream* stream); | 874 virtual void PrintDataTo(StringStream* stream); | 
| 909 | |
| 910 LOperand* temporary() { return temporary_; } | |
| 911 | |
| 912 private: | |
| 913 LOperand* temporary_; | |
| 914 }; | 875 }; | 
| 915 | 876 | 
| 916 | 877 | 
| 917 class LClassOfTestAndBranch: public LClassOfTest { | 878 class LClassOfTestAndBranch: public LUnaryControlInstruction<2> { | 
| 918 public: | 879 public: | 
| 919 LClassOfTestAndBranch(LOperand* value, | 880 LClassOfTestAndBranch(LOperand* value, LOperand* temp, LOperand* temp2) | 
| 920 LOperand* temporary, | 881 : LUnaryControlInstruction<2>(value) { | 
| 921 LOperand* temporary2, | 882 SetTempAt(0, temp); | 
| 922 int true_block_id, | 883 SetTempAt(1, temp2); | 
| 923 int false_block_id) | 884 } | 
| 924 : LClassOfTest(value, temporary), | |
| 925 temporary2_(temporary2), | |
| 926 true_block_id_(true_block_id), | |
| 927 false_block_id_(false_block_id) { } | |
| 928 | 885 | 
| 929 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 886 DECLARE_CONCRETE_INSTRUCTION(ClassOfTestAndBranch, | 
| 930 "class-of-test-and-branch") | 887 "class-of-test-and-branch") | 
| 888 DECLARE_HYDROGEN_ACCESSOR(ClassOfTest) | |
| 889 | |
| 931 virtual void PrintDataTo(StringStream* stream); | 890 virtual void PrintDataTo(StringStream* stream); | 
| 932 virtual bool IsControl() const { return true; } | |
| 933 | |
| 934 int true_block_id() const { return true_block_id_; } | |
| 935 int false_block_id() const { return false_block_id_; } | |
| 936 LOperand* temporary2() { return temporary2_; } | |
| 937 | |
| 938 private: | |
| 939 LOperand* temporary2_; | |
| 940 int true_block_id_; | |
| 941 int false_block_id_; | |
| 942 }; | 891 }; | 
| 943 | 892 | 
| 944 | 893 | 
| 945 class LCmpT: public LBinaryOperation<1> { | 894 class LCmpT: public LBinaryOperation<1> { | 
| 946 public: | 895 public: | 
| 947 LCmpT(LOperand* left, LOperand* right) : LBinaryOperation<1>(left, right) {} | 896 LCmpT(LOperand* left, LOperand* right) : LBinaryOperation<1>(left, right) {} | 
| 948 | 897 | 
| 949 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 898 DECLARE_CONCRETE_INSTRUCTION(CmpT, "cmp-t") | 
| 950 DECLARE_HYDROGEN_ACCESSOR(Compare) | 899 DECLARE_HYDROGEN_ACCESSOR(Compare) | 
| 951 | 900 | 
| 952 Token::Value op() const { return hydrogen()->token(); } | 901 Token::Value op() const { return hydrogen()->token(); } | 
| 953 }; | 902 }; | 
| 954 | 903 | 
| 955 | 904 | 
| 956 class LCmpTAndBranch: public LCmpT { | 905 class LCmpTAndBranch: public LBinaryControlInstruction<> { | 
| 957 public: | 906 public: | 
| 958 LCmpTAndBranch(LOperand* left, | 907 LCmpTAndBranch(LOperand* left, LOperand* right) | 
| 959 LOperand* right, | 908 : LBinaryControlInstruction<>(left, right) { } | 
| 960 int true_block_id, | |
| 961 int false_block_id) | |
| 962 : LCmpT(left, right), | |
| 963 true_block_id_(true_block_id), | |
| 964 false_block_id_(false_block_id) { } | |
| 965 | 909 | 
| 966 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") | 910 DECLARE_CONCRETE_INSTRUCTION(CmpTAndBranch, "cmp-t-and-branch") | 
| 911 DECLARE_HYDROGEN_ACCESSOR(Compare) | |
| 967 | 912 | 
| 968 int true_block_id() const { return true_block_id_; } | 913 Token::Value op() const { return hydrogen()->token(); } | 
| 969 int false_block_id() const { return false_block_id_; } | |
| 970 | |
| 971 private: | |
| 972 int true_block_id_; | |
| 973 int false_block_id_; | |
| 974 }; | 914 }; | 
| 975 | 915 | 
| 976 | 916 | 
| 977 class LInstanceOf: public LBinaryOperation<1> { | 917 class LInstanceOf: public LBinaryOperation<1> { | 
| 978 public: | 918 public: | 
| 979 LInstanceOf(LOperand* left, LOperand* right) | 919 LInstanceOf(LOperand* left, LOperand* right) | 
| 980 : LBinaryOperation<1>(left, right) { } | 920 : LBinaryOperation<1>(left, right) { } | 
| 981 | 921 | 
| 982 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 922 DECLARE_CONCRETE_INSTRUCTION(InstanceOf, "instance-of") | 
| 983 }; | 923 }; | 
| 984 | 924 | 
| 985 | 925 | 
| 986 class LInstanceOfAndBranch: public LInstanceOf { | 926 class LInstanceOfAndBranch: public LBinaryControlInstruction<> { | 
| 987 public: | 927 public: | 
| 988 LInstanceOfAndBranch(LOperand* left, | 928 LInstanceOfAndBranch(LOperand* left, LOperand* right) | 
| 989 LOperand* right, | 929 : LBinaryControlInstruction<>(left, right) { } | 
| 990 int true_block_id, | |
| 991 int false_block_id) | |
| 992 : LInstanceOf(left, right), | |
| 993 true_block_id_(true_block_id), | |
| 994 false_block_id_(false_block_id) { } | |
| 995 | 930 | 
| 996 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") | 931 DECLARE_CONCRETE_INSTRUCTION(InstanceOfAndBranch, "instance-of-and-branch") | 
| 997 | |
| 998 int true_block_id() const { return true_block_id_; } | |
| 999 int false_block_id() const { return false_block_id_; } | |
| 1000 | |
| 1001 private: | |
| 1002 int true_block_id_; | |
| 1003 int false_block_id_; | |
| 1004 }; | 932 }; | 
| 1005 | 933 | 
| 1006 | 934 | 
| 1007 class LInstanceOfKnownGlobal: public LUnaryOperation<1> { | 935 class LInstanceOfKnownGlobal: public LUnaryOperation<1, 1> { | 
| 1008 public: | 936 public: | 
| 1009 LInstanceOfKnownGlobal(LOperand* left, LOperand* temp) | 937 LInstanceOfKnownGlobal(LOperand* left, LOperand* temp) | 
| 1010 : LUnaryOperation<1>(left), temp_(temp) { } | 938 : LUnaryOperation<1, 1>(left) { | 
| 939 SetTempAt(0, temp); | |
| 940 } | |
| 1011 | 941 | 
| 1012 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 942 DECLARE_CONCRETE_INSTRUCTION(InstanceOfKnownGlobal, | 
| 1013 "instance-of-known-global") | 943 "instance-of-known-global") | 
| 1014 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) | 944 DECLARE_HYDROGEN_ACCESSOR(InstanceOfKnownGlobal) | 
| 1015 | 945 | 
| 1016 Handle<JSFunction> function() const { return hydrogen()->function(); } | 946 Handle<JSFunction> function() const { return hydrogen()->function(); } | 
| 1017 LOperand* temp() const { return temp_; } | |
| 1018 | |
| 1019 private: | |
| 1020 LOperand* temp_; | |
| 1021 }; | 947 }; | 
| 1022 | 948 | 
| 1023 | 949 | 
| 1024 class LBoundsCheck: public LBinaryOperation<0> { | 950 class LBoundsCheck: public LBinaryOperation<0> { | 
| 1025 public: | 951 public: | 
| 1026 LBoundsCheck(LOperand* index, LOperand* length) | 952 LBoundsCheck(LOperand* index, LOperand* length) | 
| 1027 : LBinaryOperation<0>(index, length) { } | 953 : LBinaryOperation<0>(index, length) { } | 
| 1028 | 954 | 
| 1029 LOperand* index() const { return left(); } | 955 LOperand* index() const { return left(); } | 
| 1030 LOperand* length() const { return right(); } | 956 LOperand* length() const { return right(); } | 
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1108 explicit LConstantT(Handle<Object> value) : value_(value) { } | 1034 explicit LConstantT(Handle<Object> value) : value_(value) { } | 
| 1109 Handle<Object> value() const { return value_; } | 1035 Handle<Object> value() const { return value_; } | 
| 1110 | 1036 | 
| 1111 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 1037 DECLARE_CONCRETE_INSTRUCTION(ConstantT, "constant-t") | 
| 1112 | 1038 | 
| 1113 private: | 1039 private: | 
| 1114 Handle<Object> value_; | 1040 Handle<Object> value_; | 
| 1115 }; | 1041 }; | 
| 1116 | 1042 | 
| 1117 | 1043 | 
| 1118 class LBranch: public LUnaryOperation<0> { | 1044 class LBranch: public LUnaryControlInstruction<> { | 
| 1119 public: | 1045 public: | 
| 1120 LBranch(LOperand* input, int true_block_id, int false_block_id) | 1046 explicit LBranch(LOperand* input) : LUnaryControlInstruction<>(input) { } | 
| 1121 : LUnaryOperation<0>(input), | |
| 1122 true_block_id_(true_block_id), | |
| 1123 false_block_id_(false_block_id) { } | |
| 1124 | 1047 | 
| 1125 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 1048 DECLARE_CONCRETE_INSTRUCTION(Branch, "branch") | 
| 1126 DECLARE_HYDROGEN_ACCESSOR(Value) | 1049 DECLARE_HYDROGEN_ACCESSOR(Value) | 
| 1127 | 1050 | 
| 1128 virtual void PrintDataTo(StringStream* stream); | 1051 virtual void PrintDataTo(StringStream* stream); | 
| 1129 virtual bool IsControl() const { return true; } | |
| 1130 | |
| 1131 int true_block_id() const { return true_block_id_; } | |
| 1132 int false_block_id() const { return false_block_id_; } | |
| 1133 | |
| 1134 private: | |
| 1135 int true_block_id_; | |
| 1136 int false_block_id_; | |
| 1137 }; | 1052 }; | 
| 1138 | 1053 | 
| 1139 | 1054 | 
| 1140 class LCmpMapAndBranch: public LUnaryOperation<0> { | 1055 class LCmpMapAndBranch: public LUnaryOperation<0> { | 
| 1141 public: | 1056 public: | 
| 1142 explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation<0>(value) { } | 1057 explicit LCmpMapAndBranch(LOperand* value) : LUnaryOperation<0>(value) { } | 
| 1143 | 1058 | 
| 1144 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 1059 DECLARE_CONCRETE_INSTRUCTION(CmpMapAndBranch, "cmp-map-and-branch") | 
| 1145 DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch) | 1060 DECLARE_HYDROGEN_ACCESSOR(CompareMapAndBranch) | 
| 1146 | 1061 | 
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1167 | 1082 | 
| 1168 class LFixedArrayLength: public LUnaryOperation<1> { | 1083 class LFixedArrayLength: public LUnaryOperation<1> { | 
| 1169 public: | 1084 public: | 
| 1170 explicit LFixedArrayLength(LOperand* input) : LUnaryOperation<1>(input) { } | 1085 explicit LFixedArrayLength(LOperand* input) : LUnaryOperation<1>(input) { } | 
| 1171 | 1086 | 
| 1172 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") | 1087 DECLARE_CONCRETE_INSTRUCTION(FixedArrayLength, "fixed-array-length") | 
| 1173 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) | 1088 DECLARE_HYDROGEN_ACCESSOR(FixedArrayLength) | 
| 1174 }; | 1089 }; | 
| 1175 | 1090 | 
| 1176 | 1091 | 
| 1177 class LValueOf: public LUnaryOperation<1> { | 1092 class LValueOf: public LUnaryOperation<1, 1> { | 
| 1178 public: | 1093 public: | 
| 1179 LValueOf(LOperand* input, LOperand* temporary) | 1094 LValueOf(LOperand* input, LOperand* temp) | 
| 1180 : LUnaryOperation<1>(input), temporary_(temporary) { } | 1095 : LUnaryOperation<1, 1>(input) { | 
| 1181 | 1096 SetTempAt(0, temp); | 
| 1182 LOperand* temporary() const { return temporary_; } | 1097 } | 
| 1183 | 1098 | 
| 1184 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") | 1099 DECLARE_CONCRETE_INSTRUCTION(ValueOf, "value-of") | 
| 1185 DECLARE_HYDROGEN_ACCESSOR(ValueOf) | 1100 DECLARE_HYDROGEN_ACCESSOR(ValueOf) | 
| 1186 | |
| 1187 private: | |
| 1188 LOperand* temporary_; | |
| 1189 }; | 1101 }; | 
| 1190 | 1102 | 
| 1191 | 1103 | 
| 1192 class LThrow: public LUnaryOperation<1> { | 1104 class LThrow: public LUnaryOperation<1> { | 
| 1193 public: | 1105 public: | 
| 1194 explicit LThrow(LOperand* value) : LUnaryOperation<1>(value) { } | 1106 explicit LThrow(LOperand* value) : LUnaryOperation<1>(value) { } | 
| 1195 | 1107 | 
| 1196 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") | 1108 DECLARE_CONCRETE_INSTRUCTION(Throw, "throw") | 
| 1197 }; | 1109 }; | 
| 1198 | 1110 | 
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1277 explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation<1>(object) { } | 1189 explicit LLoadNamedGeneric(LOperand* object) : LUnaryOperation<1>(object) { } | 
| 1278 | 1190 | 
| 1279 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 1191 DECLARE_CONCRETE_INSTRUCTION(LoadNamedGeneric, "load-named-generic") | 
| 1280 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 1192 DECLARE_HYDROGEN_ACCESSOR(LoadNamedGeneric) | 
| 1281 | 1193 | 
| 1282 LOperand* object() const { return input(); } | 1194 LOperand* object() const { return input(); } | 
| 1283 Handle<Object> name() const { return hydrogen()->name(); } | 1195 Handle<Object> name() const { return hydrogen()->name(); } | 
| 1284 }; | 1196 }; | 
| 1285 | 1197 | 
| 1286 | 1198 | 
| 1287 class LLoadFunctionPrototype: public LUnaryOperation<1> { | 1199 class LLoadFunctionPrototype: public LUnaryOperation<1, 1> { | 
| 1288 public: | 1200 public: | 
| 1289 LLoadFunctionPrototype(LOperand* function, LOperand* temporary) | 1201 LLoadFunctionPrototype(LOperand* function, LOperand* temp) | 
| 1290 : LUnaryOperation<1>(function), temporary_(temporary) { } | 1202 : LUnaryOperation<1, 1>(function) { | 
| 1203 SetTempAt(0, temp); | |
| 1204 } | |
| 1291 | 1205 | 
| 1292 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 1206 DECLARE_CONCRETE_INSTRUCTION(LoadFunctionPrototype, "load-function-prototype") | 
| 1293 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 1207 DECLARE_HYDROGEN_ACCESSOR(LoadFunctionPrototype) | 
| 1294 | 1208 | 
| 1295 LOperand* function() const { return input(); } | 1209 LOperand* function() const { return input(); } | 
| 1296 LOperand* temporary() const { return temporary_; } | |
| 1297 | |
| 1298 private: | |
| 1299 LOperand* temporary_; | |
| 1300 }; | 1210 }; | 
| 1301 | 1211 | 
| 1302 | 1212 | 
| 1303 class LLoadElements: public LUnaryOperation<1> { | 1213 class LLoadElements: public LUnaryOperation<1> { | 
| 1304 public: | 1214 public: | 
| 1305 explicit LLoadElements(LOperand* obj) : LUnaryOperation<1>(obj) { } | 1215 explicit LLoadElements(LOperand* obj) : LUnaryOperation<1>(obj) { } | 
| 1306 | 1216 | 
| 1307 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") | 1217 DECLARE_CONCRETE_INSTRUCTION(LoadElements, "load-elements") | 
| 1308 }; | 1218 }; | 
| 1309 | 1219 | 
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1374 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") | 1284 DECLARE_CONCRETE_INSTRUCTION(CallConstantFunction, "call-constant-function") | 
| 1375 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) | 1285 DECLARE_HYDROGEN_ACCESSOR(CallConstantFunction) | 
| 1376 | 1286 | 
| 1377 virtual void PrintDataTo(StringStream* stream); | 1287 virtual void PrintDataTo(StringStream* stream); | 
| 1378 | 1288 | 
| 1379 Handle<JSFunction> function() { return hydrogen()->function(); } | 1289 Handle<JSFunction> function() { return hydrogen()->function(); } | 
| 1380 int arity() const { return hydrogen()->argument_count() - 1; } | 1290 int arity() const { return hydrogen()->argument_count() - 1; } | 
| 1381 }; | 1291 }; | 
| 1382 | 1292 | 
| 1383 | 1293 | 
| 1384 class LCallKeyed: public LTemplateInstruction<1, 0, 0> { | 1294 class LCallKeyed: public LTemplateInstruction<1, 0, 1> { | 
| 1385 public: | 1295 public: | 
| 1296 explicit LCallKeyed(LOperand* temp) { | |
| 1297 SetTempAt(0, temp); | |
| 1298 } | |
| 1299 | |
| 1386 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") | 1300 DECLARE_CONCRETE_INSTRUCTION(CallKeyed, "call-keyed") | 
| 1387 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) | 1301 DECLARE_HYDROGEN_ACCESSOR(CallKeyed) | 
| 1388 | 1302 | 
| 1389 virtual void PrintDataTo(StringStream* stream); | 1303 virtual void PrintDataTo(StringStream* stream); | 
| 1390 | 1304 | 
| 1391 int arity() const { return hydrogen()->argument_count() - 1; } | 1305 int arity() const { return hydrogen()->argument_count() - 1; } | 
| 1392 }; | 1306 }; | 
| 1393 | 1307 | 
| 1394 | 1308 | 
| 1395 class LCallNamed: public LTemplateInstruction<1, 0, 0> { | 1309 class LCallNamed: public LTemplateInstruction<1, 0, 0> { | 
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1469 | 1383 | 
| 1470 | 1384 | 
| 1471 class LNumberTagI: public LUnaryOperation<1> { | 1385 class LNumberTagI: public LUnaryOperation<1> { | 
| 1472 public: | 1386 public: | 
| 1473 explicit LNumberTagI(LOperand* use) : LUnaryOperation<1>(use) { } | 1387 explicit LNumberTagI(LOperand* use) : LUnaryOperation<1>(use) { } | 
| 1474 | 1388 | 
| 1475 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 1389 DECLARE_CONCRETE_INSTRUCTION(NumberTagI, "number-tag-i") | 
| 1476 }; | 1390 }; | 
| 1477 | 1391 | 
| 1478 | 1392 | 
| 1479 class LNumberTagD: public LUnaryOperation<1> { | 1393 class LNumberTagD: public LUnaryOperation<1, 1> { | 
| 1480 public: | 1394 public: | 
| 1481 explicit LNumberTagD(LOperand* value, LOperand* temp) | 1395 explicit LNumberTagD(LOperand* value, LOperand* temp) | 
| 1482 : LUnaryOperation<1>(value), temp_(temp) { } | 1396 : LUnaryOperation<1, 1>(value) { | 
| 1397 SetTempAt(0, temp); | |
| 1398 } | |
| 1483 | 1399 | 
| 1484 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 1400 DECLARE_CONCRETE_INSTRUCTION(NumberTagD, "number-tag-d") | 
| 1485 | |
| 1486 LOperand* temp() const { return temp_; } | |
| 1487 | |
| 1488 private: | |
| 1489 LOperand* temp_; | |
| 1490 }; | 1401 }; | 
| 1491 | 1402 | 
| 1492 | 1403 | 
| 1493 // Sometimes truncating conversion from a tagged value to an int32. | 1404 // Sometimes truncating conversion from a tagged value to an int32. | 
| 1494 class LDoubleToI: public LUnaryOperation<1> { | 1405 class LDoubleToI: public LUnaryOperation<1, 1> { | 
| 1495 public: | 1406 public: | 
| 1496 LDoubleToI(LOperand* value, LOperand* temporary) | 1407 LDoubleToI(LOperand* value, LOperand* temp) : LUnaryOperation<1, 1>(value) { | 
| 1497 : LUnaryOperation<1>(value), temporary_(temporary) { } | 1408 SetTempAt(0, temp); | 
| 1409 } | |
| 1498 | 1410 | 
| 1499 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 1411 DECLARE_CONCRETE_INSTRUCTION(DoubleToI, "double-to-i") | 
| 1500 DECLARE_HYDROGEN_ACCESSOR(Change) | 1412 DECLARE_HYDROGEN_ACCESSOR(Change) | 
| 1501 | 1413 | 
| 1502 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1414 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 
| 1503 LOperand* temporary() const { return temporary_; } | |
| 1504 | |
| 1505 private: | |
| 1506 LOperand* temporary_; | |
| 1507 }; | 1415 }; | 
| 1508 | 1416 | 
| 1509 | 1417 | 
| 1510 // Truncating conversion from a tagged value to an int32. | 1418 // Truncating conversion from a tagged value to an int32. | 
| 1511 class LTaggedToI: public LUnaryOperation<1> { | 1419 class LTaggedToI: public LUnaryOperation<1, 1> { | 
| 1512 public: | 1420 public: | 
| 1513 LTaggedToI(LOperand* value, LOperand* temp) | 1421 LTaggedToI(LOperand* value, LOperand* temp) | 
| 1514 : LUnaryOperation<1>(value), temp_(temp) { } | 1422 : LUnaryOperation<1, 1>(value) { | 
| 1423 SetTempAt(0, temp); | |
| 1424 } | |
| 1515 | 1425 | 
| 1516 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 1426 DECLARE_CONCRETE_INSTRUCTION(TaggedToI, "tagged-to-i") | 
| 1517 DECLARE_HYDROGEN_ACCESSOR(Change) | 1427 DECLARE_HYDROGEN_ACCESSOR(Change) | 
| 1518 | 1428 | 
| 1519 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 1429 bool truncating() { return hydrogen()->CanTruncateToInt32(); } | 
| 1520 LOperand* temp() const { return temp_; } | |
| 1521 | |
| 1522 private: | |
| 1523 LOperand* temp_; | |
| 1524 }; | 1430 }; | 
| 1525 | 1431 | 
| 1526 | 1432 | 
| 1527 class LSmiTag: public LUnaryOperation<1> { | 1433 class LSmiTag: public LUnaryOperation<1> { | 
| 1528 public: | 1434 public: | 
| 1529 explicit LSmiTag(LOperand* use) : LUnaryOperation<1>(use) { } | 1435 explicit LSmiTag(LOperand* use) : LUnaryOperation<1>(use) { } | 
| 1530 | 1436 | 
| 1531 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 1437 DECLARE_CONCRETE_INSTRUCTION(SmiTag, "smi-tag") | 
| 1532 }; | 1438 }; | 
| 1533 | 1439 | 
| (...skipping 13 matching lines...) Expand all Loading... | |
| 1547 | 1453 | 
| 1548 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 1454 DECLARE_CONCRETE_INSTRUCTION(SmiUntag, "smi-untag") | 
| 1549 | 1455 | 
| 1550 bool needs_check() const { return needs_check_; } | 1456 bool needs_check() const { return needs_check_; } | 
| 1551 | 1457 | 
| 1552 private: | 1458 private: | 
| 1553 bool needs_check_; | 1459 bool needs_check_; | 
| 1554 }; | 1460 }; | 
| 1555 | 1461 | 
| 1556 | 1462 | 
| 1557 class LStoreNamed: public LTemplateInstruction<0, 2, 0> { | 1463 class LStoreNamed: public LTemplateInstruction<0, 2, 1> { | 
| 1558 public: | 1464 public: | 
| 1559 LStoreNamed(LOperand* obj, LOperand* val) { | 1465 LStoreNamed(LOperand* obj, LOperand* val) { | 
| 1560 this->SetInputAt(0, obj); | 1466 this->SetInputAt(0, obj); | 
| 1561 this->SetInputAt(1, val); | 1467 this->SetInputAt(1, val); | 
| 1562 } | 1468 } | 
| 1563 | 1469 | 
| 1564 DECLARE_INSTRUCTION(StoreNamed) | 1470 DECLARE_INSTRUCTION(StoreNamed) | 
| 1565 DECLARE_HYDROGEN_ACCESSOR(StoreNamed) | 1471 DECLARE_HYDROGEN_ACCESSOR(StoreNamed) | 
| 1566 | 1472 | 
| 1567 virtual void PrintDataTo(StringStream* stream); | 1473 virtual void PrintDataTo(StringStream* stream); | 
| 1568 | 1474 | 
| 1569 LOperand* object() const { return this->InputAt(0); } | 1475 LOperand* object() const { return this->InputAt(0); } | 
| 1570 LOperand* value() const { return this->InputAt(1); } | 1476 LOperand* value() const { return this->InputAt(1); } | 
| 1571 Handle<Object> name() const { return hydrogen()->name(); } | 1477 Handle<Object> name() const { return hydrogen()->name(); } | 
| 1572 }; | 1478 }; | 
| 1573 | 1479 | 
| 1574 | 1480 | 
| 1575 class LStoreNamedField: public LStoreNamed { | 1481 class LStoreNamedField: public LStoreNamed { | 
| 1576 public: | 1482 public: | 
| 1577 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp) | 1483 LStoreNamedField(LOperand* obj, LOperand* val, LOperand* temp) | 
| 1578 : LStoreNamed(obj, val), temp_(temp) { } | 1484 : LStoreNamed(obj, val) { | 
| 1485 SetTempAt(0, temp); | |
| 1486 } | |
| 1579 | 1487 | 
| 1580 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") | 1488 DECLARE_CONCRETE_INSTRUCTION(StoreNamedField, "store-named-field") | 
| 1581 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) | 1489 DECLARE_HYDROGEN_ACCESSOR(StoreNamedField) | 
| 1582 | 1490 | 
| 1583 bool is_in_object() { return hydrogen()->is_in_object(); } | 1491 bool is_in_object() { return hydrogen()->is_in_object(); } | 
| 1584 int offset() { return hydrogen()->offset(); } | 1492 int offset() { return hydrogen()->offset(); } | 
| 1585 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } | 1493 bool needs_write_barrier() { return hydrogen()->NeedsWriteBarrier(); } | 
| 1586 Handle<Map> transition() const { return hydrogen()->transition(); } | 1494 Handle<Map> transition() const { return hydrogen()->transition(); } | 
| 1587 | |
| 1588 LOperand* temp() { return temp_; } | |
| 1589 | |
| 1590 private: | |
| 1591 LOperand* temp_; | |
| 1592 }; | 1495 }; | 
| 1593 | 1496 | 
| 1594 | 1497 | 
| 1595 class LStoreNamedGeneric: public LStoreNamed { | 1498 class LStoreNamedGeneric: public LStoreNamed { | 
| 1596 public: | 1499 public: | 
| 1597 LStoreNamedGeneric(LOperand* obj, LOperand* val) | 1500 LStoreNamedGeneric(LOperand* obj, LOperand* val) | 
| 1598 : LStoreNamed(obj, val) { } | 1501 : LStoreNamed(obj, val) { } | 
| 1599 | 1502 | 
| 1600 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 1503 DECLARE_CONCRETE_INSTRUCTION(StoreNamedGeneric, "store-named-generic") | 
| 1601 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 1504 DECLARE_HYDROGEN_ACCESSOR(StoreNamedGeneric) | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1642 | 1545 | 
| 1643 class LCheckFunction: public LUnaryOperation<0> { | 1546 class LCheckFunction: public LUnaryOperation<0> { | 
| 1644 public: | 1547 public: | 
| 1645 explicit LCheckFunction(LOperand* use) : LUnaryOperation<0>(use) { } | 1548 explicit LCheckFunction(LOperand* use) : LUnaryOperation<0>(use) { } | 
| 1646 | 1549 | 
| 1647 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") | 1550 DECLARE_CONCRETE_INSTRUCTION(CheckFunction, "check-function") | 
| 1648 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) | 1551 DECLARE_HYDROGEN_ACCESSOR(CheckFunction) | 
| 1649 }; | 1552 }; | 
| 1650 | 1553 | 
| 1651 | 1554 | 
| 1652 class LCheckInstanceType: public LUnaryOperation<0> { | 1555 class LCheckInstanceType: public LUnaryOperation<0, 1> { | 
| 1653 public: | 1556 public: | 
| 1654 LCheckInstanceType(LOperand* use, LOperand* temp) | 1557 LCheckInstanceType(LOperand* use, LOperand* temp) | 
| 1655 : LUnaryOperation<0>(use), temp_(temp) { } | 1558 : LUnaryOperation<0, 1>(use) { | 
| 1559 SetTempAt(0, temp); | |
| 1560 } | |
| 1656 | 1561 | 
| 1657 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 1562 DECLARE_CONCRETE_INSTRUCTION(CheckInstanceType, "check-instance-type") | 
| 1658 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 1563 DECLARE_HYDROGEN_ACCESSOR(CheckInstanceType) | 
| 1659 | |
| 1660 LOperand* temp() const { return temp_; } | |
| 1661 | |
| 1662 private: | |
| 1663 LOperand* temp_; | |
| 1664 }; | 1564 }; | 
| 1665 | 1565 | 
| 1666 | 1566 | 
| 1667 class LCheckMap: public LUnaryOperation<0> { | 1567 class LCheckMap: public LUnaryOperation<0> { | 
| 1668 public: | 1568 public: | 
| 1669 explicit LCheckMap(LOperand* use) : LUnaryOperation<0>(use) { } | 1569 explicit LCheckMap(LOperand* use) : LUnaryOperation<0>(use) { } | 
| 1670 | 1570 | 
| 1671 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") | 1571 DECLARE_CONCRETE_INSTRUCTION(CheckMap, "check-map") | 
| 1672 DECLARE_HYDROGEN_ACCESSOR(CheckMap) | 1572 DECLARE_HYDROGEN_ACCESSOR(CheckMap) | 
| 1673 }; | 1573 }; | 
| 1674 | 1574 | 
| 1675 | 1575 | 
| 1676 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 0> { | 1576 class LCheckPrototypeMaps: public LTemplateInstruction<0, 0, 1> { | 
| 1677 public: | 1577 public: | 
| 1678 explicit LCheckPrototypeMaps(LOperand* temp) : temp_(temp) { } | 1578 explicit LCheckPrototypeMaps(LOperand* temp) { | 
| 1579 SetTempAt(0, temp); | |
| 1580 } | |
| 1679 | 1581 | 
| 1680 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") | 1582 DECLARE_CONCRETE_INSTRUCTION(CheckPrototypeMaps, "check-prototype-maps") | 
| 1681 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) | 1583 DECLARE_HYDROGEN_ACCESSOR(CheckPrototypeMaps) | 
| 1682 | 1584 | 
| 1683 Handle<JSObject> holder() const { return hydrogen()->holder(); } | 1585 Handle<JSObject> holder() const { return hydrogen()->holder(); } | 
| 1684 Handle<Map> receiver_map() const { return hydrogen()->receiver_map(); } | 1586 Handle<Map> receiver_map() const { return hydrogen()->receiver_map(); } | 
| 1685 | |
| 1686 LOperand* temp() const { return temp_; } | |
| 1687 | |
| 1688 private: | |
| 1689 LOperand* temp_; | |
| 1690 }; | 1587 }; | 
| 1691 | 1588 | 
| 1692 | 1589 | 
| 1693 class LCheckSmi: public LUnaryOperation<0> { | 1590 class LCheckSmi: public LUnaryOperation<0> { | 
| 1694 public: | 1591 public: | 
| 1695 LCheckSmi(LOperand* use, Condition condition) | 1592 LCheckSmi(LOperand* use, Condition condition) | 
| 1696 : LUnaryOperation<0>(use), condition_(condition) { } | 1593 : LUnaryOperation<0>(use), condition_(condition) { } | 
| 1697 | 1594 | 
| 1698 Condition condition() const { return condition_; } | 1595 Condition condition() const { return condition_; } | 
| 1699 | 1596 | 
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1747 public: | 1644 public: | 
| 1748 explicit LTypeof(LOperand* input) : LUnaryOperation<1>(input) { } | 1645 explicit LTypeof(LOperand* input) : LUnaryOperation<1>(input) { } | 
| 1749 | 1646 | 
| 1750 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 1647 DECLARE_CONCRETE_INSTRUCTION(Typeof, "typeof") | 
| 1751 }; | 1648 }; | 
| 1752 | 1649 | 
| 1753 | 1650 | 
| 1754 class LTypeofIs: public LUnaryOperation<1> { | 1651 class LTypeofIs: public LUnaryOperation<1> { | 
| 1755 public: | 1652 public: | 
| 1756 explicit LTypeofIs(LOperand* input) : LUnaryOperation<1>(input) { } | 1653 explicit LTypeofIs(LOperand* input) : LUnaryOperation<1>(input) { } | 
| 1757 virtual void PrintDataTo(StringStream* stream); | |
| 1758 | 1654 | 
| 1759 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") | 1655 DECLARE_CONCRETE_INSTRUCTION(TypeofIs, "typeof-is") | 
| 1760 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 1656 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | 
| 1761 | 1657 | 
| 1762 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 1658 Handle<String> type_literal() { return hydrogen()->type_literal(); } | 
| 1659 | |
| 1660 virtual void PrintDataTo(StringStream* stream); | |
| 1763 }; | 1661 }; | 
| 1764 | 1662 | 
| 1765 | 1663 | 
| 1766 class LTypeofIsAndBranch: public LTypeofIs { | 1664 class LTypeofIsAndBranch: public LUnaryControlInstruction<> { | 
| 1767 public: | 1665 public: | 
| 1768 LTypeofIsAndBranch(LOperand* value, | 1666 explicit LTypeofIsAndBranch(LOperand* value) | 
| 1769 int true_block_id, | 1667 : LUnaryControlInstruction<>(value) { } | 
| 1770 int false_block_id) | |
| 1771 : LTypeofIs(value), | |
| 1772 true_block_id_(true_block_id), | |
| 1773 false_block_id_(false_block_id) { } | |
| 1774 | 1668 | 
| 1775 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 1669 DECLARE_CONCRETE_INSTRUCTION(TypeofIsAndBranch, "typeof-is-and-branch") | 
| 1670 DECLARE_HYDROGEN_ACCESSOR(TypeofIs) | |
| 1671 | |
| 1672 Handle<String> type_literal() { return hydrogen()->type_literal(); } | |
| 1776 | 1673 | 
| 1777 virtual void PrintDataTo(StringStream* stream); | 1674 virtual void PrintDataTo(StringStream* stream); | 
| 1778 virtual bool IsControl() const { return true; } | |
| 1779 | |
| 1780 int true_block_id() const { return true_block_id_; } | |
| 1781 int false_block_id() const { return false_block_id_; } | |
| 1782 | |
| 1783 private: | |
| 1784 int true_block_id_; | |
| 1785 int false_block_id_; | |
| 1786 }; | 1675 }; | 
| 1787 | 1676 | 
| 1788 | 1677 | 
| 1789 class LDeleteProperty: public LBinaryOperation<1> { | 1678 class LDeleteProperty: public LBinaryOperation<1> { | 
| 1790 public: | 1679 public: | 
| 1791 LDeleteProperty(LOperand* obj, LOperand* key) | 1680 LDeleteProperty(LOperand* obj, LOperand* key) | 
| 1792 : LBinaryOperation<1>(obj, key) { } | 1681 : LBinaryOperation<1>(obj, key) { } | 
| 1793 | 1682 | 
| 1794 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 1683 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 
| 1795 | 1684 | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1931 bool is_aborted() const { return status_ == ABORTED; } | 1820 bool is_aborted() const { return status_ == ABORTED; } | 
| 1932 | 1821 | 
| 1933 void Abort(const char* format, ...); | 1822 void Abort(const char* format, ...); | 
| 1934 | 1823 | 
| 1935 // Methods for getting operands for Use / Define / Temp. | 1824 // Methods for getting operands for Use / Define / Temp. | 
| 1936 LRegister* ToOperand(Register reg); | 1825 LRegister* ToOperand(Register reg); | 
| 1937 LUnallocated* ToUnallocated(Register reg); | 1826 LUnallocated* ToUnallocated(Register reg); | 
| 1938 LUnallocated* ToUnallocated(XMMRegister reg); | 1827 LUnallocated* ToUnallocated(XMMRegister reg); | 
| 1939 | 1828 | 
| 1940 // Methods for setting up define-use relationships. | 1829 // Methods for setting up define-use relationships. | 
| 1941 LOperand* Use(HValue* value, LUnallocated* operand); | 1830 MUST_USE_RESULT LOperand* Use(HValue* value, LUnallocated* operand); | 
| 1942 LOperand* UseFixed(HValue* value, Register fixed_register); | 1831 MUST_USE_RESULT LOperand* UseFixed(HValue* value, Register fixed_register); | 
| 1943 LOperand* UseFixedDouble(HValue* value, XMMRegister fixed_register); | 1832 MUST_USE_RESULT LOperand* UseFixedDouble(HValue* value, | 
| 1833 XMMRegister fixed_register); | |
| 1944 | 1834 | 
| 1945 // A value that is guaranteed to be allocated to a register. | 1835 // A value that is guaranteed to be allocated to a register. | 
| 1946 // Operand created by UseRegister is guaranteed to be live until the end of | 1836 // Operand created by UseRegister is guaranteed to be live until the end of | 
| 1947 // instruction. This means that register allocator will not reuse it's | 1837 // instruction. This means that register allocator will not reuse it's | 
| 1948 // register for any other operand inside instruction. | 1838 // register for any other operand inside instruction. | 
| 1949 // Operand created by UseRegisterAtStart is guaranteed to be live only at | 1839 // Operand created by UseRegisterAtStart is guaranteed to be live only at | 
| 1950 // instruction start. Register allocator is free to assign the same register | 1840 // instruction start. Register allocator is free to assign the same register | 
| 1951 // to some other operand used inside instruction (i.e. temporary or | 1841 // to some other operand used inside instruction (i.e. temporary or | 
| 1952 // output). | 1842 // output). | 
| 1953 LOperand* UseRegister(HValue* value); | 1843 MUST_USE_RESULT LOperand* UseRegister(HValue* value); | 
| 1954 LOperand* UseRegisterAtStart(HValue* value); | 1844 MUST_USE_RESULT LOperand* UseRegisterAtStart(HValue* value); | 
| 1955 | 1845 | 
| 1956 // A value in a register that may be trashed. | 1846 // A value in a register that may be trashed. | 
| 1957 LOperand* UseTempRegister(HValue* value); | 1847 MUST_USE_RESULT LOperand* UseTempRegister(HValue* value); | 
| 1958 LOperand* Use(HValue* value); | 1848 MUST_USE_RESULT LOperand* Use(HValue* value); | 
| 1959 LOperand* UseAtStart(HValue* value); | 1849 MUST_USE_RESULT LOperand* UseAtStart(HValue* value); | 
| 1960 LOperand* UseOrConstant(HValue* value); | 1850 MUST_USE_RESULT LOperand* UseOrConstant(HValue* value); | 
| 1961 LOperand* UseOrConstantAtStart(HValue* value); | 1851 MUST_USE_RESULT LOperand* UseOrConstantAtStart(HValue* value); | 
| 1962 LOperand* UseRegisterOrConstant(HValue* value); | 1852 MUST_USE_RESULT LOperand* UseRegisterOrConstant(HValue* value); | 
| 1963 LOperand* UseRegisterOrConstantAtStart(HValue* value); | 1853 MUST_USE_RESULT LOperand* UseRegisterOrConstantAtStart(HValue* value); | 
| 1854 | |
| 1855 // Temporary operand that must be in a register. | |
| 1856 MUST_USE_RESULT LUnallocated* TempRegister(); | |
| 1857 MUST_USE_RESULT LOperand* FixedTemp(Register reg); | |
| 1858 MUST_USE_RESULT LOperand* FixedTemp(XMMRegister reg); | |
| 1964 | 1859 | 
| 1965 // Methods for setting up define-use relationships. | 1860 // Methods for setting up define-use relationships. | 
| 1966 // Return the same instruction that they are passed. | 1861 // Return the same instruction that they are passed. | 
| 1967 template<int I, int T> | 1862 template<int I, int T> | 
| 1968 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, | 1863 LInstruction* Define(LTemplateInstruction<1, I, T>* instr, | 
| 1969 LUnallocated* result); | 1864 LUnallocated* result); | 
| 1970 template<int I, int T> | 1865 template<int I, int T> | 
| 1971 LInstruction* Define(LTemplateInstruction<1, I, T>* instr); | 1866 LInstruction* Define(LTemplateInstruction<1, I, T>* instr); | 
| 1972 template<int I, int T> | 1867 template<int I, int T> | 
| 1973 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr); | 1868 LInstruction* DefineAsRegister(LTemplateInstruction<1, I, T>* instr); | 
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1995 HInstruction* hinstr, | 1890 HInstruction* hinstr, | 
| 1996 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 1891 CanDeoptimize can_deoptimize = CANNOT_DEOPTIMIZE_EAGERLY); | 
| 1997 LInstruction* MarkAsSaveDoubles(LInstruction* instr); | 1892 LInstruction* MarkAsSaveDoubles(LInstruction* instr); | 
| 1998 | 1893 | 
| 1999 LInstruction* SetInstructionPendingDeoptimizationEnvironment( | 1894 LInstruction* SetInstructionPendingDeoptimizationEnvironment( | 
| 2000 LInstruction* instr, int ast_id); | 1895 LInstruction* instr, int ast_id); | 
| 2001 void ClearInstructionPendingDeoptimizationEnvironment(); | 1896 void ClearInstructionPendingDeoptimizationEnvironment(); | 
| 2002 | 1897 | 
| 2003 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); | 1898 LEnvironment* CreateEnvironment(HEnvironment* hydrogen_env); | 
| 2004 | 1899 | 
| 2005 // Temporary operand that must be in a register. | |
| 2006 LUnallocated* TempRegister(); | |
| 2007 LOperand* FixedTemp(Register reg); | |
| 2008 LOperand* FixedTemp(XMMRegister reg); | |
| 2009 | |
| 2010 void VisitInstruction(HInstruction* current); | 1900 void VisitInstruction(HInstruction* current); | 
| 2011 | 1901 | 
| 2012 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 1902 void DoBasicBlock(HBasicBlock* block, HBasicBlock* next_block); | 
| 2013 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 1903 LInstruction* DoBit(Token::Value op, HBitwiseBinaryOperation* instr); | 
| 2014 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 1904 LInstruction* DoShift(Token::Value op, HBitwiseBinaryOperation* instr); | 
| 2015 LInstruction* DoArithmeticD(Token::Value op, | 1905 LInstruction* DoArithmeticD(Token::Value op, | 
| 2016 HArithmeticBinaryOperation* instr); | 1906 HArithmeticBinaryOperation* instr); | 
| 2017 LInstruction* DoArithmeticT(Token::Value op, | 1907 LInstruction* DoArithmeticT(Token::Value op, | 
| 2018 HArithmeticBinaryOperation* instr); | 1908 HArithmeticBinaryOperation* instr); | 
| 2019 | 1909 | 
| (...skipping 12 matching lines...) Expand all Loading... | |
| 2032 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 1922 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 
| 2033 }; | 1923 }; | 
| 2034 | 1924 | 
| 2035 #undef DECLARE_HYDROGEN_ACCESSOR | 1925 #undef DECLARE_HYDROGEN_ACCESSOR | 
| 2036 #undef DECLARE_INSTRUCTION | 1926 #undef DECLARE_INSTRUCTION | 
| 2037 #undef DECLARE_CONCRETE_INSTRUCTION | 1927 #undef DECLARE_CONCRETE_INSTRUCTION | 
| 2038 | 1928 | 
| 2039 } } // namespace v8::internal | 1929 } } // namespace v8::internal | 
| 2040 | 1930 | 
| 2041 #endif // V8_IA32_LITHIUM_IA32_H_ | 1931 #endif // V8_IA32_LITHIUM_IA32_H_ | 
| OLD | NEW |