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 <functional> | 5 #include <functional> |
6 #include <limits> | 6 #include <limits> |
7 | 7 |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/compiler/graph-reducer.h" | 9 #include "src/compiler/graph-reducer.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 Node* const user = edge.from(); | 215 Node* const user = edge.from(); |
216 DCHECK(!user->IsDead()); | 216 DCHECK(!user->IsDead()); |
217 if (NodeProperties::IsControlEdge(edge)) { | 217 if (NodeProperties::IsControlEdge(edge)) { |
218 if (user->opcode() == IrOpcode::kIfSuccess) { | 218 if (user->opcode() == IrOpcode::kIfSuccess) { |
219 Replace(user, control); | 219 Replace(user, control); |
220 } else if (user->opcode() == IrOpcode::kIfException) { | 220 } else if (user->opcode() == IrOpcode::kIfException) { |
221 DCHECK_NOT_NULL(dead_); | 221 DCHECK_NOT_NULL(dead_); |
222 edge.UpdateTo(dead_); | 222 edge.UpdateTo(dead_); |
223 Revisit(user); | 223 Revisit(user); |
224 } else { | 224 } else { |
225 edge.UpdateTo(control); | 225 UNREACHABLE(); |
226 Revisit(user); | |
227 } | 226 } |
228 } else if (NodeProperties::IsEffectEdge(edge)) { | 227 } else if (NodeProperties::IsEffectEdge(edge)) { |
229 DCHECK_NOT_NULL(effect); | 228 DCHECK_NOT_NULL(effect); |
230 edge.UpdateTo(effect); | 229 edge.UpdateTo(effect); |
231 Revisit(user); | 230 Revisit(user); |
232 } else { | 231 } else { |
233 DCHECK_NOT_NULL(value); | 232 DCHECK_NOT_NULL(value); |
234 edge.UpdateTo(value); | 233 edge.UpdateTo(value); |
235 Revisit(user); | 234 Revisit(user); |
236 } | 235 } |
(...skipping 25 matching lines...) Expand all Loading... |
262 void GraphReducer::Revisit(Node* node) { | 261 void GraphReducer::Revisit(Node* node) { |
263 if (state_.Get(node) == State::kVisited) { | 262 if (state_.Get(node) == State::kVisited) { |
264 state_.Set(node, State::kRevisit); | 263 state_.Set(node, State::kRevisit); |
265 revisit_.push(node); | 264 revisit_.push(node); |
266 } | 265 } |
267 } | 266 } |
268 | 267 |
269 } // namespace compiler | 268 } // namespace compiler |
270 } // namespace internal | 269 } // namespace internal |
271 } // namespace v8 | 270 } // namespace v8 |
OLD | NEW |