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

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

Issue 1080953006: Revert of Introducing the LLVM greedy register allocator. (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 | « src/compiler/pipeline.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 760bbabbe0d4fdd968924efaa25e15eb89c680b4..2f342dd94958696b0ed5ac9a60562055123218af 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -585,14 +585,11 @@
class RegisterAllocator : public ZoneObject {
public:
- explicit RegisterAllocator(RegisterAllocationData* data, RegisterKind kind);
+ explicit RegisterAllocator(RegisterAllocationData* data);
protected:
RegisterAllocationData* data() const { return data_; }
InstructionSequence* code() const { return data()->code(); }
- RegisterKind mode() const { return mode_; }
- int num_registers() const { return num_registers_; }
-
Zone* allocation_zone() const { return data()->allocation_zone(); }
LiveRange* LiveRangeFor(int index) { return data()->LiveRangeFor(index); }
@@ -624,8 +621,6 @@
private:
RegisterAllocationData* const data_;
- const RegisterKind mode_;
- const int num_registers_;
DISALLOW_COPY_AND_ASSIGN(RegisterAllocator);
};
@@ -640,6 +635,7 @@
void AllocateRegisters();
private:
+ int num_registers() const { return num_registers_; }
const char* RegisterName(int allocation_index) const;
ZoneVector<LiveRange*>& unhandled_live_ranges() {
@@ -681,6 +677,9 @@
void SplitAndSpillIntersecting(LiveRange* range);
+ const RegisterKind mode_;
+ const int num_registers_;
+
ZoneVector<LiveRange*> unhandled_live_ranges_;
ZoneVector<LiveRange*> active_live_ranges_;
ZoneVector<LiveRange*> inactive_live_ranges_;
@@ -690,46 +689,6 @@
#endif
DISALLOW_COPY_AND_ASSIGN(LinearScanAllocator);
-};
-
-class CoallescedLiveRanges;
-
-
-// A variant of the LLVM Greedy Register Allocator. See
-// http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html
-class GreedyAllocator final : public RegisterAllocator {
- public:
- explicit GreedyAllocator(RegisterAllocationData* data, RegisterKind kind,
- Zone* local_zone);
-
- void AllocateRegisters();
-
- private:
- const RegisterConfiguration* config() const { return data()->config(); }
-
- typedef ZonePriorityQueue<std::pair<unsigned, LiveRange*>> PQueue;
-
- unsigned GetLiveRangeSize(LiveRange* range);
- void Enqueue(LiveRange* range);
-
- void Evict(LiveRange* range);
- float CalculateSpillWeight(LiveRange* range);
- float CalculateMaxSpillWeight(const ZoneSet<LiveRange*>& ranges);
-
-
- bool TryAllocate(LiveRange* current, ZoneSet<LiveRange*>* conflicting);
- bool TryAllocatePhysicalRegister(unsigned reg_id, LiveRange* range,
- ZoneSet<LiveRange*>* conflicting);
- bool HandleSpillOperands(LiveRange* range);
- bool AllocateBlockedRange(LiveRange*, const ZoneSet<LiveRange*>&);
-
- LiveRange* SpillBetweenUntil(LiveRange* range, LifetimePosition start,
- LifetimePosition until, LifetimePosition end);
- void AssignRangeToRegister(int reg_id, LiveRange* range);
-
- ZoneVector<CoallescedLiveRanges*> allocations_;
- PQueue queue_;
- DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
};
« no previous file with comments | « src/compiler/pipeline.cc ('k') | src/compiler/register-allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698