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

Unified Diff: test/unittests/compiler/move-optimizer-unittest.cc

Issue 1389373002: [turbofan] Create ExplicitOperands to specify operands without virtual registers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 years, 2 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 | « test/unittests/compiler/instruction-sequence-unittest.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/unittests/compiler/move-optimizer-unittest.cc
diff --git a/test/unittests/compiler/move-optimizer-unittest.cc b/test/unittests/compiler/move-optimizer-unittest.cc
index fb2b6ad45739ac76ce1c3e685530243a080d1479..c7c92a0321baa1c75ff383826706bb84f26da8ef 100644
--- a/test/unittests/compiler/move-optimizer-unittest.cc
+++ b/test/unittests/compiler/move-optimizer-unittest.cc
@@ -67,10 +67,16 @@ class MoveOptimizerTest : public InstructionSequenceTest {
case kConstant:
return ConstantOperand(op.value_);
case kFixedSlot:
- return StackSlotOperand(kRepWord32, op.value_);
+ return AllocatedOperand(LocationOperand::STACK_SLOT, kRepWord32,
+ op.value_);
case kFixedRegister:
CHECK(0 <= op.value_ && op.value_ < num_general_registers());
- return RegisterOperand(kRepWord32, op.value_);
+ return AllocatedOperand(LocationOperand::REGISTER, kRepWord32,
+ op.value_);
+ case kExplicit:
+ CHECK(0 <= op.value_ && op.value_ < num_general_registers());
+ return ExplicitOperand(LocationOperand::REGISTER, kRepWord32,
+ op.value_);
default:
break;
}
@@ -97,6 +103,23 @@ TEST_F(MoveOptimizerTest, RemovesRedundant) {
}
+TEST_F(MoveOptimizerTest, RemovesRedundantExplicit) {
+ StartBlock();
+ auto first_instr = EmitNop();
+ AddMove(first_instr, Reg(0), ExplicitReg(1));
+ auto last_instr = EmitNop();
+ AddMove(last_instr, Reg(1), Reg(0));
+ EndBlock(Last());
+
+ Optimize();
+
+ CHECK_EQ(0, NonRedundantSize(first_instr->parallel_moves()[0]));
+ auto move = last_instr->parallel_moves()[0];
+ CHECK_EQ(1, NonRedundantSize(move));
+ CHECK(Contains(move, Reg(0), ExplicitReg(1)));
+}
+
+
TEST_F(MoveOptimizerTest, SplitsConstants) {
StartBlock();
EndBlock(Last());
« no previous file with comments | « test/unittests/compiler/instruction-sequence-unittest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698