From f3c64baf87285ec253961e9a02d88ab8c7c6bb8a Mon Sep 17 00:00:00 2001 From: Eva Herencsarova Date: Fri, 10 May 2024 10:47:29 +0000 Subject: [PATCH] [v8][wasm][code flushing][gin] Add flag and field trial for code flushing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prepare launch via Finch by adding a gin feature and field trial for Liftoff code flushing. Bug: 339120678 Change-Id: Iff319621817d4ddfa3ed9c6dcdd8965c3c444528 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5526355 Commit-Queue: Eva Herencsárová Reviewed-by: Michael Lippautz Reviewed-by: Jakob Kummerow Cr-Commit-Position: refs/heads/main@{#1299164} --- gin/gin_features.cc | 5 ++++ gin/gin_features.h | 1 + gin/v8_initializer.cc | 2 ++ .../variations/fieldtrial_testing_config.json | 28 +++++++++++++++++++ 4 files changed, 36 insertions(+) diff --git a/gin/gin_features.cc b/gin/gin_features.cc index ad04d6ea76d6fe..4ee878595272ba 100644 --- a/gin/gin_features.cc +++ b/gin/gin_features.cc @@ -299,6 +299,11 @@ BASE_FEATURE(kWebAssemblyInlining, "WebAssemblyInlining", base::FEATURE_DISABLED_BY_DEFAULT); +// Enable WebAssembly code flushing. +BASE_FEATURE(kWebAssemblyLiftoffCodeFlushing, + "WebAssemblyLiftoffCodeFlushing", + base::FEATURE_DISABLED_BY_DEFAULT); + // Enable the generic wasm-to-js wrapper. BASE_FEATURE(kWebAssemblyGenericWrapper, "WebAssemblyGenericWrapper", diff --git a/gin/gin_features.h b/gin/gin_features.h index 3101067cd20144..6d5576e2a828a0 100644 --- a/gin/gin_features.h +++ b/gin/gin_features.h @@ -80,6 +80,7 @@ GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptSetMethods); GIN_EXPORT BASE_DECLARE_FEATURE(kJavaScriptRegExpDuplicateNamedGroups); GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyTailCall); GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyInlining); +GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyLiftoffCodeFlushing); GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyGenericWrapper); GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyMultipleMemories); GIN_EXPORT BASE_DECLARE_FEATURE(kWebAssemblyTurboshaft); diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc index 4a46192dfabf64..f8d4be9d5bb00b 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -449,6 +449,8 @@ void SetFlags(IsolateHolder::ScriptMode mode, SetV8FlagsIfOverridden(features::kWebAssemblyInlining, "--experimental-wasm-inlining", "--no-experimental-wasm-inlining"); + SetV8FlagsIfOverridden(features::kWebAssemblyLiftoffCodeFlushing, + "--flush-liftoff-code", "--no-flush-liftoff-code"); SetV8FlagsIfOverridden(features::kWebAssemblyGenericWrapper, "--wasm-to-js-generic-wrapper", "--no-wasm-to-js-generic-wrapper"); diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 3ca4ae02873f26..e1a18037937930 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json @@ -21541,6 +21541,34 @@ ] } ], + "V8WasmCodeFlushing": [ + { + "platforms": [ + "android", + "android_weblayer", + "android_webview", + "chromeos", + "chromeos_lacros", + "linux", + "mac", + "windows" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "WebAssemblyLiftoffCodeFlushing" + ] + }, + { + "name": "Control", + "disable_features": [ + "WebAssemblyLiftoffCodeFlushing" + ] + } + ] + } + ], "V8WasmInlining": [ { "platforms": [