[turbofan] Don't abort inlining on first failed attempt.
Continue with the other candidates in case of a failed attempt to inline a certain candidate. TBR=mstarzinger@chromium.org BUG=v8:4493 LOG=n Review URL: https://codereview.chromium.org/1435373002 Cr-Commit-Position: refs/heads/master@{#31975}
This commit is contained in:
parent
d8d5676e62
commit
47396c4142
@ -101,12 +101,18 @@ void JSInliningHeuristic::Finalize() {
|
|||||||
// We inline at most one candidate in every iteration of the fixpoint.
|
// 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
|
// This is to ensure that we don't consume the full inlining budget
|
||||||
// on things that aren't called very often.
|
// on things that aren't called very often.
|
||||||
if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) return;
|
// TODO(bmeurer): Use std::priority_queue instead of std::set here.
|
||||||
auto i = candidates_.begin();
|
while (!candidates_.empty()) {
|
||||||
Candidate const& candidate = *i;
|
if (cumulative_count_ > FLAG_max_inlined_nodes_cumulative) return;
|
||||||
inliner_.ReduceJSCall(candidate.node, candidate.function);
|
auto i = candidates_.begin();
|
||||||
cumulative_count_ += candidate.function->shared()->ast_node_count();
|
Candidate candidate = *i;
|
||||||
candidates_.erase(i);
|
candidates_.erase(i);
|
||||||
|
Reduction r = inliner_.ReduceJSCall(candidate.node, candidate.function);
|
||||||
|
if (r.Changed()) {
|
||||||
|
cumulative_count_ += candidate.function->shared()->ast_node_count();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user