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

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

Issue 1056063004: [turbofan] make live ranges stateless (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | 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 47ff02a7ae61924fa4bba696fac997f573917ea0..2f342dd94958696b0ed5ac9a60562055123218af 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -246,25 +246,24 @@ class LiveRange final : public ZoneObject {
// Returns use position in this live range that follows both start
// and last processed use position.
- // Modifies internal state of live range!
- UsePosition* NextUsePosition(LifetimePosition start);
+ UsePosition* NextUsePosition(LifetimePosition start) const;
// Returns use position for which register is required in this live
// range and which follows both start and last processed use position
- // Modifies internal state of live range!
- UsePosition* NextRegisterPosition(LifetimePosition start);
+ UsePosition* NextRegisterPosition(LifetimePosition start) const;
// Returns use position for which register is beneficial in this live
// range and which follows both start and last processed use position
- // Modifies internal state of live range!
- UsePosition* NextUsePositionRegisterIsBeneficial(LifetimePosition start);
+ UsePosition* NextUsePositionRegisterIsBeneficial(
+ LifetimePosition start) const;
// Returns use position for which register is beneficial in this live
// range and which precedes start.
- UsePosition* PreviousUsePositionRegisterIsBeneficial(LifetimePosition start);
+ UsePosition* PreviousUsePositionRegisterIsBeneficial(
+ LifetimePosition start) const;
// Can this live range be spilled at this position.
- bool CanBeSpilled(LifetimePosition pos);
+ bool CanBeSpilled(LifetimePosition pos) const;
// Split this live range at the given position which must follow the start of
// the range.
@@ -330,8 +329,8 @@ class LiveRange final : public ZoneObject {
bool ShouldBeAllocatedBefore(const LiveRange* other) const;
bool CanCover(LifetimePosition position) const;
- bool Covers(LifetimePosition position);
- LifetimePosition FirstIntersection(LiveRange* other);
+ bool Covers(LifetimePosition position) const;
+ LifetimePosition FirstIntersection(LiveRange* other) const;
// Add a new interval or a new use position to this live range.
void EnsureInterval(LifetimePosition start, LifetimePosition end, Zone* zone);
@@ -373,9 +372,10 @@ class LiveRange final : public ZoneObject {
LiveRange* next_;
// This is used as a cache, it doesn't affect correctness.
mutable UseInterval* current_interval_;
- UsePosition* last_processed_use_;
+ // This is used as a cache, it doesn't affect correctness.
+ mutable UsePosition* last_processed_use_;
// This is used as a cache, it's invalid outside of BuildLiveRanges.
- InstructionOperand* current_hint_operand_;
+ mutable InstructionOperand* current_hint_operand_;
int spill_start_index_;
SpillType spill_type_;
union {
« no previous file with comments | « no previous file | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698