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

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

Issue 777403003: [turbofan] reuse spill slots for phis (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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 504cdb229f22247f077b919a4648899263614ef2..aba7e8cb10a3939d1f41d62b020a1b4f697d66ed 100644
--- a/src/compiler/register-allocator.h
+++ b/src/compiler/register-allocator.h
@@ -466,6 +466,7 @@ class RegisterAllocator FINAL : public ZoneObject {
void InactiveToActive(LiveRange* range);
// Helper methods for allocating registers.
+ bool TryReuseSpillForPhi(LiveRange* range);
bool TryAllocateFreeReg(LiveRange* range);
void AllocateBlockedReg(LiveRange* range);
SpillRange* AssignSpillRangeToLiveRange(LiveRange* range);
@@ -546,6 +547,15 @@ class RegisterAllocator FINAL : public ZoneObject {
const char* debug_name() const { return debug_name_; }
const RegisterConfiguration* config() const { return config_; }
+ struct PhiMapValue {
+ PhiMapValue(PhiInstruction* phi, const InstructionBlock* block)
+ : phi(phi), block(block) {}
+ PhiInstruction* const phi;
+ const InstructionBlock* const block;
+ };
+ typedef std::map<int, PhiMapValue, std::less<int>,
+ zone_allocator<std::pair<int, PhiMapValue>>> PhiMap;
+
Zone* const local_zone_;
Frame* const frame_;
InstructionSequence* const code_;
@@ -553,6 +563,8 @@ class RegisterAllocator FINAL : public ZoneObject {
const RegisterConfiguration* config_;
+ PhiMap phi_map_;
+
// During liveness analysis keep a mapping from block id to live_in sets
// for blocks already analyzed.
ZoneVector<BitVector*> live_in_sets_;
« 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