Revert of [turbofan] Don't take into account source size for inlining heuristics. (patchset #4 id:60001 of https://codereview.chromium.org/2361813002/ )

Reason for revert:
timeouts on windows:
https://build.chromium.org/p/client.v8/builders/V8%20Win64%20-%20debug/builds/12504

Original issue's description:
> [turbofan] Don't take into account source size for inlining heuristics.
>
> The source size is not a real indicator for whether or not to inline a
> certain function.
>
> R=ishell@chromium.org, jarin@chromium.org
> BUG=v8:3354,v8:5267
>
> Committed: 1b33028607

TBR=ishell@chromium.org,jarin@chromium.org,bmeurer@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=v8:3354,v8:5267

Review-Url: https://codereview.chromium.org/2362853003
Cr-Commit-Position: refs/heads/master@{#39661}
This commit is contained in:
machenbach 2016-09-23 05:43:23 -07:00 committed by Commit bot
parent 08a441b309
commit 99160dc1c1
3 changed files with 11 additions and 6 deletions

View File

@ -49,6 +49,11 @@ bool CanInlineFunction(Handle<JSFunction> function) {
// 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) {
return false;
@ -282,7 +287,9 @@ void JSInliningHeuristic::PrintCandidates() {
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());
}
}

View File

@ -2583,7 +2583,6 @@ TEST(TrackHeapAllocationsWithInlining) {
}
TEST(TrackHeapAllocationsWithoutInlining) {
i::FLAG_turbo_inlining = false;
i::FLAG_max_inlined_source_size = 0; // Disable inlining
v8::HandleScope scope(v8::Isolate::GetCurrent());
LocalContext env;

View File

@ -25,11 +25,10 @@ function checkStackTrace(expected) {
var CAN_INLINE_COMMENT = "// Let it be inlined.";
var DONT_INLINE_COMMENT = (function() {
var line = "1";
for (var i = 0; i < 200; ++i) {
line += "," + i;
var line = "// Don't inline. Don't inline. Don't inline. Don't inline.";
for (var i = 0; i < 4; i++) {
line += "\n " + line;
}
line += ";\n";
return line;
})();