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

Unified Diff: src/compiler/register-allocator.h

Issue 793323002: [turbofan] update SpillRange to use ZoneVector (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.h
diff --git a/src/compiler/register-allocator.h b/src/compiler/register-allocator.h
index 2db5189ee16a7062ff6c1419d59ede92838b55fd..c6d763c5b3585ad81ee8a45206a0a29227c1e113 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -105,7 +105,7 @@ class LifetimePosition FINAL {
class UseInterval FINAL : public ZoneObject {
public:
UseInterval(LifetimePosition start, LifetimePosition end)
- : start_(start), end_(end), next_(NULL) {
+ : start_(start), end_(end), next_(nullptr) {
DCHECK(start.Value() < end.Value());
}
@@ -148,7 +148,7 @@ class UsePosition FINAL : public ZoneObject {
InstructionOperand* hint);
InstructionOperand* operand() const { return operand_; }
- bool HasOperand() const { return operand_ != NULL; }
+ bool HasOperand() const { return operand_ != nullptr; }
InstructionOperand* hint() const { return hint_; }
bool HasHint() const;
@@ -184,15 +184,15 @@ class LiveRange FINAL : public ZoneObject {
UseInterval* first_interval() const { return first_interval_; }
UsePosition* first_pos() const { return first_pos_; }
LiveRange* parent() const { return parent_; }
- LiveRange* TopLevel() { return (parent_ == NULL) ? this : parent_; }
+ LiveRange* TopLevel() { return (parent_ == nullptr) ? this : parent_; }
const LiveRange* TopLevel() const {
- return (parent_ == NULL) ? this : parent_;
+ return (parent_ == nullptr) ? this : parent_;
}
LiveRange* next() const { return next_; }
- bool IsChild() const { return parent() != NULL; }
+ bool IsChild() const { return parent() != nullptr; }
int id() const { return id_; }
bool IsFixed() const { return id_ < 0; }
- bool IsEmpty() const { return first_interval() == NULL; }
+ bool IsEmpty() const { return first_interval() == nullptr; }
InstructionOperand* CreateAssignedOperand(Zone* zone) const;
int assigned_register() const { return assigned_register_; }
int spill_start_index() const { return spill_start_index_; }
@@ -245,9 +245,9 @@ class LiveRange FINAL : public ZoneObject {
}
InstructionOperand* FirstHint() const {
UsePosition* pos = first_pos_;
- while (pos != NULL && !pos->HasHint()) pos = pos->next();
- if (pos != NULL) return pos->hint();
- return NULL;
+ while (pos != nullptr && !pos->HasHint()) pos = pos->next();
+ if (pos != nullptr) return pos->hint();
+ return nullptr;
}
LifetimePosition Start() const {
@@ -345,26 +345,28 @@ class LiveRange FINAL : public ZoneObject {
};
-class SpillRange : public ZoneObject {
+class SpillRange FINAL : public ZoneObject {
public:
- SpillRange(LiveRange* range, int id, Zone* zone);
- bool TryMerge(SpillRange* other, Zone* zone);
+ SpillRange(LiveRange* range, Zone* zone);
+
+ UseInterval* interval() const { return use_interval_; }
+ RegisterKind Kind() const { return live_ranges_[0]->Kind(); }
+ bool IsEmpty() const { return live_ranges_.empty(); }
+ bool TryMerge(SpillRange* other);
void SetOperand(InstructionOperand* op);
- bool IsEmpty() { return live_ranges_.length() == 0; }
- int id() const { return id_; }
- UseInterval* interval() { return use_interval_; }
- RegisterKind Kind() const { return live_ranges_.at(0)->Kind(); }
- LifetimePosition End() const { return end_position_; }
- bool IsIntersectingWith(SpillRange* other);
private:
- int id_;
- ZoneList<LiveRange*> live_ranges_;
+ LifetimePosition End() const { return end_position_; }
+ ZoneVector<LiveRange*>& live_ranges() { return live_ranges_; }
+ bool IsIntersectingWith(SpillRange* other) const;
+ // Merge intervals, making sure the use intervals are sorted
+ void MergeDisjointIntervals(UseInterval* other);
+
+ ZoneVector<LiveRange*> live_ranges_;
UseInterval* use_interval_;
LifetimePosition end_position_;
- // Merge intervals, making sure the use intervals are sorted
- void MergeDisjointIntervals(UseInterval* other, Zone* zone);
+ DISALLOW_COPY_AND_ASSIGN(SpillRange);
};
« no previous file with comments | « src/compiler/graph-visualizer.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698