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 d8a191b6cd4354509b98229840f344ff82b9c2ae..6d906f4102743a290e5f0527e2bb88444e69aa8e 100644 |
| --- a/src/compiler/js-inlining-heuristic.cc |
| +++ b/src/compiler/js-inlining-heuristic.cc |
| @@ -98,14 +98,12 @@ void JSInliningHeuristic::Finalize() { |
| if (candidates_.empty()) return; // Nothing to do without candidates. |
| if (FLAG_trace_turbo_inlining) PrintCandidates(); |
| - while (!candidates_.empty()) { |
| - if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) break; |
| - auto i = candidates_.begin(); |
| - Candidate const& candidate = *i; |
| - inliner_.ReduceJSCall(candidate.node, candidate.function); |
| - cumulative_count_ += candidate.function->shared()->ast_node_count(); |
| - candidates_.erase(i); |
| - } |
| + if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) return; |
|
Michael Starzinger
2015/11/12 13:00:16
nit: Can we add a comment here explaining the logi
Benedikt Meurer
2015/11/12 13:05:40
Done.
|
| + auto i = candidates_.begin(); |
| + Candidate const& candidate = *i; |
| + inliner_.ReduceJSCall(candidate.node, candidate.function); |
| + cumulative_count_ += candidate.function->shared()->ast_node_count(); |
| + candidates_.erase(i); |
| } |