Commit 3ed81fec authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[gin] Add a feature flag for a reverse Finch of V8's --local-heaps

Bug: 1123904
Change-Id: I6dbfa593f899c970935a825fb22ca9572879c256
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386802Reviewed-by: default avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803506}
parent 6843349a
...@@ -42,4 +42,8 @@ const base::Feature kV8ReduceConcurrentMarkingTasks{ ...@@ -42,4 +42,8 @@ const base::Feature kV8ReduceConcurrentMarkingTasks{
const base::Feature kV8NoReclaimUnmodifiedWrappers{ const base::Feature kV8NoReclaimUnmodifiedWrappers{
"V8NoReclaimUnmodifiedWrappers", base::FEATURE_DISABLED_BY_DEFAULT}; "V8NoReclaimUnmodifiedWrappers", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables concurrent heap access and allocation.
const base::Feature kV8LocalHeaps{"V8LocalHeaps",
base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features } // namespace features
...@@ -19,6 +19,7 @@ GIN_EXPORT extern const base::Feature kV8PerContextMarkingWorklist; ...@@ -19,6 +19,7 @@ GIN_EXPORT extern const base::Feature kV8PerContextMarkingWorklist;
GIN_EXPORT extern const base::Feature kV8FlushEmbeddedBlobICache; GIN_EXPORT extern const base::Feature kV8FlushEmbeddedBlobICache;
GIN_EXPORT extern const base::Feature kV8ReduceConcurrentMarkingTasks; GIN_EXPORT extern const base::Feature kV8ReduceConcurrentMarkingTasks;
GIN_EXPORT extern const base::Feature kV8NoReclaimUnmodifiedWrappers; GIN_EXPORT extern const base::Feature kV8NoReclaimUnmodifiedWrappers;
GIN_EXPORT extern const base::Feature kV8LocalHeaps;
} // namespace features } // namespace features
......
...@@ -263,6 +263,13 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) { ...@@ -263,6 +263,13 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
sizeof(no_reclaim_unmodified_wrappers) - 1); sizeof(no_reclaim_unmodified_wrappers) - 1);
} }
if (!base::FeatureList::IsEnabled(features::kV8LocalHeaps)) {
// The --local-heaps flag is enabled by default, so we need to explicitly
// disabled it if kV8LocalHeaps is disabled.
static constexpr char no_local_heaps[] = "--no-local-heaps";
v8::V8::SetFlagsFromString(no_local_heaps, sizeof(no_local_heaps) - 1);
}
if (IsolateHolder::kStrictMode == mode) { if (IsolateHolder::kStrictMode == mode) {
static const char use_strict[] = "--use_strict"; static const char use_strict[] = "--use_strict";
v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1); v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment