OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 #include "test/cctest/cctest.h" | 6 #include "test/cctest/cctest.h" |
7 | 7 |
8 #include "src/compiler/code-generator.h" | 8 #include "src/compiler/code-generator.h" |
9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
10 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 BasicBlockVector* blocks = R.schedule.rpo_order(); | 133 BasicBlockVector* blocks = R.schedule.rpo_order(); |
134 CHECK_EQ(static_cast<int>(blocks->size()), R.code->InstructionBlockCount()); | 134 CHECK_EQ(static_cast<int>(blocks->size()), R.code->InstructionBlockCount()); |
135 | 135 |
136 int index = 0; | 136 int index = 0; |
137 for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); | 137 for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); |
138 i++, index++) { | 138 i++, index++) { |
139 BasicBlock* block = *i; | 139 BasicBlock* block = *i; |
140 CHECK_EQ(block->rpo_number(), R.BlockAt(block)->rpo_number().ToInt()); | 140 CHECK_EQ(block->rpo_number(), R.BlockAt(block)->rpo_number().ToInt()); |
141 CHECK_EQ(block->id().ToInt(), R.BlockAt(block)->id().ToInt()); | 141 CHECK_EQ(block->id().ToInt(), R.BlockAt(block)->id().ToInt()); |
142 CHECK_EQ(-1, block->loop_end()); | 142 CHECK_EQ(NULL, block->loop_end()); |
143 } | 143 } |
144 } | 144 } |
145 | 145 |
146 | 146 |
147 TEST(InstructionGetBasicBlock) { | 147 TEST(InstructionGetBasicBlock) { |
148 InstructionTester R; | 148 InstructionTester R; |
149 | 149 |
150 BasicBlock* b0 = R.schedule.start(); | 150 BasicBlock* b0 = R.schedule.start(); |
151 BasicBlock* b1 = R.schedule.NewBasicBlock(); | 151 BasicBlock* b1 = R.schedule.NewBasicBlock(); |
152 BasicBlock* b2 = R.schedule.NewBasicBlock(); | 152 BasicBlock* b2 = R.schedule.NewBasicBlock(); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 CHECK_EQ(inputs[z], m->InputAt(z)); | 358 CHECK_EQ(inputs[z], m->InputAt(z)); |
359 } | 359 } |
360 | 360 |
361 for (size_t z = 0; z < k; z++) { | 361 for (size_t z = 0; z < k; z++) { |
362 CHECK_EQ(temps[z], m->TempAt(z)); | 362 CHECK_EQ(temps[z], m->TempAt(z)); |
363 } | 363 } |
364 } | 364 } |
365 } | 365 } |
366 } | 366 } |
367 } | 367 } |
OLD | NEW |