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/compiler/verifier.h" | 5 #include "src/compiler/verifier.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <queue> | 9 #include <queue> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 #undef SIMD_MACHINE_OP_CASE | 1297 #undef SIMD_MACHINE_OP_CASE |
1298 | 1298 |
1299 // TODO(rossberg): Check. | 1299 // TODO(rossberg): Check. |
1300 break; | 1300 break; |
1301 } | 1301 } |
1302 } // NOLINT(readability/fn_size) | 1302 } // NOLINT(readability/fn_size) |
1303 | 1303 |
1304 void Verifier::Run(Graph* graph, Typing typing, CheckInputs check_inputs) { | 1304 void Verifier::Run(Graph* graph, Typing typing, CheckInputs check_inputs) { |
1305 CHECK_NOT_NULL(graph->start()); | 1305 CHECK_NOT_NULL(graph->start()); |
1306 CHECK_NOT_NULL(graph->end()); | 1306 CHECK_NOT_NULL(graph->end()); |
1307 Zone zone(graph->zone()->allocator()); | 1307 Zone zone(graph->zone()->allocator(), ZONE_NAME); |
1308 Visitor visitor(&zone, typing, check_inputs); | 1308 Visitor visitor(&zone, typing, check_inputs); |
1309 AllNodes all(&zone, graph); | 1309 AllNodes all(&zone, graph); |
1310 for (Node* node : all.reachable) visitor.Check(node); | 1310 for (Node* node : all.reachable) visitor.Check(node); |
1311 | 1311 |
1312 // Check the uniqueness of projections. | 1312 // Check the uniqueness of projections. |
1313 for (Node* proj : all.reachable) { | 1313 for (Node* proj : all.reachable) { |
1314 if (proj->opcode() != IrOpcode::kProjection) continue; | 1314 if (proj->opcode() != IrOpcode::kProjection) continue; |
1315 Node* node = proj->InputAt(0); | 1315 Node* node = proj->InputAt(0); |
1316 for (Node* other : node->uses()) { | 1316 for (Node* other : node->uses()) { |
1317 if (all.IsLive(other) && other != proj && | 1317 if (all.IsLive(other) && other != proj && |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1387 "Node #%d:%s in B%d is not dominated by control input #%d:%s", | 1387 "Node #%d:%s in B%d is not dominated by control input #%d:%s", |
1388 node->id(), node->op()->mnemonic(), block->rpo_number(), | 1388 node->id(), node->op()->mnemonic(), block->rpo_number(), |
1389 ctl->id(), ctl->op()->mnemonic()); | 1389 ctl->id(), ctl->op()->mnemonic()); |
1390 } | 1390 } |
1391 } | 1391 } |
1392 } | 1392 } |
1393 | 1393 |
1394 | 1394 |
1395 void ScheduleVerifier::Run(Schedule* schedule) { | 1395 void ScheduleVerifier::Run(Schedule* schedule) { |
1396 const size_t count = schedule->BasicBlockCount(); | 1396 const size_t count = schedule->BasicBlockCount(); |
1397 Zone tmp_zone(schedule->zone()->allocator()); | 1397 Zone tmp_zone(schedule->zone()->allocator(), ZONE_NAME); |
1398 Zone* zone = &tmp_zone; | 1398 Zone* zone = &tmp_zone; |
1399 BasicBlock* start = schedule->start(); | 1399 BasicBlock* start = schedule->start(); |
1400 BasicBlockVector* rpo_order = schedule->rpo_order(); | 1400 BasicBlockVector* rpo_order = schedule->rpo_order(); |
1401 | 1401 |
1402 // Verify the RPO order contains only blocks from this schedule. | 1402 // Verify the RPO order contains only blocks from this schedule. |
1403 CHECK_GE(count, rpo_order->size()); | 1403 CHECK_GE(count, rpo_order->size()); |
1404 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); | 1404 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); |
1405 ++b) { | 1405 ++b) { |
1406 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); | 1406 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); |
1407 // All predecessors and successors should be in rpo and in this schedule. | 1407 // All predecessors and successors should be in rpo and in this schedule. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 replacement->op()->EffectOutputCount() > 0); | 1617 replacement->op()->EffectOutputCount() > 0); |
1618 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1618 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
1619 replacement->opcode() == IrOpcode::kFrameState); | 1619 replacement->opcode() == IrOpcode::kFrameState); |
1620 } | 1620 } |
1621 | 1621 |
1622 #endif // DEBUG | 1622 #endif // DEBUG |
1623 | 1623 |
1624 } // namespace compiler | 1624 } // namespace compiler |
1625 } // namespace internal | 1625 } // namespace internal |
1626 } // namespace v8 | 1626 } // namespace v8 |
OLD | NEW |