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

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

Issue 2362853003: Revert of [turbofan] Don't take into account source size for inlining heuristics. (Closed)
Patch Set: 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 | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | 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 5c626d15c6efcb3f87baaa53bbcd258474385274..e237af3e9f0db1c8f6f2bd95ee4878e3baae5f23 100644
--- a/src/compiler/js-inlining-heuristic.cc
+++ b/src/compiler/js-inlining-heuristic.cc
@@ -48,6 +48,11 @@
// Don't inline builtins.
if (function->shared()->IsBuiltin()) return false;
+
+ // Quick check on source code length to avoid parsing large candidate.
+ if (function->shared()->SourceSize() > FLAG_max_inlined_source_size) {
+ return false;
+ }
// Quick check on the size of the AST to avoid parsing large candidate.
if (function->shared()->ast_node_count() > FLAG_max_inlined_nodes) {
@@ -282,7 +287,9 @@
candidate.node->op()->mnemonic(), candidate.frequency);
for (int i = 0; i < candidate.num_functions; ++i) {
Handle<JSFunction> function = candidate.functions[i];
- PrintF(" - size:%d, name: %s\n", function->shared()->ast_node_count(),
+ PrintF(" - size[source]:%d, size[ast]:%d, name: %s\n",
+ function->shared()->SourceSize(),
+ function->shared()->ast_node_count(),
function->shared()->DebugName()->ToCString().get());
}
}
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698