Skip to content

Commit

Permalink
[gin] Add a feature flag to control lazy feedback allocation in V8
Browse files Browse the repository at this point in the history
We would like to run a finch trial on this feature.

Bug: v8:8394
Change-Id: Iecac081955574c4add95627e10c3dbd5eda547c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1642640
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#666243}
  • Loading branch information
mythrialle authored and Commit Bot committed Jun 5, 2019
1 parent 9c1267e commit 258ae11
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 @@ -14,6 +14,10 @@ const base::Feature kV8OptimizeJavascript{"V8OptimizeJavascript",
const base::Feature kV8FlushBytecode{"V8FlushBytecode",
base::FEATURE_ENABLED_BY_DEFAULT};

// Enables lazy feedback allocation in V8.
const base::Feature kV8LazyFeedbackAllocation{"V8LazyFeedbackAllocation",
base::FEATURE_ENABLED_BY_DEFAULT};

// Enables memory reducer for small heaps in V8.
const base::Feature kV8MemoryReducerForSmallHeaps{
"V8MemoryReducerForSmallHeaps", 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 @@ -12,6 +12,7 @@ namespace features {

GIN_EXPORT extern const base::Feature kV8OptimizeJavascript;
GIN_EXPORT extern const base::Feature kV8FlushBytecode;
GIN_EXPORT extern const base::Feature kV8LazyFeedbackAllocation;
GIN_EXPORT extern const base::Feature kV8MemoryReducerForSmallHeaps;
GIN_EXPORT extern const base::Feature kV8HugeMaxOldGenerationSize;

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

if (!base::FeatureList::IsEnabled(features::kV8LazyFeedbackAllocation)) {
static const char no_lazy_feedback_allocation[] =
"--no-lazy-feedback-allocation";
v8::V8::SetFlagsFromString(no_lazy_feedback_allocation,
sizeof(no_lazy_feedback_allocation) - 1);
}

if (!base::FeatureList::IsEnabled(features::kV8MemoryReducerForSmallHeaps)) {
static const char no_memory_reducer[] =
"--no-memory-reducer-for-small-heaps";
Expand Down

0 comments on commit 258ae11

Please sign in to comment.