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

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

Issue 710323002: [turbofan] put gaps before instructions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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') | no next file » | 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 294812fdfb7161fb8498b5349766ae63e0e6d74a..688a1c2f506408e65ff1035451848509a4908ae2 100644
--- a/test/cctest/compiler/test-instruction.cc
+++ b/test/cctest/compiler/test-instruction.cc
@@ -214,14 +214,11 @@ TEST(InstructionIsGapAt) {
R.code->AddInstruction(g);
R.code->EndBlock(b0->GetRpoNumber());
- CHECK_EQ(true, R.code->InstructionAt(0)->IsBlockStart());
-
- CHECK_EQ(true, R.code->IsGapAt(0)); // Label
- CHECK_EQ(true, R.code->IsGapAt(1)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(2)); // i0
- CHECK_EQ(true, R.code->IsGapAt(3)); // Gap
- CHECK_EQ(true, R.code->IsGapAt(4)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(5)); // g
+ CHECK(R.code->instructions().size() == 8);
+ CHECK_EQ(true, R.code->InstructionAt(1)->IsBlockStart());
+ for (size_t i = 0; i < R.code->instructions().size(); ++i) {
+ CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves());
+ }
}
@@ -248,23 +245,12 @@ TEST(InstructionIsGapAt2) {
R.code->AddInstruction(g1);
R.code->EndBlock(b1->GetRpoNumber());
- CHECK_EQ(true, R.code->InstructionAt(0)->IsBlockStart());
-
- CHECK_EQ(true, R.code->IsGapAt(0)); // Label
- CHECK_EQ(true, R.code->IsGapAt(1)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(2)); // i0
- CHECK_EQ(true, R.code->IsGapAt(3)); // Gap
- CHECK_EQ(true, R.code->IsGapAt(4)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(5)); // g
-
- CHECK_EQ(true, R.code->InstructionAt(6)->IsBlockStart());
-
- CHECK_EQ(true, R.code->IsGapAt(6)); // Label
- CHECK_EQ(true, R.code->IsGapAt(7)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(8)); // i1
- CHECK_EQ(true, R.code->IsGapAt(9)); // Gap
- CHECK_EQ(true, R.code->IsGapAt(10)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(11)); // g1
+ CHECK(R.code->instructions().size() == 16);
+ CHECK_EQ(true, R.code->InstructionAt(1)->IsBlockStart());
+ CHECK_EQ(true, R.code->InstructionAt(9)->IsBlockStart());
+ for (size_t i = 0; i < R.code->instructions().size(); ++i) {
+ CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves());
+ }
}
@@ -282,16 +268,13 @@ TEST(InstructionAddGapMove) {
R.code->AddInstruction(g);
R.code->EndBlock(b0->GetRpoNumber());
- CHECK_EQ(true, R.code->InstructionAt(0)->IsBlockStart());
-
- CHECK_EQ(true, R.code->IsGapAt(0)); // Label
- CHECK_EQ(true, R.code->IsGapAt(1)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(2)); // i0
- CHECK_EQ(true, R.code->IsGapAt(3)); // Gap
- CHECK_EQ(true, R.code->IsGapAt(4)); // Gap
- CHECK_EQ(false, R.code->IsGapAt(5)); // g
+ CHECK(R.code->instructions().size() == 8);
+ CHECK_EQ(true, R.code->InstructionAt(1)->IsBlockStart());
+ for (size_t i = 0; i < R.code->instructions().size(); ++i) {
+ CHECK_EQ(i % 2 == 0, R.code->instructions()[i]->IsGapMoves());
+ }
- int indexes[] = {0, 1, 3, 4, -1};
+ int indexes[] = {0, 2, 4, 6, -1};
for (int i = 0; indexes[i] >= 0; i++) {
int index = indexes[i];
« no previous file with comments | « src/compiler/register-allocator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698