| 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 // Interface to the register allocator and iterators. | 273 // Interface to the register allocator and iterators. |
| 274 bool IsMarkedAsCall() const { return is_call_; } | 274 bool IsMarkedAsCall() const { return is_call_; } |
| 275 | 275 |
| 276 virtual bool HasResult() const = 0; | 276 virtual bool HasResult() const = 0; |
| 277 virtual LOperand* result() = 0; | 277 virtual LOperand* result() = 0; |
| 278 | 278 |
| 279 LOperand* FirstInput() { return InputAt(0); } | 279 LOperand* FirstInput() { return InputAt(0); } |
| 280 LOperand* Output() { return HasResult() ? result() : NULL; } | 280 LOperand* Output() { return HasResult() ? result() : NULL; } |
| 281 | 281 |
| 282 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
| 283 |
| 282 #ifdef DEBUG | 284 #ifdef DEBUG |
| 283 void VerifyCall(); | 285 void VerifyCall(); |
| 284 #endif | 286 #endif |
| 285 | 287 |
| 286 private: | 288 private: |
| 287 // Iterator interface. | 289 // Iterator interface. |
| 288 friend class InputIterator; | 290 friend class InputIterator; |
| 289 virtual int InputCount() = 0; | 291 virtual int InputCount() = 0; |
| 290 virtual LOperand* InputAt(int i) = 0; | 292 virtual LOperand* InputAt(int i) = 0; |
| 291 | 293 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 private: | 373 private: |
| 372 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 374 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 373 HBasicBlock* block_; | 375 HBasicBlock* block_; |
| 374 }; | 376 }; |
| 375 | 377 |
| 376 | 378 |
| 377 class LInstructionGap: public LGap { | 379 class LInstructionGap: public LGap { |
| 378 public: | 380 public: |
| 379 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 381 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 380 | 382 |
| 383 virtual bool HasInterestingComment(LCodeGen* gen) const { |
| 384 return !IsRedundant(); |
| 385 } |
| 386 |
| 381 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 387 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 382 }; | 388 }; |
| 383 | 389 |
| 384 | 390 |
| 385 class LGoto: public LTemplateInstruction<0, 0, 0> { | 391 class LGoto: public LTemplateInstruction<0, 0, 0> { |
| 386 public: | 392 public: |
| 387 explicit LGoto(int block_id) : block_id_(block_id) { } | 393 explicit LGoto(int block_id) : block_id_(block_id) { } |
| 388 | 394 |
| 395 virtual bool HasInterestingComment(LCodeGen* gen) const; |
| 389 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 396 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 390 virtual void PrintDataTo(StringStream* stream); | 397 virtual void PrintDataTo(StringStream* stream); |
| 391 virtual bool IsControl() const { return true; } | 398 virtual bool IsControl() const { return true; } |
| 392 | 399 |
| 393 int block_id() const { return block_id_; } | 400 int block_id() const { return block_id_; } |
| 394 | 401 |
| 395 private: | 402 private: |
| 396 int block_id_; | 403 int block_id_; |
| 397 }; | 404 }; |
| 398 | 405 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 426 public: | 433 public: |
| 427 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 434 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 428 }; | 435 }; |
| 429 | 436 |
| 430 | 437 |
| 431 class LLabel: public LGap { | 438 class LLabel: public LGap { |
| 432 public: | 439 public: |
| 433 explicit LLabel(HBasicBlock* block) | 440 explicit LLabel(HBasicBlock* block) |
| 434 : LGap(block), replacement_(NULL) { } | 441 : LGap(block), replacement_(NULL) { } |
| 435 | 442 |
| 443 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 436 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 444 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 437 | 445 |
| 438 virtual void PrintDataTo(StringStream* stream); | 446 virtual void PrintDataTo(StringStream* stream); |
| 439 | 447 |
| 440 int block_id() const { return block()->block_id(); } | 448 int block_id() const { return block()->block_id(); } |
| 441 bool is_loop_header() const { return block()->IsLoopHeader(); } | 449 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 450 bool is_osr_entry() const { return block()->is_osr_entry(); } |
| 442 Label* label() { return &label_; } | 451 Label* label() { return &label_; } |
| 443 LLabel* replacement() const { return replacement_; } | 452 LLabel* replacement() const { return replacement_; } |
| 444 void set_replacement(LLabel* label) { replacement_ = label; } | 453 void set_replacement(LLabel* label) { replacement_ = label; } |
| 445 bool HasReplacement() const { return replacement_ != NULL; } | 454 bool HasReplacement() const { return replacement_ != NULL; } |
| 446 | 455 |
| 447 private: | 456 private: |
| 448 Label label_; | 457 Label label_; |
| 449 LLabel* replacement_; | 458 LLabel* replacement_; |
| 450 }; | 459 }; |
| 451 | 460 |
| 452 | 461 |
| 453 class LParameter: public LTemplateInstruction<1, 0, 0> { | 462 class LParameter: public LTemplateInstruction<1, 0, 0> { |
| 454 public: | 463 public: |
| 464 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 455 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 465 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 456 }; | 466 }; |
| 457 | 467 |
| 458 | 468 |
| 459 class LCallStub: public LTemplateInstruction<1, 0, 0> { | 469 class LCallStub: public LTemplateInstruction<1, 0, 0> { |
| 460 public: | 470 public: |
| 461 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 471 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 462 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 472 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 463 | 473 |
| 464 TranscendentalCache::Type transcendental_type() { | 474 TranscendentalCache::Type transcendental_type() { |
| 465 return hydrogen()->transcendental_type(); | 475 return hydrogen()->transcendental_type(); |
| 466 } | 476 } |
| 467 }; | 477 }; |
| 468 | 478 |
| 469 | 479 |
| 470 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 480 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
| 471 public: | 481 public: |
| 482 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 472 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 483 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 473 }; | 484 }; |
| 474 | 485 |
| 475 | 486 |
| 476 template<int I, int T> | 487 template<int I, int T> |
| 477 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 488 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
| 478 public: | 489 public: |
| 479 virtual bool IsControl() const { return true; } | 490 virtual bool IsControl() const { return true; } |
| 480 | 491 |
| 481 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 492 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| (...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 LOperand* key() { return inputs_[1]; } | 2511 LOperand* key() { return inputs_[1]; } |
| 2501 | 2512 |
| 2502 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 2513 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
| 2503 }; | 2514 }; |
| 2504 | 2515 |
| 2505 | 2516 |
| 2506 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 2517 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
| 2507 public: | 2518 public: |
| 2508 LOsrEntry(); | 2519 LOsrEntry(); |
| 2509 | 2520 |
| 2521 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 2510 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2522 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 2511 | 2523 |
| 2512 LOperand** SpilledRegisterArray() { return register_spills_; } | 2524 LOperand** SpilledRegisterArray() { return register_spills_; } |
| 2513 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 2525 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
| 2514 | 2526 |
| 2515 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 2527 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
| 2516 void MarkSpilledDoubleRegister(int allocation_index, | 2528 void MarkSpilledDoubleRegister(int allocation_index, |
| 2517 LOperand* spill_operand); | 2529 LOperand* spill_operand); |
| 2518 | 2530 |
| 2519 private: | 2531 private: |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2783 | 2795 |
| 2784 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2796 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2785 }; | 2797 }; |
| 2786 | 2798 |
| 2787 #undef DECLARE_HYDROGEN_ACCESSOR | 2799 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2788 #undef DECLARE_CONCRETE_INSTRUCTION | 2800 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2789 | 2801 |
| 2790 } } // namespace v8::internal | 2802 } } // namespace v8::internal |
| 2791 | 2803 |
| 2792 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2804 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
| OLD | NEW |