| 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 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 271 |
| 272 virtual bool HasResult() const = 0; | 272 virtual bool HasResult() const = 0; |
| 273 virtual LOperand* result() = 0; | 273 virtual LOperand* result() = 0; |
| 274 | 274 |
| 275 bool HasDoubleRegisterResult(); | 275 bool HasDoubleRegisterResult(); |
| 276 bool HasDoubleRegisterInput(); | 276 bool HasDoubleRegisterInput(); |
| 277 | 277 |
| 278 LOperand* FirstInput() { return InputAt(0); } | 278 LOperand* FirstInput() { return InputAt(0); } |
| 279 LOperand* Output() { return HasResult() ? result() : NULL; } | 279 LOperand* Output() { return HasResult() ? result() : NULL; } |
| 280 | 280 |
| 281 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
| 282 |
| 281 #ifdef DEBUG | 283 #ifdef DEBUG |
| 282 void VerifyCall(); | 284 void VerifyCall(); |
| 283 #endif | 285 #endif |
| 284 | 286 |
| 285 private: | 287 private: |
| 286 // Iterator support. | 288 // Iterator support. |
| 287 friend class InputIterator; | 289 friend class InputIterator; |
| 288 virtual int InputCount() = 0; | 290 virtual int InputCount() = 0; |
| 289 virtual LOperand* InputAt(int i) = 0; | 291 virtual LOperand* InputAt(int i) = 0; |
| 290 | 292 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; | 373 LParallelMove* parallel_moves_[LAST_INNER_POSITION + 1]; |
| 372 HBasicBlock* block_; | 374 HBasicBlock* block_; |
| 373 }; | 375 }; |
| 374 | 376 |
| 375 | 377 |
| 376 class LInstructionGap: public LGap { | 378 class LInstructionGap: public LGap { |
| 377 public: | 379 public: |
| 378 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } | 380 explicit LInstructionGap(HBasicBlock* block) : LGap(block) { } |
| 379 virtual bool ClobbersDoubleRegisters() const { return false; } | 381 virtual bool ClobbersDoubleRegisters() const { return false; } |
| 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 17 matching lines...) Expand all Loading... |
| 416 public: | 423 public: |
| 417 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 424 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
| 418 }; | 425 }; |
| 419 | 426 |
| 420 | 427 |
| 421 class LLabel: public LGap { | 428 class LLabel: public LGap { |
| 422 public: | 429 public: |
| 423 explicit LLabel(HBasicBlock* block) | 430 explicit LLabel(HBasicBlock* block) |
| 424 : LGap(block), replacement_(NULL) { } | 431 : LGap(block), replacement_(NULL) { } |
| 425 | 432 |
| 433 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 426 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 434 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
| 427 | 435 |
| 428 virtual void PrintDataTo(StringStream* stream); | 436 virtual void PrintDataTo(StringStream* stream); |
| 429 | 437 |
| 430 int block_id() const { return block()->block_id(); } | 438 int block_id() const { return block()->block_id(); } |
| 431 bool is_loop_header() const { return block()->IsLoopHeader(); } | 439 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 440 bool is_osr_entry() const { return block()->is_osr_entry(); } |
| 432 Label* label() { return &label_; } | 441 Label* label() { return &label_; } |
| 433 LLabel* replacement() const { return replacement_; } | 442 LLabel* replacement() const { return replacement_; } |
| 434 void set_replacement(LLabel* label) { replacement_ = label; } | 443 void set_replacement(LLabel* label) { replacement_ = label; } |
| 435 bool HasReplacement() const { return replacement_ != NULL; } | 444 bool HasReplacement() const { return replacement_ != NULL; } |
| 436 | 445 |
| 437 private: | 446 private: |
| 438 Label label_; | 447 Label label_; |
| 439 LLabel* replacement_; | 448 LLabel* replacement_; |
| 440 }; | 449 }; |
| 441 | 450 |
| 442 | 451 |
| 443 class LParameter: public LTemplateInstruction<1, 0, 0> { | 452 class LParameter: public LTemplateInstruction<1, 0, 0> { |
| 444 public: | 453 public: |
| 454 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 445 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 455 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
| 446 }; | 456 }; |
| 447 | 457 |
| 448 | 458 |
| 449 class LCallStub: public LTemplateInstruction<1, 1, 0> { | 459 class LCallStub: public LTemplateInstruction<1, 1, 0> { |
| 450 public: | 460 public: |
| 451 explicit LCallStub(LOperand* context) { | 461 explicit LCallStub(LOperand* context) { |
| 452 inputs_[0] = context; | 462 inputs_[0] = context; |
| 453 } | 463 } |
| 454 | 464 |
| 455 LOperand* context() { return inputs_[0]; } | 465 LOperand* context() { return inputs_[0]; } |
| 456 | 466 |
| 457 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 467 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
| 458 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 468 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
| 459 | 469 |
| 460 TranscendentalCache::Type transcendental_type() { | 470 TranscendentalCache::Type transcendental_type() { |
| 461 return hydrogen()->transcendental_type(); | 471 return hydrogen()->transcendental_type(); |
| 462 } | 472 } |
| 463 }; | 473 }; |
| 464 | 474 |
| 465 | 475 |
| 466 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 476 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
| 467 public: | 477 public: |
| 478 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 468 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 479 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
| 469 }; | 480 }; |
| 470 | 481 |
| 471 | 482 |
| 472 template<int I, int T> | 483 template<int I, int T> |
| 473 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 484 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
| 474 public: | 485 public: |
| 475 virtual bool IsControl() const { return true; } | 486 virtual bool IsControl() const { return true; } |
| 476 | 487 |
| 477 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 488 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
| (...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 LOperand* key() { return inputs_[2]; } | 2677 LOperand* key() { return inputs_[2]; } |
| 2667 | 2678 |
| 2668 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 2679 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
| 2669 }; | 2680 }; |
| 2670 | 2681 |
| 2671 | 2682 |
| 2672 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 2683 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
| 2673 public: | 2684 public: |
| 2674 LOsrEntry(); | 2685 LOsrEntry(); |
| 2675 | 2686 |
| 2687 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
| 2676 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2688 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
| 2677 | 2689 |
| 2678 LOperand** SpilledRegisterArray() { return register_spills_; } | 2690 LOperand** SpilledRegisterArray() { return register_spills_; } |
| 2679 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 2691 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
| 2680 | 2692 |
| 2681 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 2693 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
| 2682 void MarkSpilledDoubleRegister(int allocation_index, | 2694 void MarkSpilledDoubleRegister(int allocation_index, |
| 2683 LOperand* spill_operand); | 2695 LOperand* spill_operand); |
| 2684 | 2696 |
| 2685 private: | 2697 private: |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2975 | 2987 |
| 2976 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2988 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
| 2977 }; | 2989 }; |
| 2978 | 2990 |
| 2979 #undef DECLARE_HYDROGEN_ACCESSOR | 2991 #undef DECLARE_HYDROGEN_ACCESSOR |
| 2980 #undef DECLARE_CONCRETE_INSTRUCTION | 2992 #undef DECLARE_CONCRETE_INSTRUCTION |
| 2981 | 2993 |
| 2982 } } // namespace v8::internal | 2994 } } // namespace v8::internal |
| 2983 | 2995 |
| 2984 #endif // V8_IA32_LITHIUM_IA32_H_ | 2996 #endif // V8_IA32_LITHIUM_IA32_H_ |
| OLD | NEW |