Merge V8 5.3.332.45. DO NOT MERGE
Test: Manual
FPIIM-449
Change-Id: Id3254828b068abdea3cb10442e0172a8c9a98e03
(cherry picked from commit 13e2dadd00298019ed862f2b2fc5068bba730bcf)
diff --git a/src/compiler/js-inlining-heuristic.cc b/src/compiler/js-inlining-heuristic.cc
index 0e0508b..0118b92 100644
--- a/src/compiler/js-inlining-heuristic.cc
+++ b/src/compiler/js-inlining-heuristic.cc
@@ -75,13 +75,24 @@
// 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();
+ }
+ }
}
// ---------------------------------------------------------------------------