| 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..74b872360599e4508f70eb1394bc50a533ba4c44 100644
|
| --- a/src/compiler/js-inlining-heuristic.cc
|
| +++ b/src/compiler/js-inlining-heuristic.cc
|
| @@ -98,14 +98,15 @@ 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);
|
| - }
|
| + // We inline at most one candidate in every iteration of the fixpoint.
|
| + // This is to ensure that we don't consume the full inlining budget
|
| + // on things that aren't called very often.
|
| + if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) return;
|
| + 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);
|
| }
|
|
|
|
|
|
|