From 03aaa4b3bf4cb01eee1f223b252e6869b04ab08c Mon Sep 17 00:00:00 2001 From: Mythri A Date: Mon, 25 Nov 2019 15:43:37 +0000 Subject: [PATCH] [TurboFan] Don't run child serializer if inlining is turned off TurboFan serializes the callee functions when concurrent inlining is turned on. However, if inlining itself is turned off (for ex: TurboProp) we don't need to serialize these functions reducing time spent on main thread. Bug: v8:9684 Change-Id: If4aba1deb64188e411d4f82b27c475ea93a15344 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1932375 Reviewed-by: Georg Neis Reviewed-by: Maya Lekova Commit-Queue: Mythri Alle Cr-Commit-Position: refs/heads/master@{#65157} --- src/compiler/pipeline.cc | 3 +++ src/compiler/serializer-for-background-compilation.cc | 4 +++- src/compiler/serializer-for-background-compilation.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc index 87a0dc7291..15a320fec7 100644 --- a/src/compiler/pipeline.cc +++ b/src/compiler/pipeline.cc @@ -1431,6 +1431,9 @@ struct SerializationPhase { flags |= SerializerForBackgroundCompilationFlag::kAnalyzeEnvironmentLiveness; } + if (data->info()->is_inlining_enabled()) { + flags |= SerializerForBackgroundCompilationFlag::kEnableTurboInlining; + } RunSerializerForBackgroundCompilation( data->zone_stats(), data->broker(), data->dependencies(), data->info()->closure(), flags, data->info()->osr_offset()); diff --git a/src/compiler/serializer-for-background-compilation.cc b/src/compiler/serializer-for-background-compilation.cc index 527fd4b98c..1a8456774b 100644 --- a/src/compiler/serializer-for-background-compilation.cc +++ b/src/compiler/serializer-for-background-compilation.cc @@ -1969,7 +1969,9 @@ void SerializerForBackgroundCompilation::ProcessCalleeForCallOrConstruct( ProcessBuiltinCall(shared, new_target, arguments, speculation_mode, padding, result_hints); DCHECK_NE(shared->GetInlineability(), SharedFunctionInfo::kIsInlineable); - } else if (shared->GetInlineability() == SharedFunctionInfo::kIsInlineable && + } else if ((flags() & + SerializerForBackgroundCompilationFlag::kEnableTurboInlining) && + shared->GetInlineability() == SharedFunctionInfo::kIsInlineable && callee.HasFeedbackVector()) { CompilationSubject subject = callee.ToCompilationSubject(broker()->isolate(), zone()); diff --git a/src/compiler/serializer-for-background-compilation.h b/src/compiler/serializer-for-background-compilation.h index 8f7883eeba..f2330332d8 100644 --- a/src/compiler/serializer-for-background-compilation.h +++ b/src/compiler/serializer-for-background-compilation.h @@ -23,6 +23,7 @@ enum class SerializerForBackgroundCompilationFlag : uint8_t { kBailoutOnUninitialized = 1 << 0, kCollectSourcePositions = 1 << 1, kAnalyzeEnvironmentLiveness = 1 << 2, + kEnableTurboInlining = 1 << 3, }; using SerializerForBackgroundCompilationFlags = base::Flags;