Commit 9e02e987 authored by dslomov's avatar dslomov Committed by Commit bot

Introduce a kill-switch for shipping features.

R=rossberg@chromium.org
TBR=hpayer@chromium.org

Committed: https://chromium.googlesource.com/v8/v8/+/d6285620868b15c84eb9affa59f6b4e869f074b8

Review URL: https://codereview.chromium.org/763273002

Cr-Commit-Position: refs/heads/master@{#25577}
parent e471bef9
...@@ -196,7 +196,6 @@ action("js2c") { ...@@ -196,7 +196,6 @@ action("js2c") {
"src/debug-debugger.js", "src/debug-debugger.js",
"src/mirror-debugger.js", "src/mirror-debugger.js",
"src/liveedit-debugger.js", "src/liveedit-debugger.js",
"src/harmony-string.js",
"src/macros.py", "src/macros.py",
] ]
...@@ -235,6 +234,7 @@ action("js2c_experimental") { ...@@ -235,6 +234,7 @@ action("js2c_experimental") {
"src/macros.py", "src/macros.py",
"src/proxy.js", "src/proxy.js",
"src/generator.js", "src/generator.js",
"src/harmony-string.js",
"src/harmony-array.js", "src/harmony-array.js",
"src/harmony-typedarray.js", "src/harmony-typedarray.js",
"src/harmony-classes.js", "src/harmony-classes.js",
......
...@@ -1342,11 +1342,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object, ...@@ -1342,11 +1342,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> global_object,
delegate->shared()->DontAdaptArguments(); delegate->shared()->DontAdaptArguments();
} }
#define FEATURE_INITIALIZE_GLOBAL(id, descr) InitializeGlobal_##id();
HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL)
#undef FEATURE_INITIALIZE_GLOBAL
// Initialize the embedder data slot. // Initialize the embedder data slot.
Handle<FixedArray> embedder_data = factory->NewFixedArray(3); Handle<FixedArray> embedder_data = factory->NewFixedArray(3);
native_context()->set_embedder_data(*embedder_data); native_context()->set_embedder_data(*embedder_data);
...@@ -1381,6 +1376,7 @@ void Genesis::InitializeExperimentalGlobal() { ...@@ -1381,6 +1376,7 @@ void Genesis::InitializeExperimentalGlobal() {
HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL)
HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL)
HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL)
#undef FEATURE_INITIALIZE_GLOBAL #undef FEATURE_INITIALIZE_GLOBAL
} }
...@@ -1560,10 +1556,6 @@ void Genesis::InstallNativeFunctions() { ...@@ -1560,10 +1556,6 @@ void Genesis::InstallNativeFunctions() {
INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange",
native_object_notifier_perform_change); native_object_notifier_perform_change);
INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator); INSTALL_NATIVE(JSFunction, "ArrayValues", array_values_iterator);
#define INSTALL_NATIVE_FUNCTIONS_FOR(id, descr) InstallNativeFunctions_##id();
HARMONY_SHIPPING(INSTALL_NATIVE_FUNCTIONS_FOR)
#undef INSTALL_NATIVE_FUNCTIONS_FOR
} }
...@@ -1578,6 +1570,7 @@ void Genesis::InstallExperimentalNativeFunctions() { ...@@ -1578,6 +1570,7 @@ void Genesis::InstallExperimentalNativeFunctions() {
#define INSTALL_NATIVE_FUNCTIONS_FOR(id, descr) InstallNativeFunctions_##id(); #define INSTALL_NATIVE_FUNCTIONS_FOR(id, descr) InstallNativeFunctions_##id();
HARMONY_INPROGRESS(INSTALL_NATIVE_FUNCTIONS_FOR) HARMONY_INPROGRESS(INSTALL_NATIVE_FUNCTIONS_FOR)
HARMONY_STAGED(INSTALL_NATIVE_FUNCTIONS_FOR) HARMONY_STAGED(INSTALL_NATIVE_FUNCTIONS_FOR)
HARMONY_SHIPPING(INSTALL_NATIVE_FUNCTIONS_FOR)
#undef INSTALL_NATIVE_FUNCTIONS_FOR #undef INSTALL_NATIVE_FUNCTIONS_FOR
} }
...@@ -2195,16 +2188,12 @@ bool Genesis::InstallExperimentalNatives() { ...@@ -2195,16 +2188,12 @@ bool Genesis::InstallExperimentalNatives() {
} \ } \
} \ } \
} }
// Iterate over flags that are not enabled by default.
HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES); HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES);
HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES); HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES);
HARMONY_SHIPPING(INSTALL_EXPERIMENTAL_NATIVES);
#undef INSTALL_EXPERIMENTAL_NATIVES #undef INSTALL_EXPERIMENTAL_NATIVES
} }
#define USE_NATIVES_FOR_FEATURE(id, descr) USE(id##_natives);
HARMONY_SHIPPING(USE_NATIVES_FOR_FEATURE)
#undef USE_NATIVES_FOR_FEATURE
InstallExperimentalNativeFunctions(); InstallExperimentalNativeFunctions();
return true; return true;
} }
......
...@@ -157,6 +157,7 @@ DEFINE_BOOL(use_strict, false, "enforce strict mode") ...@@ -157,6 +157,7 @@ DEFINE_BOOL(use_strict, false, "enforce strict mode")
DEFINE_BOOL(es_staging, false, "enable all completed harmony features") DEFINE_BOOL(es_staging, false, "enable all completed harmony features")
DEFINE_BOOL(harmony, false, "enable all completed harmony features") DEFINE_BOOL(harmony, false, "enable all completed harmony features")
DEFINE_BOOL(harmony_shipping, true, "enable all shipped harmony fetaures")
DEFINE_IMPLICATION(harmony, es_staging) DEFINE_IMPLICATION(harmony, es_staging)
DEFINE_IMPLICATION(es_staging, harmony) DEFINE_IMPLICATION(es_staging, harmony)
...@@ -200,8 +201,9 @@ HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES) ...@@ -200,8 +201,9 @@ HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES)
HARMONY_STAGED(FLAG_STAGED_FEATURES) HARMONY_STAGED(FLAG_STAGED_FEATURES)
#undef FLAG_STAGED_FEATURES #undef FLAG_STAGED_FEATURES
#define FLAG_SHIPPING_FEATURES(id, description) \ #define FLAG_SHIPPING_FEATURES(id, description) \
DEFINE_BOOL_READONLY(id, true, "enable " #description) DEFINE_BOOL(id, false, "enable " #description) \
DEFINE_IMPLICATION(harmony_shipping, id)
HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES) HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES)
#undef FLAG_SHIPPING_FEATURES #undef FLAG_SHIPPING_FEATURES
......
...@@ -262,6 +262,10 @@ int main(int argc, char** argv) { ...@@ -262,6 +262,10 @@ int main(int argc, char** argv) {
// By default, log code create information in the snapshot. // By default, log code create information in the snapshot.
i::FLAG_log_code = true; i::FLAG_log_code = true;
// Omit from the snapshot natives for features that can be turned off
// at runtime.
i::FLAG_harmony_shipping = false;
// Print the usage if an error occurs when parsing the command line // Print the usage if an error occurs when parsing the command line
// flags or if the help flag is set. // flags or if the help flag is set.
int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true);
......
...@@ -7705,7 +7705,7 @@ static void ResetWeakHandle(bool global_gc) { ...@@ -7705,7 +7705,7 @@ static void ResetWeakHandle(bool global_gc) {
object_a.handle.Reset(iso, a); object_a.handle.Reset(iso, a);
object_b.handle.Reset(iso, b); object_b.handle.Reset(iso, b);
if (global_gc) { if (global_gc) {
CcTest::heap()->CollectAllGarbage(TestHeap::Heap::kNoGCFlags); CcTest::heap()->CollectAllAvailableGarbage();
} else { } else {
CcTest::heap()->CollectGarbage(i::NEW_SPACE); CcTest::heap()->CollectGarbage(i::NEW_SPACE);
} }
...@@ -7721,7 +7721,7 @@ static void ResetWeakHandle(bool global_gc) { ...@@ -7721,7 +7721,7 @@ static void ResetWeakHandle(bool global_gc) {
CHECK(object_b.handle.IsIndependent()); CHECK(object_b.handle.IsIndependent());
} }
if (global_gc) { if (global_gc) {
CcTest::heap()->CollectAllGarbage(TestHeap::Heap::kNoGCFlags); CcTest::heap()->CollectAllAvailableGarbage();
} else { } else {
CcTest::heap()->CollectGarbage(i::NEW_SPACE); CcTest::heap()->CollectGarbage(i::NEW_SPACE);
} }
......
...@@ -27,6 +27,12 @@ ...@@ -27,6 +27,12 @@
// Flags: --expose-debug-as debug --expose-gc --send-idle-notification // Flags: --expose-debug-as debug --expose-gc --send-idle-notification
// Flags: --allow-natives-syntax // Flags: --allow-natives-syntax
// Flags: --noharmony-shipping
// Note: this test checks that that the number of scripts reported as native
// by Debug.scripts() is the same as a number of core native scripts.
// Native scripts that are added by --harmony-shipping are classified
// as 'experimental', but are still returned by Debug.scripts(), so
// we disable harmony-shipping for this test
// Get the Debug object exposed from the debug context global object. // Get the Debug object exposed from the debug context global object.
Debug = debug.Debug; Debug = debug.Debug;
......
...@@ -1624,13 +1624,13 @@ ...@@ -1624,13 +1624,13 @@
'../../src/debug-debugger.js', '../../src/debug-debugger.js',
'../../src/mirror-debugger.js', '../../src/mirror-debugger.js',
'../../src/liveedit-debugger.js', '../../src/liveedit-debugger.js',
'../../src/harmony-string.js',
'../../src/macros.py', '../../src/macros.py',
], ],
'experimental_library_files': [ 'experimental_library_files': [
'../../src/macros.py', '../../src/macros.py',
'../../src/proxy.js', '../../src/proxy.js',
'../../src/generator.js', '../../src/generator.js',
'../../src/harmony-string.js',
'../../src/harmony-array.js', '../../src/harmony-array.js',
'../../src/harmony-tostring.js', '../../src/harmony-tostring.js',
'../../src/harmony-typedarray.js', '../../src/harmony-typedarray.js',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment