OLD | NEW |
---|---|
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_REGISTER_ALLOCATOR_H_ | 5 #ifndef V8_REGISTER_ALLOCATOR_H_ |
6 #define V8_REGISTER_ALLOCATOR_H_ | 6 #define V8_REGISTER_ALLOCATOR_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 #include "src/ostreams.h" | 9 #include "src/ostreams.h" |
10 #include "src/register-configuration.h" | 10 #include "src/register-configuration.h" |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
587 void SetSplinter(TopLevelLiveRange* splinter) { | 587 void SetSplinter(TopLevelLiveRange* splinter) { |
588 DCHECK_NULL(splinter_); | 588 DCHECK_NULL(splinter_); |
589 DCHECK_NOT_NULL(splinter); | 589 DCHECK_NOT_NULL(splinter); |
590 | 590 |
591 splinter_ = splinter; | 591 splinter_ = splinter; |
592 splinter->relative_id_ = GetNextChildId(); | 592 splinter->relative_id_ = GetNextChildId(); |
593 splinter->set_spill_type(spill_type()); | 593 splinter->set_spill_type(spill_type()); |
594 splinter->SetSplinteredFrom(this); | 594 splinter->SetSplinteredFrom(this); |
595 } | 595 } |
596 | 596 |
597 void MarkElidableDef(MoveOperands* move) { | |
Jarin
2015/11/12 12:08:33
elidable -> elidible (here and elsewhere)
| |
598 DCHECK_NULL(elidable_def_); | |
599 elidable_def_ = move; | |
600 } | |
601 | |
602 MoveOperands* elidable_def() const { return elidable_def_; } | |
603 bool IsReferenceAccountedByCaller() const { return elidable_def_ != nullptr; } | |
604 | |
597 private: | 605 private: |
598 void SetSplinteredFrom(TopLevelLiveRange* splinter_parent); | 606 void SetSplinteredFrom(TopLevelLiveRange* splinter_parent); |
599 | 607 |
600 typedef BitField<bool, 1, 1> HasSlotUseField; | 608 typedef BitField<bool, 1, 1> HasSlotUseField; |
601 typedef BitField<bool, 2, 1> IsPhiField; | 609 typedef BitField<bool, 2, 1> IsPhiField; |
602 typedef BitField<bool, 3, 1> IsNonLoopPhiField; | 610 typedef BitField<bool, 3, 1> IsNonLoopPhiField; |
603 typedef BitField<SpillType, 4, 2> SpillTypeField; | 611 typedef BitField<SpillType, 4, 2> SpillTypeField; |
604 | 612 |
605 int vreg_; | 613 int vreg_; |
606 int last_child_id_; | 614 int last_child_id_; |
607 TopLevelLiveRange* splintered_from_; | 615 TopLevelLiveRange* splintered_from_; |
608 union { | 616 union { |
609 // Correct value determined by spill_type() | 617 // Correct value determined by spill_type() |
610 InstructionOperand* spill_operand_; | 618 InstructionOperand* spill_operand_; |
611 SpillRange* spill_range_; | 619 SpillRange* spill_range_; |
612 }; | 620 }; |
613 SpillAtDefinitionList* spills_at_definition_; | 621 SpillAtDefinitionList* spills_at_definition_; |
614 // TODO(mtrofin): generalize spilling after definition, currently specialized | 622 // TODO(mtrofin): generalize spilling after definition, currently specialized |
615 // just for spill in a single deferred block. | 623 // just for spill in a single deferred block. |
616 bool spilled_in_deferred_blocks_; | 624 bool spilled_in_deferred_blocks_; |
617 int spill_start_index_; | 625 int spill_start_index_; |
618 LiveRange* last_child_; | 626 LiveRange* last_child_; |
619 UsePosition* last_pos_; | 627 UsePosition* last_pos_; |
620 TopLevelLiveRange* splinter_; | 628 TopLevelLiveRange* splinter_; |
629 MoveOperands* elidable_def_; | |
621 | 630 |
622 DISALLOW_COPY_AND_ASSIGN(TopLevelLiveRange); | 631 DISALLOW_COPY_AND_ASSIGN(TopLevelLiveRange); |
623 }; | 632 }; |
624 | 633 |
625 | 634 |
626 struct PrintableLiveRange { | 635 struct PrintableLiveRange { |
627 const RegisterConfiguration* register_configuration_; | 636 const RegisterConfiguration* register_configuration_; |
628 const LiveRange* range_; | 637 const LiveRange* range_; |
629 }; | 638 }; |
630 | 639 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1117 RegisterAllocationData* const data_; | 1126 RegisterAllocationData* const data_; |
1118 | 1127 |
1119 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); | 1128 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); |
1120 }; | 1129 }; |
1121 | 1130 |
1122 } // namespace compiler | 1131 } // namespace compiler |
1123 } // namespace internal | 1132 } // namespace internal |
1124 } // namespace v8 | 1133 } // namespace v8 |
1125 | 1134 |
1126 #endif // V8_REGISTER_ALLOCATOR_H_ | 1135 #endif // V8_REGISTER_ALLOCATOR_H_ |
OLD | NEW |