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

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

Issue 1075903002: [turbofan] support small immediates (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 | « src/compiler/instruction-selector-impl.h ('k') | test/cctest/compiler/test-jump-threading.cc » ('j') | 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 912a4c7d82afcb6f3b9d7f9017ccdfe616a201db..6c337e6118a175657bcd65036c4a32ba8460e172 100644
--- a/src/compiler/register-allocator-verifier.cc
+++ b/src/compiler/register-allocator-verifier.cc
@@ -122,8 +122,11 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
constraint->value_ = ConstantOperand::cast(op)->virtual_register();
constraint->virtual_register_ = constraint->value_;
} else if (op->IsImmediate()) {
+ auto imm = ImmediateOperand::cast(op);
+ int value = imm->type() == ImmediateOperand::INLINE ? imm->inline_value()
+ : imm->indexed_value();
constraint->type_ = kImmediate;
- constraint->value_ = ImmediateOperand::cast(op)->index();
+ constraint->value_ = value;
} else {
CHECK(op->IsUnallocated());
const auto* unallocated = UnallocatedOperand::cast(op);
@@ -183,10 +186,15 @@ void RegisterAllocatorVerifier::CheckConstraint(
CHECK_EQ(ConstantOperand::cast(op)->virtual_register(),
constraint->value_);
return;
- case kImmediate:
+ case kImmediate: {
CHECK(op->IsImmediate());
- CHECK_EQ(ImmediateOperand::cast(op)->index(), constraint->value_);
+ auto imm = ImmediateOperand::cast(op);
+ int value = imm->type() == ImmediateOperand::INLINE
+ ? imm->inline_value()
+ : imm->indexed_value();
+ CHECK_EQ(value, constraint->value_);
return;
+ }
case kRegister:
CHECK(op->IsRegister());
return;
« no previous file with comments | « src/compiler/instruction-selector-impl.h ('k') | test/cctest/compiler/test-jump-threading.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698