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

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

Issue 1105793002: Greedy reg alloc - better splitting (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 163dd2ca30698ca9dbe997f6912836c5f26c9b80..baffedd919292c93e68b263793f3424c30aa0aaa 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -6,6 +6,7 @@
#define V8_REGISTER_ALLOCATOR_H_
#include "src/compiler/instruction.h"
+#include "src/ostreams.h"
#include "src/zone-containers.h"
namespace v8 {
@@ -152,6 +153,9 @@ class LifetimePosition final {
};
+std::ostream& operator<<(std::ostream& os, const LifetimePosition pos);
+
+
// Representation of the non-empty interval [start,end[.
class UseInterval final : public ZoneObject {
public:
@@ -468,6 +472,16 @@ class LiveRange final : public ZoneObject {
};
+struct PrintableLiveRange {
+ const RegisterConfiguration* register_configuration_;
+ const LiveRange* range_;
+};
+
+
+std::ostream& operator<<(std::ostream& os,
+ const PrintableLiveRange& printable_range);
+
+
class SpillRange final : public ZoneObject {
public:
static const int kUnassignedSlot = -1;
@@ -826,7 +840,7 @@ class LinearScanAllocator final : public RegisterAllocator {
DISALLOW_COPY_AND_ASSIGN(LinearScanAllocator);
};
-class CoallescedLiveRanges;
+class CoalescedLiveRanges;
// A variant of the LLVM Greedy Register Allocator. See
@@ -839,7 +853,11 @@ class GreedyAllocator final : public RegisterAllocator {
void AllocateRegisters();
private:
+ LifetimePosition GetSplittablePos(LifetimePosition pos);
const RegisterConfiguration* config() const { return data()->config(); }
+ Zone* local_zone() const { return local_zone_; }
+ bool TryReuseSpillForPhi(LiveRange* range);
+ int GetHintedRegister(LiveRange* range);
typedef ZonePriorityQueue<std::pair<unsigned, LiveRange*>> PQueue;
@@ -855,13 +873,18 @@ class GreedyAllocator final : public RegisterAllocator {
bool TryAllocatePhysicalRegister(unsigned reg_id, LiveRange* range,
ZoneSet<LiveRange*>* conflicting);
bool HandleSpillOperands(LiveRange* range);
- bool AllocateBlockedRange(LiveRange*, const ZoneSet<LiveRange*>&);
+ void AllocateBlockedRange(LiveRange* current, LifetimePosition pos,
+ bool spill);
LiveRange* SpillBetweenUntil(LiveRange* range, LifetimePosition start,
LifetimePosition until, LifetimePosition end);
void AssignRangeToRegister(int reg_id, LiveRange* range);
- ZoneVector<CoallescedLiveRanges*> allocations_;
+ LifetimePosition FindProgressingSplitPosition(LiveRange* range,
+ bool* is_spill_pos);
+
+ Zone* local_zone_;
+ ZoneVector<CoalescedLiveRanges*> allocations_;
PQueue queue_;
DISALLOW_COPY_AND_ASSIGN(GreedyAllocator);
};
« 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