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);