Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Side by Side Diff: src/compiler/register-allocator.h

Issue 1403163003: Revert of [turbofan] Splinter into one range. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/compiler/live-range-separator.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void AddUseInterval(LifetimePosition start, LifetimePosition end, Zone* zone); 486 void AddUseInterval(LifetimePosition start, LifetimePosition end, Zone* zone);
487 void AddUsePosition(UsePosition* pos); 487 void AddUsePosition(UsePosition* pos);
488 488
489 // Shorten the most recently added interval by setting a new start. 489 // Shorten the most recently added interval by setting a new start.
490 void ShortenTo(LifetimePosition start); 490 void ShortenTo(LifetimePosition start);
491 491
492 // Detaches between start and end, and attributes the resulting range to 492 // Detaches between start and end, and attributes the resulting range to
493 // result. 493 // result.
494 // The current range is pointed to as "splintered_from". No parent/child 494 // The current range is pointed to as "splintered_from". No parent/child
495 // relationship is established between this and result. 495 // relationship is established between this and result.
496 void Splinter(LifetimePosition start, LifetimePosition end, Zone* zone); 496 void Splinter(LifetimePosition start, LifetimePosition end,
497 TopLevelLiveRange* result, Zone* zone);
497 498
498 // Assuming other was splintered from this range, embeds other and its 499 // Assuming other was splintered from this range, embeds other and its
499 // children as part of the children sequence of this range. 500 // children as part of the children sequence of this range.
500 void Merge(TopLevelLiveRange* other, Zone* zone); 501 void Merge(TopLevelLiveRange* other, Zone* zone);
501 502
502 // Spill range management. 503 // Spill range management.
503 void SetSpillRange(SpillRange* spill_range); 504 void SetSpillRange(SpillRange* spill_range);
504 enum class SpillType { kNoSpillType, kSpillOperand, kSpillRange }; 505 enum class SpillType { kNoSpillType, kSpillOperand, kSpillRange };
505 void set_spill_type(SpillType value) { 506 void set_spill_type(SpillType value) {
506 bits_ = SpillTypeField::update(bits_, value); 507 bits_ = SpillTypeField::update(bits_, value);
(...skipping 23 matching lines...) Expand all
530 531
531 AllocatedOperand GetSpillRangeOperand() const; 532 AllocatedOperand GetSpillRangeOperand() const;
532 533
533 void SpillAtDefinition(Zone* zone, int gap_index, 534 void SpillAtDefinition(Zone* zone, int gap_index,
534 InstructionOperand* operand); 535 InstructionOperand* operand);
535 void SetSpillOperand(InstructionOperand* operand); 536 void SetSpillOperand(InstructionOperand* operand);
536 void SetSpillStartIndex(int start) { 537 void SetSpillStartIndex(int start) {
537 spill_start_index_ = Min(start, spill_start_index_); 538 spill_start_index_ = Min(start, spill_start_index_);
538 } 539 }
539 540
541 void SetSplinteredFrom(TopLevelLiveRange* splinter_parent);
540 void CommitSpillsAtDefinition(InstructionSequence* sequence, 542 void CommitSpillsAtDefinition(InstructionSequence* sequence,
541 const InstructionOperand& operand, 543 const InstructionOperand& operand,
542 bool might_be_duplicated); 544 bool might_be_duplicated);
543 545
544 // If all the children of this range are spilled in deferred blocks, and if 546 // If all the children of this range are spilled in deferred blocks, and if
545 // for any non-spilled child with a use position requiring a slot, that range 547 // for any non-spilled child with a use position requiring a slot, that range
546 // is contained in a deferred block, mark the range as 548 // is contained in a deferred block, mark the range as
547 // IsSpilledOnlyInDeferredBlocks, so that we avoid spilling at definition, 549 // IsSpilledOnlyInDeferredBlocks, so that we avoid spilling at definition,
548 // and instead let the LiveRangeConnector perform the spills within the 550 // and instead let the LiveRangeConnector perform the spills within the
549 // deferred blocks. If so, we insert here spills for non-spilled ranges 551 // deferred blocks. If so, we insert here spills for non-spilled ranges
(...skipping 19 matching lines...) Expand all
569 return spilled_in_deferred_blocks_; 571 return spilled_in_deferred_blocks_;
570 } 572 }
571 573
572 struct SpillAtDefinitionList; 574 struct SpillAtDefinitionList;
573 575
574 SpillAtDefinitionList* spills_at_definition() const { 576 SpillAtDefinitionList* spills_at_definition() const {
575 return spills_at_definition_; 577 return spills_at_definition_;
576 } 578 }
577 void set_last_child(LiveRange* range) { last_child_ = range; } 579 void set_last_child(LiveRange* range) { last_child_ = range; }
578 LiveRange* last_child() const { return last_child_; } 580 LiveRange* last_child() const { return last_child_; }
579 TopLevelLiveRange* splinter() const { return splinter_; }
580 void SetSplinter(TopLevelLiveRange* splinter) {
581 DCHECK_NULL(splinter_);
582 DCHECK_NOT_NULL(splinter);
583
584 splinter_ = splinter;
585 splinter->relative_id_ = GetNextChildId();
586 splinter->set_spill_type(spill_type());
587 splinter->SetSplinteredFrom(this);
588 }
589 581
590 private: 582 private:
591 void SetSplinteredFrom(TopLevelLiveRange* splinter_parent);
592
593 typedef BitField<bool, 1, 1> HasSlotUseField; 583 typedef BitField<bool, 1, 1> HasSlotUseField;
594 typedef BitField<bool, 2, 1> IsPhiField; 584 typedef BitField<bool, 2, 1> IsPhiField;
595 typedef BitField<bool, 3, 1> IsNonLoopPhiField; 585 typedef BitField<bool, 3, 1> IsNonLoopPhiField;
596 typedef BitField<SpillType, 4, 2> SpillTypeField; 586 typedef BitField<SpillType, 4, 2> SpillTypeField;
597 587
598 int vreg_; 588 int vreg_;
599 int last_child_id_; 589 int last_child_id_;
600 TopLevelLiveRange* splintered_from_; 590 TopLevelLiveRange* splintered_from_;
601 union { 591 union {
602 // Correct value determined by spill_type() 592 // Correct value determined by spill_type()
603 InstructionOperand* spill_operand_; 593 InstructionOperand* spill_operand_;
604 SpillRange* spill_range_; 594 SpillRange* spill_range_;
605 }; 595 };
606 SpillAtDefinitionList* spills_at_definition_; 596 SpillAtDefinitionList* spills_at_definition_;
607 // TODO(mtrofin): generalize spilling after definition, currently specialized 597 // TODO(mtrofin): generalize spilling after definition, currently specialized
608 // just for spill in a single deferred block. 598 // just for spill in a single deferred block.
609 bool spilled_in_deferred_blocks_; 599 bool spilled_in_deferred_blocks_;
610 int spill_start_index_; 600 int spill_start_index_;
611 LiveRange* last_child_; 601 LiveRange* last_child_;
612 UsePosition* last_pos_; 602 LiveRange* last_insertion_point_;
613 TopLevelLiveRange* splinter_;
614 603
615 DISALLOW_COPY_AND_ASSIGN(TopLevelLiveRange); 604 DISALLOW_COPY_AND_ASSIGN(TopLevelLiveRange);
616 }; 605 };
617 606
618 607
619 struct PrintableLiveRange { 608 struct PrintableLiveRange {
620 const RegisterConfiguration* register_configuration_; 609 const RegisterConfiguration* register_configuration_;
621 const LiveRange* range_; 610 const LiveRange* range_;
622 }; 611 };
623 612
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 RegisterAllocationData* const data_; 1086 RegisterAllocationData* const data_;
1098 1087
1099 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector); 1088 DISALLOW_COPY_AND_ASSIGN(LiveRangeConnector);
1100 }; 1089 };
1101 1090
1102 } // namespace compiler 1091 } // namespace compiler
1103 } // namespace internal 1092 } // namespace internal
1104 } // namespace v8 1093 } // namespace v8
1105 1094
1106 #endif // V8_REGISTER_ALLOCATOR_H_ 1095 #endif // V8_REGISTER_ALLOCATOR_H_
OLDNEW
« no previous file with comments | « src/compiler/live-range-separator.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698