[turbofan] Don't try to inling dead nodes.

The JSInliningHeuristic keeps a list of nodes, which might have been
killed by other reducers before the JSInliningHeuristic looks at it
again, so it has to check whether nodes are dead before trying to
expand them later (this is similar to what the ValueNumberingReducer
needs to do with its internal table).

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/1508643002

Cr-Commit-Position: refs/heads/master@{#32652}
This commit is contained in:
bmeurer 2015-12-07 03:27:02 -08:00 committed by Commit bot
parent 4e2c0dd7a9
commit 1c44aa0e8d

View File

@ -107,12 +107,15 @@ void JSInliningHeuristic::Finalize() {
auto i = candidates_.begin(); auto i = candidates_.begin();
Candidate candidate = *i; Candidate candidate = *i;
candidates_.erase(i); candidates_.erase(i);
// Make sure we don't try to inline dead candidate nodes.
if (!candidate.node->IsDead()) {
Reduction r = inliner_.ReduceJSCall(candidate.node, candidate.function); Reduction r = inliner_.ReduceJSCall(candidate.node, candidate.function);
if (r.Changed()) { if (r.Changed()) {
cumulative_count_ += candidate.function->shared()->ast_node_count(); cumulative_count_ += candidate.function->shared()->ast_node_count();
return; return;
} }
} }
}
} }