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

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

Issue 1018853003: [turbofan] add non fixed slot constraint to register allocator (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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
Index: src/compiler/register-allocator-verifier.cc
diff --git a/src/compiler/register-allocator-verifier.cc b/src/compiler/register-allocator-verifier.cc
index c7ebd3c51029c3f825920014367b7a586590613d..c57591dfb4613d94c9a2d22d17687b562555e316 100644
--- a/src/compiler/register-allocator-verifier.cc
+++ b/src/compiler/register-allocator-verifier.cc
@@ -162,6 +162,13 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
constraint->type_ = kRegister;
}
break;
+ case UnallocatedOperand::MUST_HAVE_SLOT:
+ if (sequence()->IsDouble(vreg)) {
+ constraint->type_ = kDoubleSlot;
+ } else {
+ constraint->type_ = kSlot;
+ }
+ break;
case UnallocatedOperand::SAME_AS_FIRST_INPUT:
constraint->type_ = kSameAsFirst;
break;
@@ -200,6 +207,12 @@ void RegisterAllocatorVerifier::CheckConstraint(
CHECK(op->IsStackSlot());
CHECK_EQ(op->index(), constraint->value_);
return;
+ case kSlot:
+ CHECK(op->IsStackSlot());
+ return;
+ case kDoubleSlot:
+ CHECK(op->IsDoubleStackSlot());
+ return;
case kNone:
CHECK(op->IsRegister() || op->IsStackSlot());
return;
@@ -301,7 +314,10 @@ class OperandMap : public ZoneObject {
if (i->IsEliminated()) continue;
auto cur = map().find(i->source());
CHECK(cur != map().end());
- to_insert.insert(std::make_pair(i->destination(), cur->second));
+ auto res =
+ to_insert.insert(std::make_pair(i->destination(), cur->second));
+ // Ensure injectivity of moves.
+ CHECK(res.second);
}
// Drop current mappings.
for (auto i = moves->begin(); i != moves->end(); ++i) {
« no previous file with comments | « src/compiler/register-allocator-verifier.h ('k') | test/unittests/compiler/instruction-sequence-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698