summaryrefslogtreecommitdiff
path: root/deps/v8/src/compiler/backend/register-allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/compiler/backend/register-allocator.h')
-rw-r--r--deps/v8/src/compiler/backend/register-allocator.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/deps/v8/src/compiler/backend/register-allocator.h b/deps/v8/src/compiler/backend/register-allocator.h
index 8929fb2ee6..55f8a8dd1f 100644
--- a/deps/v8/src/compiler/backend/register-allocator.h
+++ b/deps/v8/src/compiler/backend/register-allocator.h
@@ -16,6 +16,9 @@
namespace v8 {
namespace internal {
+
+class TickCounter;
+
namespace compiler {
static const int32_t kUnassignedRegister = RegisterConfiguration::kMaxRegisters;
@@ -175,7 +178,8 @@ std::ostream& operator<<(std::ostream& os, const LifetimePosition pos);
enum class RegisterAllocationFlag : unsigned {
kTurboControlFlowAwareAllocation = 1 << 0,
- kTurboPreprocessRanges = 1 << 1
+ kTurboPreprocessRanges = 1 << 1,
+ kTraceAllocation = 1 << 2
};
using RegisterAllocationFlags = base::Flags<RegisterAllocationFlag>;
@@ -198,6 +202,10 @@ class RegisterAllocationData final : public ZoneObject {
return flags_ & RegisterAllocationFlag::kTurboPreprocessRanges;
}
+ bool is_trace_alloc() {
+ return flags_ & RegisterAllocationFlag::kTraceAllocation;
+ }
+
static constexpr int kNumberOfFixedRangesPerRegister = 2;
class PhiMapValue : public ZoneObject {
@@ -238,6 +246,7 @@ class RegisterAllocationData final : public ZoneObject {
Zone* allocation_zone, Frame* frame,
InstructionSequence* code,
RegisterAllocationFlags flags,
+ TickCounter* tick_counter,
const char* debug_name = nullptr);
const ZoneVector<TopLevelLiveRange*>& live_ranges() const {
@@ -328,6 +337,8 @@ class RegisterAllocationData final : public ZoneObject {
void ResetSpillState() { spill_state_.clear(); }
+ TickCounter* tick_counter() { return tick_counter_; }
+
private:
int GetNextLiveRangeId();
@@ -354,6 +365,7 @@ class RegisterAllocationData final : public ZoneObject {
RangesWithPreassignedSlots preassigned_slot_ranges_;
ZoneVector<ZoneVector<LiveRange*>> spill_state_;
RegisterAllocationFlags flags_;
+ TickCounter* const tick_counter_;
DISALLOW_COPY_AND_ASSIGN(RegisterAllocationData);
};
@@ -741,7 +753,7 @@ class LiveRangeBundle : public ZoneObject {
: ranges_(zone), uses_(zone), id_(id) {}
bool TryAddRange(LiveRange* range);
- bool TryMerge(LiveRangeBundle* other);
+ bool TryMerge(LiveRangeBundle* other, bool trace_alloc);
ZoneSet<LiveRange*, LiveRangeOrdering> ranges_;
ZoneSet<Range, RangeOrdering> uses_;
@@ -785,12 +797,14 @@ class V8_EXPORT_PRIVATE TopLevelLiveRange final : public LiveRange {
SlotUseKind slot_use_kind() const { return HasSlotUseField::decode(bits_); }
// Add a new interval or a new use position to this live range.
- void EnsureInterval(LifetimePosition start, LifetimePosition end, Zone* zone);
- void AddUseInterval(LifetimePosition start, LifetimePosition end, Zone* zone);
- void AddUsePosition(UsePosition* pos);
+ void EnsureInterval(LifetimePosition start, LifetimePosition end, Zone* zone,
+ bool trace_alloc);
+ void AddUseInterval(LifetimePosition start, LifetimePosition end, Zone* zone,
+ bool trace_alloc);
+ void AddUsePosition(UsePosition* pos, bool trace_alloc);
// Shorten the most recently added interval by setting a new start.
- void ShortenTo(LifetimePosition start);
+ void ShortenTo(LifetimePosition start, bool trace_alloc);
// Detaches between start and end, and attributes the resulting range to
// result.
@@ -1279,11 +1293,13 @@ class LinearScanAllocator final : public RegisterAllocator {
RangeWithRegister::Equals>;
void MaybeUndoPreviousSplit(LiveRange* range);
- void SpillNotLiveRanges(RangeWithRegisterSet& to_be_live,
- LifetimePosition position, SpillMode spill_mode);
+ void SpillNotLiveRanges(
+ RangeWithRegisterSet& to_be_live, // NOLINT(runtime/references)
+ LifetimePosition position, SpillMode spill_mode);
LiveRange* AssignRegisterOnReload(LiveRange* range, int reg);
- void ReloadLiveRanges(RangeWithRegisterSet& to_be_live,
- LifetimePosition position);
+ void ReloadLiveRanges(
+ RangeWithRegisterSet& to_be_live, // NOLINT(runtime/references)
+ LifetimePosition position);
void UpdateDeferredFixedRanges(SpillMode spill_mode, InstructionBlock* block);
bool BlockIsDeferredOrImmediatePredecessorIsNotDeferred(