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

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

Issue 795043003: [turbofan] commit allocated registers early (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 | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/register-allocator.cc
diff --git a/src/compiler/register-allocator.cc b/src/compiler/register-allocator.cc
index e01fe1ff35f8d12fdb1cad9499b6377d00659acc..0775de969e6b67fcd7c4a3c7f571372e9ba8f179 100644
--- a/src/compiler/register-allocator.cc
+++ b/src/compiler/register-allocator.cc
@@ -135,9 +135,11 @@ LiveRange::LiveRange(int id, Zone* zone)
spills_at_definition_(nullptr) {}
-void LiveRange::set_assigned_register(int reg) {
+void LiveRange::set_assigned_register(int reg, Zone* zone) {
DCHECK(!HasRegisterAssigned() && !IsSpilled());
assigned_register_ = reg;
+ // TODO(dcarney): stop aliasing hint operands.
+ ConvertUsesToOperand(CreateAssignedOperand(zone));
Benedikt Meurer 2014/12/11 11:45:32 Urghs...
}
@@ -941,6 +943,8 @@ void RegisterAllocator::ReuseSpillSlots() {
void RegisterAllocator::CommitAssignment() {
for (auto range : live_ranges()) {
if (range == nullptr || range->IsEmpty()) continue;
+ // Register assignments were committed in set_assigned_register.
+ if (range->HasRegisterAssigned()) continue;
auto assigned = range->CreateAssignedOperand(code_zone());
range->ConvertUsesToOperand(assigned);
if (range->IsSpilled()) {
@@ -2547,7 +2551,7 @@ void RegisterAllocator::SetLiveRangeAssignedRegister(LiveRange* range,
DCHECK(range->Kind() == GENERAL_REGISTERS);
assigned_registers_->Add(reg);
}
- range->set_assigned_register(reg);
+ range->set_assigned_register(reg, code_zone());
}
} // namespace compiler
« no previous file with comments | « src/compiler/register-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698