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

Unified Diff: test/cctest/compiler/test-instruction.cc

Issue 1041163002: [turbofan] smash GapInstruction into Instruction (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: arm compile Created 5 years, 9 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-verifier.cc ('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: test/cctest/compiler/test-instruction.cc
diff --git a/test/cctest/compiler/test-instruction.cc b/test/cctest/compiler/test-instruction.cc
index 22d46e7e3932eda59a1361888770475f265464e0..3c1f9fb6e83dce55d2ec1c4c41ea54a0c40ac48e 100644
--- a/test/cctest/compiler/test-instruction.cc
+++ b/test/cctest/compiler/test-instruction.cc
@@ -206,10 +206,7 @@ TEST(InstructionIsGapAt) {
R.code->AddInstruction(g);
R.code->EndBlock(R.RpoFor(b0));
- CHECK(R.code->instructions().size() == 4);
- for (size_t i = 0; i < R.code->instructions().size(); ++i) {
- CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves());
- }
+ CHECK(R.code->instructions().size() == 2);
}
@@ -236,10 +233,7 @@ TEST(InstructionIsGapAt2) {
R.code->AddInstruction(g1);
R.code->EndBlock(R.RpoFor(b1));
- CHECK(R.code->instructions().size() == 8);
- for (size_t i = 0; i < R.code->instructions().size(); ++i) {
- CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves());
- }
+ CHECK(R.code->instructions().size() == 4);
}
@@ -257,21 +251,15 @@ TEST(InstructionAddGapMove) {
R.code->AddInstruction(g);
R.code->EndBlock(R.RpoFor(b0));
- CHECK(R.code->instructions().size() == 4);
- for (size_t i = 0; i < R.code->instructions().size(); ++i) {
- CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves());
- }
-
- int indexes[] = {0, 2, -1};
- for (int i = 0; indexes[i] >= 0; i++) {
- int index = indexes[i];
-
- UnallocatedOperand* op1 = R.NewUnallocated(index + 6);
- UnallocatedOperand* op2 = R.NewUnallocated(index + 12);
+ CHECK(R.code->instructions().size() == 2);
- R.code->AddGapMove(index, op1, op2);
- GapInstruction* gap = R.code->GapAt(index);
- ParallelMove* move = gap->GetParallelMove(GapInstruction::START);
+ int index = 0;
+ for (auto instr : R.code->instructions()) {
+ UnallocatedOperand* op1 = R.NewUnallocated(index++);
+ UnallocatedOperand* op2 = R.NewUnallocated(index++);
+ instr->GetOrCreateParallelMove(TestInstr::START, R.zone())
+ ->AddMove(op1, op2, R.zone());
+ ParallelMove* move = instr->GetParallelMove(TestInstr::START);
CHECK(move);
const ZoneList<MoveOperands>* move_operands = move->move_operands();
CHECK_EQ(1, move_operands->length());
« no previous file with comments | « src/compiler/register-allocator-verifier.cc ('k') | test/cctest/compiler/test-jump-threading.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698