From 557bf53b79ee28ee4752ef8d0d26195615f0ab87 Mon Sep 17 00:00:00 2001 From: dslomov Date: Fri, 28 Nov 2014 10:27:45 -0800 Subject: [PATCH] Revert of Introduce a kill-switch for shipping features. (patchset #2 id:20001 of https://codereview.chromium.org/763273002/) Reason for revert: Reverted for breaking nosnap: http://chromegw.corp.google.com/i/client.v8/builders/V8%20Linux%20-%20nosnap/builds/1003/steps/Check/logs/Threading3 Original issue's description: > Introduce a kill-switch for shipping features. > > R=rossberg@chromium.org > > Committed: https://chromium.googlesource.com/v8/v8/+/d6285620868b15c84eb9affa59f6b4e869f074b8 TBR=rossberg@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/763353002 Cr-Commit-Position: refs/heads/master@{#25574} --- BUILD.gn | 2 +- src/bootstrapper.cc | 17 ++++++++++++++--- src/flag-definitions.h | 6 ++---- src/mksnapshot.cc | 4 ---- test/mjsunit/debug-script.js | 6 ------ tools/gyp/v8.gyp | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 31aa95fc6f..3c9b1166b2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -196,6 +196,7 @@ action("js2c") { "src/debug-debugger.js", "src/mirror-debugger.js", "src/liveedit-debugger.js", + "src/harmony-string.js", "src/macros.py", ] @@ -234,7 +235,6 @@ action("js2c_experimental") { "src/macros.py", "src/proxy.js", "src/generator.js", - "src/harmony-string.js", "src/harmony-array.js", "src/harmony-typedarray.js", "src/harmony-classes.js", diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 5fed349279..5830370960 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -1342,6 +1342,11 @@ void Genesis::InitializeGlobal(Handle global_object, 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. Handle embedder_data = factory->NewFixedArray(3); native_context()->set_embedder_data(*embedder_data); @@ -1376,7 +1381,6 @@ void Genesis::InitializeExperimentalGlobal() { HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL) HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL) - HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL) #undef FEATURE_INITIALIZE_GLOBAL } @@ -1556,6 +1560,10 @@ void Genesis::InstallNativeFunctions() { INSTALL_NATIVE(JSFunction, "NativeObjectNotifierPerformChange", native_object_notifier_perform_change); 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 } @@ -1570,7 +1578,6 @@ void Genesis::InstallExperimentalNativeFunctions() { #define INSTALL_NATIVE_FUNCTIONS_FOR(id, descr) InstallNativeFunctions_##id(); HARMONY_INPROGRESS(INSTALL_NATIVE_FUNCTIONS_FOR) HARMONY_STAGED(INSTALL_NATIVE_FUNCTIONS_FOR) - HARMONY_SHIPPING(INSTALL_NATIVE_FUNCTIONS_FOR) #undef INSTALL_NATIVE_FUNCTIONS_FOR } @@ -2188,12 +2195,16 @@ bool Genesis::InstallExperimentalNatives() { } \ } \ } + // Iterate over flags that are not enabled by default. HARMONY_INPROGRESS(INSTALL_EXPERIMENTAL_NATIVES); HARMONY_STAGED(INSTALL_EXPERIMENTAL_NATIVES); - HARMONY_SHIPPING(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(); return true; } diff --git a/src/flag-definitions.h b/src/flag-definitions.h index d1e74b640c..1460315dbb 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -157,7 +157,6 @@ DEFINE_BOOL(use_strict, false, "enforce strict mode") DEFINE_BOOL(es_staging, 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(es_staging, harmony) @@ -201,9 +200,8 @@ HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES) HARMONY_STAGED(FLAG_STAGED_FEATURES) #undef FLAG_STAGED_FEATURES -#define FLAG_SHIPPING_FEATURES(id, description) \ - DEFINE_BOOL(id, false, "enable " #description) \ - DEFINE_IMPLICATION(harmony_shipping, id) +#define FLAG_SHIPPING_FEATURES(id, description) \ + DEFINE_BOOL_READONLY(id, true, "enable " #description) HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES) #undef FLAG_SHIPPING_FEATURES diff --git a/src/mksnapshot.cc b/src/mksnapshot.cc index 544e7393ea..3264f3743f 100644 --- a/src/mksnapshot.cc +++ b/src/mksnapshot.cc @@ -262,10 +262,6 @@ int main(int argc, char** argv) { // By default, log code create information in the snapshot. 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 // flags or if the help flag is set. int result = i::FlagList::SetFlagsFromCommandLine(&argc, argv, true); diff --git a/test/mjsunit/debug-script.js b/test/mjsunit/debug-script.js index 07f0e3c459..44102c29a2 100644 --- a/test/mjsunit/debug-script.js +++ b/test/mjsunit/debug-script.js @@ -27,12 +27,6 @@ // Flags: --expose-debug-as debug --expose-gc --send-idle-notification // 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. Debug = debug.Debug; diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp index 4a6a397221..939a2c2e7c 100644 --- a/tools/gyp/v8.gyp +++ b/tools/gyp/v8.gyp @@ -1624,13 +1624,13 @@ '../../src/debug-debugger.js', '../../src/mirror-debugger.js', '../../src/liveedit-debugger.js', + '../../src/harmony-string.js', '../../src/macros.py', ], 'experimental_library_files': [ '../../src/macros.py', '../../src/proxy.js', '../../src/generator.js', - '../../src/harmony-string.js', '../../src/harmony-array.js', '../../src/harmony-tostring.js', '../../src/harmony-typedarray.js',