Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(782)

Unified Diff: gin/isolate_holder.cc

Issue 1835553002: Control ES2015 'Tail call elimination' language feature via finch flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed redness by moving FeatureList initialization in tests up the call stack. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gin/isolate_holder.cc
diff --git a/gin/isolate_holder.cc b/gin/isolate_holder.cc
index c05cd1e42db03c95849df9c022a0315a65b2f39f..29a7f1babb92be5d8c8d8ee77c3736f1816ba22a 100644
--- a/gin/isolate_holder.cc
+++ b/gin/isolate_holder.cc
@@ -9,6 +9,7 @@
#include <string.h>
#include <utility>
+#include "base/feature_list.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/sys_info.h"
@@ -81,6 +82,19 @@ void IsolateHolder::Initialize(ScriptMode mode,
CHECK(allocator);
V8Initializer::Initialize(mode, v8_extras_mode);
g_array_buffer_allocator = allocator;
+
+ // Initialize an instance of FeatureList. This will be a no-op if an instance
+ // was already set up by the embedder.
+ base::FeatureList::InitializeInstance();
+
+ const base::Feature kES2015TailCallsFeature {
+ "V8_ES2015_TailCalls", base::FEATURE_DISABLED_BY_DEFAULT
+ };
+ if (base::FeatureList::IsEnabled(kES2015TailCallsFeature)) {
+ static const char harmony_tailcalls[] = "--harmony-tailcalls";
+ v8::V8::SetFlagsFromString(harmony_tailcalls,
+ sizeof(harmony_tailcalls) - 1);
+ }
}
void IsolateHolder::AddRunMicrotasksObserver() {
« base/test/test_suite.cc ('K') | « content/test/test_blink_web_unit_test_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698