| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_COALESCED_LIVE_RANGES_H_ | 5 #ifndef V8_COALESCED_LIVE_RANGES_H_ |
| 6 #define V8_COALESCED_LIVE_RANGES_H_ | 6 #define V8_COALESCED_LIVE_RANGES_H_ |
| 7 | 7 |
| 8 #include "src/compiler/register-allocator.h" | 8 #include "src/compiler/register-allocator.h" |
| 9 #include "src/zone-containers.h" | 9 #include "src/zone-containers.h" |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 return AllocatedInterval(pos, LifetimePosition::Invalid(), nullptr); | 82 return AllocatedInterval(pos, LifetimePosition::Invalid(), nullptr); |
| 83 } | 83 } |
| 84 | 84 |
| 85 // Intersection utilities. | 85 // Intersection utilities. |
| 86 static bool Intersects(LifetimePosition a_start, LifetimePosition a_end, | 86 static bool Intersects(LifetimePosition a_start, LifetimePosition a_end, |
| 87 LifetimePosition b_start, LifetimePosition b_end) { | 87 LifetimePosition b_start, LifetimePosition b_end) { |
| 88 return a_start < b_end && b_start < a_end; | 88 return a_start < b_end && b_start < a_end; |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool QueryIntersectsAllocatedInterval() const { | 91 bool QueryIntersectsAllocatedInterval() const { |
| 92 DCHECK(query_ != nullptr); | 92 DCHECK_NOT_NULL(query_); |
| 93 return pos_ != intervals_->end() && | 93 return pos_ != intervals_->end() && |
| 94 Intersects(query_->start(), query_->end(), pos_->start_, pos_->end_); | 94 Intersects(query_->start(), query_->end(), pos_->start_, pos_->end_); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void Invalidate() { | 97 void Invalidate() { |
| 98 query_ = nullptr; | 98 query_ = nullptr; |
| 99 pos_ = intervals_->end(); | 99 pos_ = intervals_->end(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 const UseInterval* query_; | 102 const UseInterval* query_; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 IntervalStore intervals_; | 150 IntervalStore intervals_; |
| 151 DISALLOW_COPY_AND_ASSIGN(CoalescedLiveRanges); | 151 DISALLOW_COPY_AND_ASSIGN(CoalescedLiveRanges); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 | 154 |
| 155 } // namespace compiler | 155 } // namespace compiler |
| 156 } // namespace internal | 156 } // namespace internal |
| 157 } // namespace v8 | 157 } // namespace v8 |
| 158 #endif // V8_COALESCED_LIVE_RANGES_H_ | 158 #endif // V8_COALESCED_LIVE_RANGES_H_ |
| OLD | NEW |