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

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

Issue 1081373002: [turbofan] cleanup ParallelMove (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 | « test/cctest/compiler/test-jump-threading.cc ('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 206f10891d1ce69e159683cc16214e2d4deecb37..c82f4270bc7bd2aadd077cbc346b5d53d9ed6b66 100644
--- a/test/unittests/compiler/move-optimizer-unittest.cc
+++ b/test/unittests/compiler/move-optimizer-unittest.cc
@@ -16,26 +16,24 @@ class MoveOptimizerTest : public InstructionSequenceTest {
void AddMove(Instruction* instr, TestOperand from, TestOperand to,
Instruction::GapPosition pos = Instruction::START) {
auto parallel_move = instr->GetOrCreateParallelMove(pos, zone());
- parallel_move->AddMove(ConvertMoveArg(from), ConvertMoveArg(to), zone());
+ parallel_move->AddMove(ConvertMoveArg(from), ConvertMoveArg(to));
}
- int NonRedundantSize(ParallelMove* move) {
+ int NonRedundantSize(ParallelMove* moves) {
int i = 0;
- auto ops = move->move_operands();
- for (auto op = ops->begin(); op != ops->end(); ++op) {
- if (op->IsRedundant()) continue;
+ for (auto move : *moves) {
+ if (move->IsRedundant()) continue;
i++;
}
return i;
}
- bool Contains(ParallelMove* move, TestOperand from_op, TestOperand to_op) {
+ bool Contains(ParallelMove* moves, TestOperand from_op, TestOperand to_op) {
auto from = ConvertMoveArg(from_op);
auto to = ConvertMoveArg(to_op);
- auto ops = move->move_operands();
- for (auto op = ops->begin(); op != ops->end(); ++op) {
- if (op->IsRedundant()) continue;
- if (op->source()->Equals(from) && op->destination()->Equals(to)) {
+ for (auto move : *moves) {
+ if (move->IsRedundant()) continue;
+ if (move->source() == from && move->destination() == to) {
return true;
}
}
@@ -62,22 +60,22 @@ class MoveOptimizerTest : public InstructionSequenceTest {
}
private:
- InstructionOperand* ConvertMoveArg(TestOperand op) {
+ InstructionOperand ConvertMoveArg(TestOperand op) {
CHECK_EQ(kNoValue, op.vreg_.value_);
CHECK_NE(kNoValue, op.value_);
switch (op.type_) {
case kConstant:
- return ConstantOperand::New(zone(), op.value_);
+ return ConstantOperand(op.value_);
case kFixedSlot:
- return StackSlotOperand::New(zone(), op.value_);
+ return StackSlotOperand(op.value_);
case kFixedRegister:
CHECK(0 <= op.value_ && op.value_ < num_general_registers());
- return RegisterOperand::New(zone(), op.value_);
+ return RegisterOperand(op.value_);
default:
break;
}
CHECK(false);
- return nullptr;
+ return InstructionOperand();
}
};
« no previous file with comments | « test/cctest/compiler/test-jump-threading.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698