| 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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 | 275 |
| 276 // Interface to the register allocator and iterators. | 276 // Interface to the register allocator and iterators. |
| 277 bool IsMarkedAsCall() const { return is_call_; } | 277 bool IsMarkedAsCall() const { return is_call_; } |
| 278 | 278 |
| 279 virtual bool HasResult() const = 0; | 279 virtual bool HasResult() const = 0; |
| 280 virtual LOperand* result() = 0; | 280 virtual LOperand* result() = 0; |
| 281 | 281 |
| 282 LOperand* FirstInput() { return InputAt(0); } | 282 LOperand* FirstInput() { return InputAt(0); } |
| 283 LOperand* Output() { return HasResult() ? result() : NULL; } | 283 LOperand* Output() { return HasResult() ? result() : NULL; } |
| 284 | 284 |
| 285 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
| 286 |
| 285 #ifdef DEBUG | 287 #ifdef DEBUG |
| 286 void VerifyCall(); | 288 void VerifyCall(); |
| 287 #endif | 289 #endif |
| 288 | 290 |
| 289 private: | 291 private: |
| 290 // Iterator support. | 292 // Iterator support. |
| 291 friend class InputIterator; | 293 friend class InputIterator; |
| 292 virtual int InputCount() = 0; | 294 virtual int InputCount() = 0; |
| 293 virtual LOperand* InputAt(int i) = 0; | 295 virtual LOperand* InputAt(int i) = 0; |
| 294 | 296 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 private: | 376 private: |
| 375 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 377 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 376 HBasicBlock* block_; | 378 HBasicBlock* block_; |
| 377 }; | 379 }; |
| 378 | 380 |
| 379 | 381 |
| 380 class LInstructionGap: public LGap { | 382 class LInstructionGap: public LGap { |
| 381 public: | 383 public: |
| 382 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 384 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 383 | 385 |
| 386 virtual bool HasInterestingComment(LCodeGen* gen) const { |
| 387 return !IsRedundant(); |
| 388 } |
| 389 |
| 384 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") | 390 DECLARE_CONCRETE_INSTRUCTION(InstructionGap, "gap") |
| 385 }; | 391 }; |
| 386 | 392 |
| 387 | 393 |
| 388 class LGoto: public LTemplateInstruction<0, 0, 0> { | 394 class LGoto: public LTemplateInstruction<0, 0, 0> { |
| 389 public: | 395 public: |
| 390 explicit LGoto(int block_id) : block_id_(block_id) { } | 396 explicit LGoto(int block_id) : block_id_(block_id) { } |
| 391 | 397 |
| 398 virtual bool HasInterestingComment(LCodeGen* gen) const; |
| 392 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") | 399 DECLARE_CONCRETE_INSTRUCTION(Goto, "goto") |
| 393 virtual void PrintDataTo(StringStream* stream); | 400 virtual void PrintDataTo(StringStream* stream); |
| 394 virtual bool IsControl() const { return true; } | 401 virtual bool IsControl() const { return true; } |
| 395 | 402 |
| 396 int block_id() const { return block_id_; } | 403 int block_id() const { return block_id_; } |
| 397 | 404 |
| 398 private: | 405 private: |
| 399 int block_id_; | 406 int block_id_; |
| 400 }; | 407 }; |
| 401 | 408 |
| 402 | 409 |
| 403 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { | 410 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { |
| 404 public: | 411 public: |
| 405 LLazyBailout() : gap_instructions_size_(0) { } | 412 LLazyBailout() : gap_instructions_size_(0) { } |
| 406 | 413 |
| 414 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 407 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 415 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
| 408 | 416 |
| 409 void set_gap_instructions_size(int gap_instructions_size) { | 417 void set_gap_instructions_size(int gap_instructions_size) { |
| 410 gap_instructions_size_ = gap_instructions_size; | 418 gap_instructions_size_ = gap_instructions_size; |
| 411 } | 419 } |
| 412 int gap_instructions_size() { return gap_instructions_size_; } | 420 int gap_instructions_size() { return gap_instructions_size_; } |
| 413 | 421 |
| 414 private: | 422 private: |
| 415 int gap_instructions_size_; | 423 int gap_instructions_size_; |
| 416 }; | 424 }; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 429 public: | 437 public: |
| 430 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 438 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 431 }; | 439 }; |
| 432 | 440 |
| 433 | 441 |
| 434 class LLabel: public LGap { | 442 class LLabel: public LGap { |
| 435 public: | 443 public: |
| 436 explicit LLabel(HBasicBlock* block) | 444 explicit LLabel(HBasicBlock* block) |
| 437 : LGap(block), replacement_(NULL) { } | 445 : LGap(block), replacement_(NULL) { } |
| 438 | 446 |
| 447 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 439 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 448 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 440 | 449 |
| 441 virtual void PrintDataTo(StringStream* stream); | 450 virtual void PrintDataTo(StringStream* stream); |
| 442 | 451 |
| 443 int block_id() const { return block()->block_id(); } | 452 int block_id() const { return block()->block_id(); } |
| 444 bool is_loop_header() const { return block()->IsLoopHeader(); } | 453 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 454 bool is_osr_entry() const { return block()->is_osr_entry(); } |
| 445 Label* label() { return &label_; } | 455 Label* label() { return &label_; } |
| 446 LLabel* replacement() const { return replacement_; } | 456 LLabel* replacement() const { return replacement_; } |
| 447 void set_replacement(LLabel* label) { replacement_ = label; } | 457 void set_replacement(LLabel* label) { replacement_ = label; } |
| 448 bool HasReplacement() const { return replacement_ != NULL; } | 458 bool HasReplacement() const { return replacement_ != NULL; } |
| 449 | 459 |
| 450 private: | 460 private: |
| 451 Label label_; | 461 Label label_; |
| 452 LLabel* replacement_; | 462 LLabel* replacement_; |
| 453 }; | 463 }; |
| 454 | 464 |
| 455 | 465 |
| 456 class LParameter: public LTemplateInstruction<1, 0, 0> { | 466 class LParameter: public LTemplateInstruction<1, 0, 0> { |
| 457 public: | 467 public: |
| 468 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 458 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 469 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 459 }; | 470 }; |
| 460 | 471 |
| 461 | 472 |
| 462 class LCallStub: public LTemplateInstruction<1, 0, 0> { | 473 class LCallStub: public LTemplateInstruction<1, 0, 0> { |
| 463 public: | 474 public: |
| 464 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 475 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 465 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 476 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 466 | 477 |
| 467 TranscendentalCache::Type transcendental_type() { | 478 TranscendentalCache::Type transcendental_type() { |
| 468 return hydrogen()->transcendental_type(); | 479 return hydrogen()->transcendental_type(); |
| 469 } | 480 } |
| 470 }; | 481 }; |
| 471 | 482 |
| 472 | 483 |
| 473 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 484 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
| 474 public: | 485 public: |
| 486 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 475 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 487 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 476 }; | 488 }; |
| 477 | 489 |
| 478 | 490 |
| 479 template<int I, int T> | 491 template<int I, int T> |
| 480 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 492 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
| 481 public: | 493 public: |
| 482 virtual bool IsControl() const { return true; } | 494 virtual bool IsControl() const { return true; } |
| 483 | 495 |
| 484 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 496 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| (...skipping 2074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2559 LOperand* key() { return inputs_[1]; } | 2571 LOperand* key() { return inputs_[1]; } |
| 2560 | 2572 |
| 2561 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 2573 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
| 2562 }; | 2574 }; |
| 2563 | 2575 |
| 2564 | 2576 |
| 2565 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 2577 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
| 2566 public: | 2578 public: |
| 2567 LOsrEntry(); | 2579 LOsrEntry(); |
| 2568 | 2580 |
| 2581 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 2569 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2582 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 2570 | 2583 |
| 2571 LOperand** SpilledRegisterArray() { return register_spills_; } | 2584 LOperand** SpilledRegisterArray() { return register_spills_; } |
| 2572 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 2585 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
| 2573 | 2586 |
| 2574 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 2587 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
| 2575 void MarkSpilledDoubleRegister(int allocation_index, | 2588 void MarkSpilledDoubleRegister(int allocation_index, |
| 2576 LOperand* spill_operand); | 2589 LOperand* spill_operand); |
| 2577 | 2590 |
| 2578 private: | 2591 private: |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2847 | 2860 |
| 2848 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2861 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2849 }; | 2862 }; |
| 2850 | 2863 |
| 2851 #undef DECLARE_HYDROGEN_ACCESSOR | 2864 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2852 #undef DECLARE_CONCRETE_INSTRUCTION | 2865 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2853 | 2866 |
| 2854 } } // namespace v8::internal | 2867 } } // namespace v8::internal |
| 2855 | 2868 |
| 2856 #endif // V8_ARM_LITHIUM_ARM_H_ | 2869 #endif // V8_ARM_LITHIUM_ARM_H_ |
| OLD | NEW |