Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: src/compiler/js-inlining-heuristic.cc

Issue 2026513003: [turbofan] Hook up construct call counts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining-heuristic.cc
diff --git a/src/compiler/js-inlining-heuristic.cc b/src/compiler/js-inlining-heuristic.cc
index 0e0508bcd4ccd64f600280580ab002dde1162d6c..0118b92446a8462cda8915c1039a31222ffc73d8 100644
--- a/src/compiler/js-inlining-heuristic.cc
+++ b/src/compiler/js-inlining-heuristic.cc
@@ -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();
+ }
+ }
}
// ---------------------------------------------------------------------------
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698