Commit 53cd537b authored by Maya Lekova's avatar Maya Lekova Committed by Commit Bot

[turbofan] Small cleanup on JSInliningHeuristic

Remove dead code and move a condition earlier, as discussed in
http://doc/1I1yzlXM79M7W5QfVjTwSSTEQsRCjdfo8cgSQXkeqlZQ#heading=h.e7x2k9l4bmi7

Bug: v8:9183
Change-Id: Iaba7233e47ee19d2be5501ce6046f3956532513c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1658155
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Auto-Submit: Maya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62157}
parent 7bb31d9f
......@@ -65,7 +65,7 @@ JSInliningHeuristic::Candidate JSInliningHeuristic::CollectFunctions(
out.functions[n] = m.Ref(broker()).AsJSFunction();
JSFunctionRef function = out.functions[n].value();
if (function.IsSerializedForCompilation()) {
out.bytecode[n] = function.shared().GetBytecodeArray(), isolate();
out.bytecode[n] = function.shared().GetBytecodeArray();
}
}
out.num_functions = value_input_count;
......@@ -221,6 +221,11 @@ void JSInliningHeuristic::Finalize() {
Candidate candidate = *i;
candidates_.erase(i);
// Make sure we don't try to inline dead candidate nodes.
if (candidate.node->IsDead()) {
continue;
}
// Make sure we have some extra budget left, so that any small functions
// exposed by this function would be given a chance to inline.
double size_of_candidate =
......@@ -231,11 +236,8 @@ void JSInliningHeuristic::Finalize() {
continue;
}
// Make sure we don't try to inline dead candidate nodes.
if (!candidate.node->IsDead()) {
Reduction const reduction = InlineCandidate(candidate, false);
if (reduction.Changed()) return;
}
Reduction const reduction = InlineCandidate(candidate, false);
if (reduction.Changed()) return;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment