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

Unified Diff: test/unittests/compiler/instruction-selector-unittest.h

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
Index: test/unittests/compiler/instruction-selector-unittest.h
diff --git a/test/unittests/compiler/instruction-selector-unittest.h b/test/unittests/compiler/instruction-selector-unittest.h
index 983e5c0aed3b40c31790734f810c6107ae15761e..2be283fd691f940a571e594e4903e68a7e88022a 100644
--- a/test/unittests/compiler/instruction-selector-unittest.h
+++ b/test/unittests/compiler/instruction-selector-unittest.h
@@ -166,7 +166,9 @@ class InstructionSelectorTest : public TestWithContext,
}
int ToVreg(const InstructionOperand* operand) const {
- if (operand->IsConstant()) return operand->index();
+ if (operand->IsConstant()) {
+ return ConstantOperand::cast(operand)->virtual_register();
+ }
EXPECT_EQ(InstructionOperand::UNALLOCATED, operand->kind());
return UnallocatedOperand::cast(operand)->virtual_register();
}
@@ -202,14 +204,15 @@ class InstructionSelectorTest : public TestWithContext,
Constant ToConstant(const InstructionOperand* operand) const {
ConstantMap::const_iterator i;
if (operand->IsConstant()) {
- i = constants_.find(operand->index());
+ i = constants_.find(ConstantOperand::cast(operand)->virtual_register());
+ EXPECT_EQ(ConstantOperand::cast(operand)->virtual_register(), i->first);
EXPECT_FALSE(constants_.end() == i);
} else {
EXPECT_EQ(InstructionOperand::IMMEDIATE, operand->kind());
- i = immediates_.find(operand->index());
+ i = immediates_.find(ImmediateOperand::cast(operand)->index());
+ EXPECT_EQ(ImmediateOperand::cast(operand)->index(), i->first);
EXPECT_FALSE(immediates_.end() == i);
}
- EXPECT_EQ(operand->index(), i->first);
return i->second;
}
« no previous file with comments | « test/cctest/compiler/test-jump-threading.cc ('k') | test/unittests/compiler/instruction-selector-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698