Commit 4aa736b6 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[gin] Add a feature flag for V8's --turbo-direct-heap-access

This is done to set up a reverse Finch trial of V8's
--turbo-direct-heap-access. As a note, it is is dependent of V8's flag
--local-heaps.

Bug: 1125606, v8:7790
Change-Id: Ieede59881b3ef3c762ba0679dccf1b95cc05c1ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2396137Reviewed-by: default avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804897}
parent d04688d1
...@@ -46,4 +46,8 @@ const base::Feature kV8NoReclaimUnmodifiedWrappers{ ...@@ -46,4 +46,8 @@ const base::Feature kV8NoReclaimUnmodifiedWrappers{
const base::Feature kV8LocalHeaps{"V8LocalHeaps", const base::Feature kV8LocalHeaps{"V8LocalHeaps",
base::FEATURE_ENABLED_BY_DEFAULT}; base::FEATURE_ENABLED_BY_DEFAULT};
// Enables TurboFan's direct heap access.
const base::Feature kV8TurboDirectHeapAccess{"V8TurboDirectHeapAccess",
base::FEATURE_ENABLED_BY_DEFAULT};
} // namespace features } // namespace features
...@@ -20,6 +20,7 @@ GIN_EXPORT extern const base::Feature kV8FlushEmbeddedBlobICache; ...@@ -20,6 +20,7 @@ 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; GIN_EXPORT extern const base::Feature kV8LocalHeaps;
GIN_EXPORT extern const base::Feature kV8TurboDirectHeapAccess;
} // namespace features } // namespace features
......
...@@ -265,9 +265,20 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) { ...@@ -265,9 +265,20 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
if (!base::FeatureList::IsEnabled(features::kV8LocalHeaps)) { if (!base::FeatureList::IsEnabled(features::kV8LocalHeaps)) {
// The --local-heaps flag is enabled by default, so we need to explicitly // The --local-heaps flag is enabled by default, so we need to explicitly
// disabled it if kV8LocalHeaps is disabled. // disable it if kV8LocalHeaps is disabled.
static constexpr char no_local_heaps[] = "--no-local-heaps"; static constexpr char no_local_heaps[] = "--no-local-heaps";
v8::V8::SetFlagsFromString(no_local_heaps, sizeof(no_local_heaps) - 1); v8::V8::SetFlagsFromString(no_local_heaps, sizeof(no_local_heaps) - 1);
// Also disable TurboFan's direct access if local heaps are not enabled.
static constexpr char no_direct_access[] = "--no-turbo-direct-heap-access";
v8::V8::SetFlagsFromString(no_direct_access, sizeof(no_direct_access) - 1);
}
if (!base::FeatureList::IsEnabled(features::kV8TurboDirectHeapAccess)) {
// The --turbo-direct-heap-access flag is enabled by default, so we need to
// explicitly disable it if kV8TurboDirectHeapAccess is disabled.
static constexpr char no_direct_access[] = "--no-turbo-direct-heap-access";
v8::V8::SetFlagsFromString(no_direct_access, sizeof(no_direct_access) - 1);
} }
if (IsolateHolder::kStrictMode == mode) { if (IsolateHolder::kStrictMode == mode) {
......
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