Skip to content

Commit

Permalink
Add flag for disabling reclamation of unmodified wrappers
Browse files Browse the repository at this point in the history
Will be used in a Finch experiment.

Bug: chromium:1107901
Change-Id: I68ea04be372ef2a931519c6d63916ed6001d7a26
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2312816
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#790833}
  • Loading branch information
mlippautz authored and Commit Bot committed Jul 22, 2020
1 parent 23e4df6 commit a407727
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gin/gin_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ const base::Feature kV8FlushEmbeddedBlobICache{
const base::Feature kV8ReduceConcurrentMarkingTasks{
"V8ReduceConcurrentMarkingTasks", base::FEATURE_DISABLED_BY_DEFAULT};

// Disables reclaiming of unmodified wrappers objects.
const base::Feature kV8NoReclaimUnmodifiedWrappers{
"V8NoReclaimUnmodifiedWrappers", base::FEATURE_DISABLED_BY_DEFAULT};

} // namespace features
1 change: 1 addition & 0 deletions gin/gin_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GIN_EXPORT extern const base::Feature kV8ConcurrentInlining;
GIN_EXPORT extern const base::Feature kV8PerContextMarkingWorklist;
GIN_EXPORT extern const base::Feature kV8FlushEmbeddedBlobICache;
GIN_EXPORT extern const base::Feature kV8ReduceConcurrentMarkingTasks;
GIN_EXPORT extern const base::Feature kV8NoReclaimUnmodifiedWrappers;

} // namespace features

Expand Down
7 changes: 7 additions & 0 deletions gin/v8_initializer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode) {
sizeof(gc_experiment_reduce_concurrent_marking_tasks) - 1);
}

if (base::FeatureList::IsEnabled(features::kV8NoReclaimUnmodifiedWrappers)) {
static constexpr char no_reclaim_unmodified_wrappers[] =
"--no-reclaim-unmodified-wrappers";
v8::V8::SetFlagsFromString(no_reclaim_unmodified_wrappers,
sizeof(no_reclaim_unmodified_wrappers) - 1);
}

if (IsolateHolder::kStrictMode == mode) {
static const char use_strict[] = "--use_strict";
v8::V8::SetFlagsFromString(use_strict, sizeof(use_strict) - 1);
Expand Down

0 comments on commit a407727

Please sign in to comment.