| 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 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 case IrOpcode::kCheckedStore: | 972 case IrOpcode::kCheckedStore: |
| 973 // TODO(rossberg): Check. | 973 // TODO(rossberg): Check. |
| 974 break; | 974 break; |
| 975 } | 975 } |
| 976 } // NOLINT(readability/fn_size) | 976 } // NOLINT(readability/fn_size) |
| 977 | 977 |
| 978 | 978 |
| 979 void Verifier::Run(Graph* graph, Typing typing) { | 979 void Verifier::Run(Graph* graph, Typing typing) { |
| 980 CHECK_NOT_NULL(graph->start()); | 980 CHECK_NOT_NULL(graph->start()); |
| 981 CHECK_NOT_NULL(graph->end()); | 981 CHECK_NOT_NULL(graph->end()); |
| 982 Zone zone; | 982 Zone zone(graph->zone()->allocator()); |
| 983 Visitor visitor(&zone, typing); | 983 Visitor visitor(&zone, typing); |
| 984 AllNodes all(&zone, graph); | 984 AllNodes all(&zone, graph); |
| 985 for (Node* node : all.live) visitor.Check(node); | 985 for (Node* node : all.live) visitor.Check(node); |
| 986 | 986 |
| 987 // Check the uniqueness of projections. | 987 // Check the uniqueness of projections. |
| 988 for (Node* proj : all.live) { | 988 for (Node* proj : all.live) { |
| 989 if (proj->opcode() != IrOpcode::kProjection) continue; | 989 if (proj->opcode() != IrOpcode::kProjection) continue; |
| 990 Node* node = proj->InputAt(0); | 990 Node* node = proj->InputAt(0); |
| 991 for (Node* other : node->uses()) { | 991 for (Node* other : node->uses()) { |
| 992 if (all.IsLive(other) && other != proj && | 992 if (all.IsLive(other) && other != proj && |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 "Node #%d:%s in B%d is not dominated by control input #%d:%s", | 1062 "Node #%d:%s in B%d is not dominated by control input #%d:%s", |
| 1063 node->id(), node->op()->mnemonic(), block->rpo_number(), | 1063 node->id(), node->op()->mnemonic(), block->rpo_number(), |
| 1064 ctl->id(), ctl->op()->mnemonic()); | 1064 ctl->id(), ctl->op()->mnemonic()); |
| 1065 } | 1065 } |
| 1066 } | 1066 } |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 | 1069 |
| 1070 void ScheduleVerifier::Run(Schedule* schedule) { | 1070 void ScheduleVerifier::Run(Schedule* schedule) { |
| 1071 const size_t count = schedule->BasicBlockCount(); | 1071 const size_t count = schedule->BasicBlockCount(); |
| 1072 Zone tmp_zone; | 1072 Zone tmp_zone(schedule->zone()->allocator()); |
| 1073 Zone* zone = &tmp_zone; | 1073 Zone* zone = &tmp_zone; |
| 1074 BasicBlock* start = schedule->start(); | 1074 BasicBlock* start = schedule->start(); |
| 1075 BasicBlockVector* rpo_order = schedule->rpo_order(); | 1075 BasicBlockVector* rpo_order = schedule->rpo_order(); |
| 1076 | 1076 |
| 1077 // Verify the RPO order contains only blocks from this schedule. | 1077 // Verify the RPO order contains only blocks from this schedule. |
| 1078 CHECK_GE(count, rpo_order->size()); | 1078 CHECK_GE(count, rpo_order->size()); |
| 1079 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); | 1079 for (BasicBlockVector::iterator b = rpo_order->begin(); b != rpo_order->end(); |
| 1080 ++b) { | 1080 ++b) { |
| 1081 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); | 1081 CHECK_EQ((*b), schedule->GetBlockById((*b)->id())); |
| 1082 // All predecessors and successors should be in rpo and in this schedule. | 1082 // All predecessors and successors should be in rpo and in this schedule. |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1293 replacement->op()->EffectOutputCount() > 0); | 1293 replacement->op()->EffectOutputCount() > 0); |
| 1294 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || | 1294 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || |
| 1295 replacement->opcode() == IrOpcode::kFrameState); | 1295 replacement->opcode() == IrOpcode::kFrameState); |
| 1296 } | 1296 } |
| 1297 | 1297 |
| 1298 #endif // DEBUG | 1298 #endif // DEBUG |
| 1299 | 1299 |
| 1300 } // namespace compiler | 1300 } // namespace compiler |
| 1301 } // namespace internal | 1301 } // namespace internal |
| 1302 } // namespace v8 | 1302 } // namespace v8 |
| OLD | NEW |