Skip to content

Commit

Permalink
[v8] Add feature flag for --sparkplug-needs-short-builtins
Browse files Browse the repository at this point in the history
Change-Id: Ic3df96c39ddff116c5cd45216689b30ca21c03bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2988760
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Auto-Submit: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#896083}
  • Loading branch information
LeszekSwirski authored and Chromium LUCI CQ committed Jun 25, 2021
1 parent 26e0138 commit 4cc4036
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gin/gin_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ const base::Feature kV8Turboprop{"V8Turboprop",
const base::Feature kV8Sparkplug{"V8Sparkplug",
base::FEATURE_DISABLED_BY_DEFAULT};

// Makes sure the experimental Sparkplug compiler is only enabled if short
// builtin calls are enabled too.
const base::Feature kV8SparkplugNeedsShortBuiltinCalls{
"V8SparkplugNeedsShortBuiltinCalls", base::FEATURE_DISABLED_BY_DEFAULT};

// Enables short builtin calls feature.
const base::Feature kV8ShortBuiltinCalls{"V8ShortBuiltinCalls",
base::FEATURE_ENABLED_BY_DEFAULT};
Expand Down
1 change: 1 addition & 0 deletions gin/gin_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ GIN_EXPORT extern const base::Feature kV8ExperimentalRegexpEngine;
GIN_EXPORT extern const base::Feature kV8TurboFastApiCalls;
GIN_EXPORT extern const base::Feature kV8Turboprop;
GIN_EXPORT extern const base::Feature kV8Sparkplug;
GIN_EXPORT extern const base::Feature kV8SparkplugNeedsShortBuiltinCalls;
GIN_EXPORT extern const base::Feature kV8ScriptAblation;
GIN_EXPORT extern const base::FeatureParam<int> kV8ScriptDelayOnceMs;
GIN_EXPORT extern const base::FeatureParam<int> kV8ScriptDelayMs;
Expand Down
5 changes: 5 additions & 0 deletions gin/v8_initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,11 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
SetV8Flags("--sparkplug");
}

if (base::FeatureList::IsEnabled(
features::kV8SparkplugNeedsShortBuiltinCalls)) {
SetV8Flags("--sparkplug-needs-short-builtins");
}

if (base::FeatureList::IsEnabled(features::kV8UntrustedCodeMitigations)) {
SetV8Flags("--untrusted-code-mitigations");
} else {
Expand Down

0 comments on commit 4cc4036

Please sign in to comment.