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 |
399 | 406 |
400 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { | 407 class LLazyBailout: public LTemplateInstruction<0, 0, 0> { |
401 public: | 408 public: |
| 409 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
402 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") | 410 DECLARE_CONCRETE_INSTRUCTION(LazyBailout, "lazy-bailout") |
403 }; | 411 }; |
404 | 412 |
405 | 413 |
406 class LDummyUse: public LTemplateInstruction<1, 1, 0> { | 414 class LDummyUse: public LTemplateInstruction<1, 1, 0> { |
407 public: | 415 public: |
408 explicit LDummyUse(LOperand* value) { | 416 explicit LDummyUse(LOperand* value) { |
409 inputs_[0] = value; | 417 inputs_[0] = value; |
410 } | 418 } |
411 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") | 419 DECLARE_CONCRETE_INSTRUCTION(DummyUse, "dummy-use") |
412 }; | 420 }; |
413 | 421 |
414 | 422 |
415 class LDeoptimize: public LTemplateInstruction<0, 0, 0> { | 423 class LDeoptimize: public LTemplateInstruction<0, 0, 0> { |
416 public: | 424 public: |
417 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") | 425 DECLARE_CONCRETE_INSTRUCTION(Deoptimize, "deoptimize") |
418 }; | 426 }; |
419 | 427 |
420 | 428 |
421 class LLabel: public LGap { | 429 class LLabel: public LGap { |
422 public: | 430 public: |
423 explicit LLabel(HBasicBlock* block) | 431 explicit LLabel(HBasicBlock* block) |
424 : LGap(block), replacement_(NULL) { } | 432 : LGap(block), replacement_(NULL) { } |
425 | 433 |
| 434 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
426 DECLARE_CONCRETE_INSTRUCTION(Label, "label") | 435 DECLARE_CONCRETE_INSTRUCTION(Label, "label") |
427 | 436 |
428 virtual void PrintDataTo(StringStream* stream); | 437 virtual void PrintDataTo(StringStream* stream); |
429 | 438 |
430 int block_id() const { return block()->block_id(); } | 439 int block_id() const { return block()->block_id(); } |
431 bool is_loop_header() const { return block()->IsLoopHeader(); } | 440 bool is_loop_header() const { return block()->IsLoopHeader(); } |
| 441 bool is_osr_entry() const { return block()->is_osr_entry(); } |
432 Label* label() { return &label_; } | 442 Label* label() { return &label_; } |
433 LLabel* replacement() const { return replacement_; } | 443 LLabel* replacement() const { return replacement_; } |
434 void set_replacement(LLabel* label) { replacement_ = label; } | 444 void set_replacement(LLabel* label) { replacement_ = label; } |
435 bool HasReplacement() const { return replacement_ != NULL; } | 445 bool HasReplacement() const { return replacement_ != NULL; } |
436 | 446 |
437 private: | 447 private: |
438 Label label_; | 448 Label label_; |
439 LLabel* replacement_; | 449 LLabel* replacement_; |
440 }; | 450 }; |
441 | 451 |
442 | 452 |
443 class LParameter: public LTemplateInstruction<1, 0, 0> { | 453 class LParameter: public LTemplateInstruction<1, 0, 0> { |
444 public: | 454 public: |
| 455 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
445 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") | 456 DECLARE_CONCRETE_INSTRUCTION(Parameter, "parameter") |
446 }; | 457 }; |
447 | 458 |
448 | 459 |
449 class LCallStub: public LTemplateInstruction<1, 1, 0> { | 460 class LCallStub: public LTemplateInstruction<1, 1, 0> { |
450 public: | 461 public: |
451 explicit LCallStub(LOperand* context) { | 462 explicit LCallStub(LOperand* context) { |
452 inputs_[0] = context; | 463 inputs_[0] = context; |
453 } | 464 } |
454 | 465 |
455 LOperand* context() { return inputs_[0]; } | 466 LOperand* context() { return inputs_[0]; } |
456 | 467 |
457 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") | 468 DECLARE_CONCRETE_INSTRUCTION(CallStub, "call-stub") |
458 DECLARE_HYDROGEN_ACCESSOR(CallStub) | 469 DECLARE_HYDROGEN_ACCESSOR(CallStub) |
459 | 470 |
460 TranscendentalCache::Type transcendental_type() { | 471 TranscendentalCache::Type transcendental_type() { |
461 return hydrogen()->transcendental_type(); | 472 return hydrogen()->transcendental_type(); |
462 } | 473 } |
463 }; | 474 }; |
464 | 475 |
465 | 476 |
466 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { | 477 class LUnknownOSRValue: public LTemplateInstruction<1, 0, 0> { |
467 public: | 478 public: |
| 479 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
468 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") | 480 DECLARE_CONCRETE_INSTRUCTION(UnknownOSRValue, "unknown-osr-value") |
469 }; | 481 }; |
470 | 482 |
471 | 483 |
472 template<int I, int T> | 484 template<int I, int T> |
473 class LControlInstruction: public LTemplateInstruction<0, I, T> { | 485 class LControlInstruction: public LTemplateInstruction<0, I, T> { |
474 public: | 486 public: |
475 virtual bool IsControl() const { return true; } | 487 virtual bool IsControl() const { return true; } |
476 | 488 |
477 int SuccessorCount() { return hydrogen()->SuccessorCount(); } | 489 int SuccessorCount() { return hydrogen()->SuccessorCount(); } |
(...skipping 2188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2666 LOperand* key() { return inputs_[2]; } | 2678 LOperand* key() { return inputs_[2]; } |
2667 | 2679 |
2668 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") | 2680 DECLARE_CONCRETE_INSTRUCTION(DeleteProperty, "delete-property") |
2669 }; | 2681 }; |
2670 | 2682 |
2671 | 2683 |
2672 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { | 2684 class LOsrEntry: public LTemplateInstruction<0, 0, 0> { |
2673 public: | 2685 public: |
2674 LOsrEntry(); | 2686 LOsrEntry(); |
2675 | 2687 |
| 2688 virtual bool HasInterestingComment(LCodeGen* gen) const { return false; } |
2676 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") | 2689 DECLARE_CONCRETE_INSTRUCTION(OsrEntry, "osr-entry") |
2677 | 2690 |
2678 LOperand** SpilledRegisterArray() { return register_spills_; } | 2691 LOperand** SpilledRegisterArray() { return register_spills_; } |
2679 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } | 2692 LOperand** SpilledDoubleRegisterArray() { return double_register_spills_; } |
2680 | 2693 |
2681 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); | 2694 void MarkSpilledRegister(int allocation_index, LOperand* spill_operand); |
2682 void MarkSpilledDoubleRegister(int allocation_index, | 2695 void MarkSpilledDoubleRegister(int allocation_index, |
2683 LOperand* spill_operand); | 2696 LOperand* spill_operand); |
2684 | 2697 |
2685 private: | 2698 private: |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2975 | 2988 |
2976 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); | 2989 DISALLOW_COPY_AND_ASSIGN(LChunkBuilder); |
2977 }; | 2990 }; |
2978 | 2991 |
2979 #undef DECLARE_HYDROGEN_ACCESSOR | 2992 #undef DECLARE_HYDROGEN_ACCESSOR |
2980 #undef DECLARE_CONCRETE_INSTRUCTION | 2993 #undef DECLARE_CONCRETE_INSTRUCTION |
2981 | 2994 |
2982 } } // namespace v8::internal | 2995 } } // namespace v8::internal |
2983 | 2996 |
2984 #endif // V8_IA32_LITHIUM_IA32_H_ | 2997 #endif // V8_IA32_LITHIUM_IA32_H_ |
OLD | NEW |