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

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

Issue 2337123003: [turbofan] Collect invocation counts and compute relative call frequencies. (Closed)
Patch Set: Address feedback. Created 4 years, 3 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 | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-inlining.cc
diff --git a/src/compiler/js-inlining.cc b/src/compiler/js-inlining.cc
index db7490e2235ed8f4d815968bd64a1686d6b12e41..519b5db6f498f0a3603e8434f6e074cbb88a695c 100644
--- a/src/compiler/js-inlining.cc
+++ b/src/compiler/js-inlining.cc
@@ -69,6 +69,12 @@ class JSCallAccessor {
return call_->op()->ValueInputCount() - 2;
}
+ float frequency() const {
+ return (call_->opcode() == IrOpcode::kJSCallFunction)
+ ? CallFunctionParametersOf(call_->op()).frequency()
+ : CallConstructParametersOf(call_->op()).frequency();
+ }
+
private:
Node* call_;
};
@@ -519,8 +525,8 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
// Run the AstGraphBuilder to create the subgraph.
Graph::SubgraphScope scope(graph());
- AstGraphBuilder graph_builder(&zone, &info, jsgraph(), loop_assignment,
- type_hint_analysis);
+ AstGraphBuilder graph_builder(&zone, &info, jsgraph(), call.frequency(),
+ loop_assignment, type_hint_analysis);
graph_builder.CreateGraph(false);
// Extract the inlinee start/end nodes.
« no previous file with comments | « src/compiler/bytecode-graph-builder.cc ('k') | src/compiler/pipeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698