Chromium Code Reviews| Index: src/compiler/js-inlining-heuristic.cc |
| diff --git a/src/compiler/js-inlining-heuristic.cc b/src/compiler/js-inlining-heuristic.cc |
| index 38595dbf95cb9b2d4e72be03aad76fb6d206d115..cd5637b0c42ba0ffbb3b8e5b8338fe55cf5e5758 100644 |
| --- a/src/compiler/js-inlining-heuristic.cc |
| +++ b/src/compiler/js-inlining-heuristic.cc |
| @@ -107,10 +107,13 @@ void JSInliningHeuristic::Finalize() { |
| auto i = candidates_.begin(); |
| Candidate candidate = *i; |
| candidates_.erase(i); |
| - Reduction r = inliner_.ReduceJSCall(candidate.node, candidate.function); |
| - if (r.Changed()) { |
| - cumulative_count_ += candidate.function->shared()->ast_node_count(); |
| - return; |
| + // Make sure we don't try to inline dead candidate nodes. |
|
Michael Starzinger
2015/12/07 10:50:49
suggestion: Could also be phrased as "if (candidat
Benedikt Meurer
2015/12/07 11:25:44
Had that initially, but changed it to this.
|
| + if (!candidate.node->IsDead()) { |
| + Reduction r = inliner_.ReduceJSCall(candidate.node, candidate.function); |
| + if (r.Changed()) { |
| + cumulative_count_ += candidate.function->shared()->ast_node_count(); |
| + return; |
| + } |
| } |
| } |
| } |