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": [