| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 BasicBlock* last = R.schedule.start(); | 106 BasicBlock* last = R.schedule.start(); |
| 107 for (int i = 0; i < 5; i++) { | 107 for (int i = 0; i < 5; i++) { |
| 108 BasicBlock* block = R.schedule.NewBasicBlock(); | 108 BasicBlock* block = R.schedule.NewBasicBlock(); |
| 109 R.schedule.AddGoto(last, block); | 109 R.schedule.AddGoto(last, block); |
| 110 last = block; | 110 last = block; |
| 111 } | 111 } |
| 112 | 112 |
| 113 R.allocCode(); | 113 R.allocCode(); |
| 114 | 114 |
| 115 CHECK_EQ(R.graph.NodeCount(), R.code->ValueCount()); | 115 CHECK_EQ(R.graph.NodeCount(), R.code->node_count()); |
| 116 | 116 |
| 117 BasicBlockVector* blocks = R.schedule.rpo_order(); | 117 BasicBlockVector* blocks = R.schedule.rpo_order(); |
| 118 CHECK_EQ(static_cast<int>(blocks->size()), R.code->BasicBlockCount()); | 118 CHECK_EQ(static_cast<int>(blocks->size()), R.code->BasicBlockCount()); |
| 119 | 119 |
| 120 int index = 0; | 120 int index = 0; |
| 121 for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); | 121 for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); |
| 122 i++, index++) { | 122 i++, index++) { |
| 123 BasicBlock* block = *i; | 123 BasicBlock* block = *i; |
| 124 CHECK_EQ(block, R.code->BlockAt(index)); | 124 CHECK_EQ(block, R.code->BlockAt(index)); |
| 125 CHECK_EQ(-1, R.code->GetLoopEnd(block)); | 125 CHECK_EQ(-1, R.code->GetLoopEnd(block)); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 CHECK_EQ(inputs[z], m->InputAt(z)); | 341 CHECK_EQ(inputs[z], m->InputAt(z)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 for (size_t z = 0; z < k; z++) { | 344 for (size_t z = 0; z < k; z++) { |
| 345 CHECK_EQ(temps[z], m->TempAt(z)); | 345 CHECK_EQ(temps[z], m->TempAt(z)); |
| 346 } | 346 } |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 } | 349 } |
| 350 } | 350 } |
| OLD | NEW |