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

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

Issue 1426943010: [turbofan] Spill rsi and rdi in their existing locations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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-verifier.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-verifier.cc
diff --git a/src/compiler/register-allocator-verifier.cc b/src/compiler/register-allocator-verifier.cc
index 68862add4609f07c89adb29deb4ee890e746e310..ee6b66f3b18f91466758d003cf086e03160d88a9 100644
--- a/src/compiler/register-allocator-verifier.cc
+++ b/src/compiler/register-allocator-verifier.cc
@@ -172,7 +172,12 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
}
break;
case UnallocatedOperand::FIXED_REGISTER:
- constraint->type_ = kFixedRegister;
+ if (unallocated->HasSecondaryStorage()) {
+ constraint->type_ = kRegisterAndSlot;
+ constraint->spilled_slot_ = unallocated->GetSecondaryStorage();
+ } else {
+ constraint->type_ = kFixedRegister;
+ }
constraint->value_ = unallocated->fixed_register_index();
break;
case UnallocatedOperand::FIXED_DOUBLE_REGISTER:
@@ -225,6 +230,7 @@ void RegisterAllocatorVerifier::CheckConstraint(
CHECK(op->IsExplicit());
return;
case kFixedRegister:
+ case kRegisterAndSlot:
CHECK(op->IsRegister());
CHECK_EQ(LocationOperand::cast(op)->GetRegister().code(),
constraint->value_);
@@ -386,11 +392,13 @@ class OperandMap : public ZoneObject {
}
}
- void Define(Zone* zone, const InstructionOperand* op, int virtual_register) {
+ MapValue* Define(Zone* zone, const InstructionOperand* op,
+ int virtual_register) {
auto value = new (zone) MapValue();
value->define_vreg = virtual_register;
auto res = map().insert(std::make_pair(op, value));
if (!res.second) res.first->second = value;
+ return value;
}
void Use(const InstructionOperand* op, int use_vreg, bool initial_pass) {
@@ -704,7 +712,20 @@ void RegisterAllocatorVerifier::VerifyGapMoves(BlockMaps* block_maps,
}
for (size_t i = 0; i < instr->OutputCount(); ++i, ++count) {
int virtual_register = op_constraints[count].virtual_register_;
- current->Define(zone(), instr->OutputAt(i), virtual_register);
+ OperandMap::MapValue* value =
+ current->Define(zone(), instr->OutputAt(i), virtual_register);
+ if (op_constraints[count].type_ == kRegisterAndSlot) {
+ const AllocatedOperand* reg_op =
+ AllocatedOperand::cast(instr->OutputAt(i));
+ MachineType mt = reg_op->machine_type();
+ const AllocatedOperand* stack_op = AllocatedOperand::New(
+ zone(), LocationOperand::LocationKind::STACK_SLOT, mt,
+ op_constraints[i].spilled_slot_);
+ auto insert_result =
+ current->map().insert(std::make_pair(stack_op, value));
+ DCHECK(insert_result.second);
+ USE(insert_result);
+ }
}
}
}
« no previous file with comments | « src/compiler/register-allocator-verifier.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698