Commit c87247e4 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Hook up construct call counts.

Utilize the previously introduced construct call counts in the
JSInliningHeuristic to also handle constructor calls properly.

R=mvstanton@chromium.org

Review-Url: https://codereview.chromium.org/2026513003
Cr-Commit-Position: refs/heads/master@{#36585}
parent 496aecb6
......@@ -75,13 +75,24 @@ Reduction JSInliningHeuristic::Reduce(Node* node) {
// Gather feedback on how often this call site has been hit before.
int calls = -1; // Same default as CallICNexus::ExtractCallCount.
// TODO(turbofan): We also want call counts for constructor calls.
if (node->opcode() == IrOpcode::kJSCallFunction) {
CallFunctionParameters p = CallFunctionParametersOf(node->op());
if (p.feedback().IsValid()) {
CallICNexus nexus(p.feedback().vector(), p.feedback().slot());
calls = nexus.ExtractCallCount();
}
} else {
DCHECK_EQ(IrOpcode::kJSCallConstruct, node->opcode());
CallConstructParameters p = CallConstructParametersOf(node->op());
if (p.feedback().IsValid()) {
int const extra_index =
p.feedback().vector()->GetIndex(p.feedback().slot()) + 1;
Handle<Object> feedback_extra(p.feedback().vector()->get(extra_index),
function->GetIsolate());
if (feedback_extra->IsSmi()) {
calls = Handle<Smi>::cast(feedback_extra)->value();
}
}
}
// ---------------------------------------------------------------------------
......
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