[v8] Add feature flag for off-thread streaming finalization
Adds a feature flag for enabling off-thread finalization of V8 streaming compilation tasks. This feature should reduce main-thread script compilation time. Bug: 1011762 Change-Id: I64bb986e07dae8d68dc61269e69096c368b1aac8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135629 Auto-Submit: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org> Cr-Commit-Position: refs/heads/master@{#756313}
This commit is contained in:

committed by
Commit Bot

parent
215247297c
commit
de933c1940
@ -14,6 +14,10 @@ const base::Feature kV8OptimizeJavascript{"V8OptimizeJavascript",
|
||||
const base::Feature kV8FlushBytecode{"V8FlushBytecode",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
// Enables finalizing streaming JS compilations on a background thread.
|
||||
const base::Feature kV8OffThreadFinalization{"V8OffThreadFinalization",
|
||||
base::FEATURE_DISABLED_BY_DEFAULT};
|
||||
|
||||
// Enables lazy feedback allocation in V8.
|
||||
const base::Feature kV8LazyFeedbackAllocation{"V8LazyFeedbackAllocation",
|
||||
base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
@ -12,6 +12,7 @@ namespace features {
|
||||
|
||||
GIN_EXPORT extern const base::Feature kV8OptimizeJavascript;
|
||||
GIN_EXPORT extern const base::Feature kV8FlushBytecode;
|
||||
GIN_EXPORT extern const base::Feature kV8OffThreadFinalization;
|
||||
GIN_EXPORT extern const base::Feature kV8LazyFeedbackAllocation;
|
||||
GIN_EXPORT extern const base::Feature kV8ConcurrentInlining;
|
||||
GIN_EXPORT extern const base::Feature kV8PerContextMarkingWorklist;
|
||||
|
@ -211,6 +211,13 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
|
||||
sizeof(no_flush_bytecode) - 1);
|
||||
}
|
||||
|
||||
if (base::FeatureList::IsEnabled(features::kV8OffThreadFinalization)) {
|
||||
static const char finalize_streaming_on_background[] =
|
||||
"--finalize-streaming-on-background";
|
||||
v8::V8::SetFlagsFromString(finalize_streaming_on_background,
|
||||
sizeof(finalize_streaming_on_background) - 1);
|
||||
}
|
||||
|
||||
if (!base::FeatureList::IsEnabled(features::kV8LazyFeedbackAllocation)) {
|
||||
static const char no_lazy_feedback_allocation[] =
|
||||
"--no-lazy-feedback-allocation";
|
||||
|
Reference in New Issue
Block a user