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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 | 273 |
274 // Interface to the register allocator and iterators. | 274 // Interface to the register allocator and iterators. |
275 bool IsMarkedAsCall() const { return is_call_; } | 275 bool IsMarkedAsCall() const { return is_call_; } |
276 | 276 |
277 virtual bool HasResult() const = 0; | 277 virtual bool HasResult() const = 0; |
278 virtual LOperand* result() = 0; | 278 virtual LOperand* result() = 0; |
279 | 279 |
280 LOperand* FirstInput() { return InputAt(0); } | 280 LOperand* FirstInput() { return InputAt(0); } |
281 LOperand* Output() { return HasResult() ? result() : NULL; } | 281 LOperand* Output() { return HasResult() ? result() : NULL; } |
282 | 282 |
| 283 virtual bool HasInterestingComment(LCodeGen* gen) const { return true; } |
| 284 |
283 #ifdef DEBUG | 285 #ifdef DEBUG |
284 void VerifyCall(); | 286 void VerifyCall(); |
285 #endif | 287 #endif |
286 | 288 |
287 private: | 289 private: |
288 // Iterator support. | 290 // Iterator support. |
289 friend class InputIterator; | 291 friend class InputIterator; |
290 virtual int InputCount() = 0; | 292 virtual int InputCount() = 0; |
291 virtual LOperand* InputAt(int i) = 0; | 293 virtual LOperand* InputAt(int i) = 0; |
292 | 294 |
(...skipping 81 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 |
(...skipping 27 matching lines...) Expand all Loading... |
429 public: | 436 public: |
430 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 437 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
431 }; | 438 }; |
432 | 439 |
433 | 440 |
434 class LLabel: public LGap { | 441 class LLabel: public LGap { |
435 public: | 442 public: |
436 explicit LLabel(HBasicBlock* block) | 443 explicit LLabel(HBasicBlock* block) |
437 : LGap(block), replacement_(NULL) { } | 444 : LGap(block), replacement_(NULL) { } |
438 | 445 |
| 446 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
439 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 447 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
440 | 448 |
441 virtual void PrintDataTo(StringStream* stream); | 449 virtual void PrintDataTo(StringStream* stream); |
442 | 450 |
443 int block_id() const { return block()->block_id(); } | 451 int block_id() const { return block()->block_id(); } |
444 bool is_loop_header() const { return block()->IsLoopHeader(); } | 452 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 453 bool is_osr_entry() const { return block()->is_osr_entry(); } |
445 Label* label() { return &label_; } | 454 Label* label() { return &label_; } |
446 LLabel* replacement() const { return replacement_; } | 455 LLabel* replacement() const { return replacement_; } |
447 void set_replacement(LLabel* label) { replacement_ = label; } | 456 void set_replacement(LLabel* label) { replacement_ = label; } |
448 bool HasReplacement() const { return replacement_ != NULL; } | 457 bool HasReplacement() const { return replacement_ != NULL; } |
449 | 458 |
450 private: | 459 private: |
451 Label label_; | 460 Label label_; |
452 LLabel* replacement_; | 461 LLabel* replacement_; |
453 }; | 462 }; |
454 | 463 |
455 | 464 |
456 class LParameter: public LTemplateInstruction<1, 0, 0> { | 465 class LParameter: public LTemplateInstruction<1, 0, 0> { |
457 public: | 466 public: |
| 467 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
458 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 468 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
459 }; | 469 }; |
460 | 470 |
461 | 471 |
462 class LCallStub: public LTemplateInstruction<1, 0, 0> { | 472 class LCallStub: public LTemplateInstruction<1, 0, 0> { |
463 public: | 473 public: |
464 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 474 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
465 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 475 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
466 | 476 |
467 TranscendentalCache::Type transcendental_type() { | 477 TranscendentalCache::Type transcendental_type() { |
468 return hydrogen()->transcendental_type(); | 478 return hydrogen()->transcendental_type(); |
469 } | 479 } |
470 }; | 480 }; |
471 | 481 |
472 | 482 |
473 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 483 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
474 public: | 484 public: |
| 485 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
475 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 486 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
476 }; | 487 }; |
477 | 488 |
478 | 489 |
479 template<int I, int T> | 490 template<int I, int T> |
480 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 491 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
481 public: | 492 public: |
482 virtual bool IsControl() const { return true; } | 493 virtual bool IsControl() const { return true; } |
483 | 494 |
484 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 495 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2464 LOperand* key() { return inputs_[1]; } | 2475 LOperand* key() { return inputs_[1]; } |
2465 | 2476 |
2466 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 2477 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
2467 }; | 2478 }; |
2468 | 2479 |
2469 | 2480 |
2470 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 2481 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
2471 public: | 2482 public: |
2472 LOsrEntry(); | 2483 LOsrEntry(); |
2473 | 2484 |
| 2485 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
2474 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2486 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
2475 | 2487 |
2476 LOperand** SpilledRegisterArray() { return register_spills_; } | 2488 LOperand** SpilledRegisterArray() { return register_spills_; } |
2477 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 2489 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
2478 | 2490 |
2479 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 2491 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
2480 void MarkSpilledDoubleRegister(int allocation_index, | 2492 void MarkSpilledDoubleRegister(int allocation_index, |
2481 LOperand* spill_operand); | 2493 LOperand* spill_operand); |
2482 | 2494 |
2483 private: | 2495 private: |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 | 2749 |
2738 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2750 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2739 }; | 2751 }; |
2740 | 2752 |
2741 #undef DECLARE_HYDROGEN_ACCESSOR | 2753 #undef DECLARE_HYDROGEN_ACCESSOR |
2742 #undef DECLARE_CONCRETE_INSTRUCTION | 2754 #undef DECLARE_CONCRETE_INSTRUCTION |
2743 | 2755 |
2744 } } // namespace v8::int | 2756 } } // namespace v8::int |
2745 | 2757 |
2746 #endif // V8_X64_LITHIUM_X64_H_ | 2758 #endif // V8_X64_LITHIUM_X64_H_ |
OLD | NEW |