| 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 |
| 399 | 406 |
| 400 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { | 407 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { |
| 401 public: | 408 public: |
| 402 LLazyBailout() : gap_instructions_size_(0) { } | 409 LLazyBailout() : gap_instructions_size_(0) { } |
| 403 | 410 |
| 411 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 404 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 412 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 405 | 413 |
| 406 void set_gap_instructions_size(int gap_instructions_size) { | 414 void set_gap_instructions_size(int gap_instructions_size) { |
| 407 gap_instructions_size_ = gap_instructions_size; | 415 gap_instructions_size_ = gap_instructions_size; |
| 408 } | 416 } |
| 409 int gap_instructions_size() { return gap_instructions_size_; } | 417 int gap_instructions_size() { return gap_instructions_size_; } |
| 410 | 418 |
| 411 private: | 419 private: |
| 412 int gap_instructions_size_; | 420 int gap_instructions_size_; |
| 413 }; | 421 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 426 public: | 434 public: |
| 427 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 435 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 428 }; | 436 }; |
| 429 | 437 |
| 430 | 438 |
| 431 class LLabel: public LGap { | 439 class LLabel: public LGap { |
| 432 public: | 440 public: |
| 433 explicit LLabel(HBasicBlock* block) | 441 explicit LLabel(HBasicBlock* block) |
| 434 : LGap(block), replacement_(NULL) { } | 442 : LGap(block), replacement_(NULL) { } |
| 435 | 443 |
| 444 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 436 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 445 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 437 | 446 |
| 438 virtual void PrintDataTo(StringStream* stream); | 447 virtual void PrintDataTo(StringStream* stream); |
| 439 | 448 |
| 440 int block_id() const { return block()->block_id(); } | 449 int block_id() const { return block()->block_id(); } |
| 441 bool is_loop_header() const { return block()->IsLoopHeader(); } | 450 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 451 bool is_osr_entry() const { return block()->is_osr_entry(); } |
| 442 Label* label() { return &label_; } | 452 Label* label() { return &label_; } |
| 443 LLabel* replacement() const { return replacement_; } | 453 LLabel* replacement() const { return replacement_; } |
| 444 void set_replacement(LLabel* label) { replacement_ = label; } | 454 void set_replacement(LLabel* label) { replacement_ = label; } |
| 445 bool HasReplacement() const { return replacement_ != NULL; } | 455 bool HasReplacement() const { return replacement_ != NULL; } |
| 446 | 456 |
| 447 private: | 457 private: |
| 448 Label label_; | 458 Label label_; |
| 449 LLabel* replacement_; | 459 LLabel* replacement_; |
| 450 }; | 460 }; |
| 451 | 461 |
| 452 | 462 |
| 453 class LParameter: public LTemplateInstruction<1, 0, 0> { | 463 class LParameter: public LTemplateInstruction<1, 0, 0> { |
| 454 public: | 464 public: |
| 465 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 455 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 466 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 456 }; | 467 }; |
| 457 | 468 |
| 458 | 469 |
| 459 class LCallStub: public LTemplateInstruction<1, 0, 0> { | 470 class LCallStub: public LTemplateInstruction<1, 0, 0> { |
| 460 public: | 471 public: |
| 461 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 472 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 462 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 473 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 463 | 474 |
| 464 TranscendentalCache::Type transcendental_type() { | 475 TranscendentalCache::Type transcendental_type() { |
| 465 return hydrogen()->transcendental_type(); | 476 return hydrogen()->transcendental_type(); |
| 466 } | 477 } |
| 467 }; | 478 }; |
| 468 | 479 |
| 469 | 480 |
| 470 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 481 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
| 471 public: | 482 public: |
| 483 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 472 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 484 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 473 }; | 485 }; |
| 474 | 486 |
| 475 | 487 |
| 476 template<int I, int T> | 488 template<int I, int T> |
| 477 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 489 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
| 478 public: | 490 public: |
| 479 virtual bool IsControl() const { return true; } | 491 virtual bool IsControl() const { return true; } |
| 480 | 492 |
| 481 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 493 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| (...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2500 LOperand* key() { return inputs_[1]; } | 2512 LOperand* key() { return inputs_[1]; } |
| 2501 | 2513 |
| 2502 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 2514 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
| 2503 }; | 2515 }; |
| 2504 | 2516 |
| 2505 | 2517 |
| 2506 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 2518 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
| 2507 public: | 2519 public: |
| 2508 LOsrEntry(); | 2520 LOsrEntry(); |
| 2509 | 2521 |
| 2522 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 2510 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2523 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 2511 | 2524 |
| 2512 LOperand** SpilledRegisterArray() { return register_spills_; } | 2525 LOperand** SpilledRegisterArray() { return register_spills_; } |
| 2513 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 2526 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
| 2514 | 2527 |
| 2515 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 2528 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
| 2516 void MarkSpilledDoubleRegister(int allocation_index, | 2529 void MarkSpilledDoubleRegister(int allocation_index, |
| 2517 LOperand* spill_operand); | 2530 LOperand* spill_operand); |
| 2518 | 2531 |
| 2519 private: | 2532 private: |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2783 | 2796 |
| 2784 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2797 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2785 }; | 2798 }; |
| 2786 | 2799 |
| 2787 #undef DECLARE_HYDROGEN_ACCESSOR | 2800 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2788 #undef DECLARE_CONCRETE_INSTRUCTION | 2801 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2789 | 2802 |
| 2790 } } // namespace v8::internal | 2803 } } // namespace v8::internal |
| 2791 | 2804 |
| 2792 #endif // V8_MIPS_LITHIUM_MIPS_H_ | 2805 #endif // V8_MIPS_LITHIUM_MIPS_H_ |
| OLD | NEW |