From 1e41d4d01be4984ed87baadf85b34fb20f36026f Mon Sep 17 00:00:00 2001 From: Ulan Degenbaev Date: Wed, 8 Jul 2020 12:19:54 +0000 Subject: [PATCH] Add a feature flag for reducing the number of concurrent marking tasks The V8ReduceConcurrentMarkingTasks flag will be used in Finch experiment. Bug: v8:10442 Change-Id: I2cb6d0a8445f4eeb9fcbad9ecb8595542d50fc8b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2283219 Reviewed-by: Ross McIlroy Commit-Queue: Ulan Degenbaev Cr-Commit-Position: refs/heads/master@{#786242} --- gin/gin_features.cc | 11 ++++++++--- gin/gin_features.h | 1 + gin/v8_initializer.cc | 8 ++++++++ 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/gin/gin_features.cc b/gin/gin_features.cc index 1ab58e8e3be231..a2d0d7930e490a 100644 --- a/gin/gin_features.cc +++ b/gin/gin_features.cc @@ -22,15 +22,20 @@ const base::Feature kV8OffThreadFinalization{"V8OffThreadFinalization", const base::Feature kV8LazyFeedbackAllocation{"V8LazyFeedbackAllocation", base::FEATURE_ENABLED_BY_DEFAULT}; -// Enable concurrent inlining in TurboFan. +// Enables concurrent inlining in TurboFan. const base::Feature kV8ConcurrentInlining{"V8ConcurrentInlining", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enable per-context marking worklists in V8 GC. +// Enables per-context marking worklists in V8 GC. const base::Feature kV8PerContextMarkingWorklist{ "V8PerContextMarkingWorklist", base::FEATURE_DISABLED_BY_DEFAULT}; -// Enable flushing of the instruction cache for the embedded blob. +// Enables flushing of the instruction cache for the embedded blob. const base::Feature kV8FlushEmbeddedBlobICache{ "kV8FlushEmbeddedBlobICache", base::FEATURE_DISABLED_BY_DEFAULT}; + +// Enables reduced number of concurrent marking tasks. +const base::Feature kV8ReduceConcurrentMarkingTasks{ + "kV8ReduceConcurrentMarkingTasks", base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace features diff --git a/gin/gin_features.h b/gin/gin_features.h index b8872cdbcd5014..68d6457ed2b5b4 100644 --- a/gin/gin_features.h +++ b/gin/gin_features.h @@ -17,6 +17,7 @@ GIN_EXPORT extern const base::Feature kV8LazyFeedbackAllocation; GIN_EXPORT extern const base::Feature kV8ConcurrentInlining; GIN_EXPORT extern const base::Feature kV8PerContextMarkingWorklist; GIN_EXPORT extern const base::Feature kV8FlushEmbeddedBlobICache; +GIN_EXPORT extern const base::Feature kV8ReduceConcurrentMarkingTasks; } // namespace features diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc index e05c928d89c5e5..630814e5af46ab 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -248,6 +248,14 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) { sizeof(experimental_flush_embedded_blob_icache) - 1); } + if (base::FeatureList::IsEnabled(features::kV8ReduceConcurrentMarkingTasks)) { + static const char gc_experiment_reduce_concurrent_marking_tasks[] = + "--gc-experiment-reduce-concurrent-marking-tasks"; + v8::V8::SetFlagsFromString( + gc_experiment_reduce_concurrent_marking_tasks, + sizeof(gc_experiment_reduce_concurrent_marking_tasks) - 1); + } + if (IsolateHolder::kStrictMode == mode) { static const char use_strict[] = "--use_strict"; v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);