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

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

Issue 1050803002: [turbofan] cleanup InstructionOperand a little (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase 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/register-allocator.cc ('k') | src/compiler/x64/code-generator-x64.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 7958ffc6ececd8dfe5d020af0fda464b4bcb33a7..912a4c7d82afcb6f3b9d7f9017ccdfe616a201db 100644
--- a/src/compiler/register-allocator-verifier.cc
+++ b/src/compiler/register-allocator-verifier.cc
@@ -119,7 +119,7 @@ void RegisterAllocatorVerifier::BuildConstraint(const InstructionOperand* op,
constraint->virtual_register_ = InstructionOperand::kInvalidVirtualRegister;
if (op->IsConstant()) {
constraint->type_ = kConstant;
- constraint->value_ = ConstantOperand::cast(op)->index();
+ constraint->value_ = ConstantOperand::cast(op)->virtual_register();
constraint->virtual_register_ = constraint->value_;
} else if (op->IsImmediate()) {
constraint->type_ = kImmediate;
@@ -180,29 +180,30 @@ void RegisterAllocatorVerifier::CheckConstraint(
switch (constraint->type_) {
case kConstant:
CHECK(op->IsConstant());
- CHECK_EQ(op->index(), constraint->value_);
+ CHECK_EQ(ConstantOperand::cast(op)->virtual_register(),
+ constraint->value_);
return;
case kImmediate:
CHECK(op->IsImmediate());
- CHECK_EQ(op->index(), constraint->value_);
+ CHECK_EQ(ImmediateOperand::cast(op)->index(), constraint->value_);
return;
case kRegister:
CHECK(op->IsRegister());
return;
case kFixedRegister:
CHECK(op->IsRegister());
- CHECK_EQ(op->index(), constraint->value_);
+ CHECK_EQ(RegisterOperand::cast(op)->index(), constraint->value_);
return;
case kDoubleRegister:
CHECK(op->IsDoubleRegister());
return;
case kFixedDoubleRegister:
CHECK(op->IsDoubleRegister());
- CHECK_EQ(op->index(), constraint->value_);
+ CHECK_EQ(DoubleRegisterOperand::cast(op)->index(), constraint->value_);
return;
case kFixedSlot:
CHECK(op->IsStackSlot());
- CHECK_EQ(op->index(), constraint->value_);
+ CHECK_EQ(StackSlotOperand::cast(op)->index(), constraint->value_);
return;
case kSlot:
CHECK(op->IsStackSlot());
@@ -343,11 +344,11 @@ class OperandMap : public ZoneObject {
void DropRegisters(const RegisterConfiguration* config) {
for (int i = 0; i < config->num_general_registers(); ++i) {
- InstructionOperand op(InstructionOperand::REGISTER, i);
+ RegisterOperand op(i);
Drop(&op);
}
for (int i = 0; i < config->num_double_registers(); ++i) {
- InstructionOperand op(InstructionOperand::DOUBLE_REGISTER, i);
+ DoubleRegisterOperand op(i);
Drop(&op);
}
}
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698