Reviewers: rossberg,

Message:
PTAL

Description:
Introduce a kill-switch for shipping features.

[email protected]

Please review this at https://codereview.chromium.org/763273002/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+14, -19 lines):
  M BUILD.gn
  M src/bootstrapper.cc
  M src/flag-definitions.h
  M src/mksnapshot.cc
  M test/mjsunit/debug-script.js
  M tools/gyp/v8.gyp


Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 0c7fae6d1de01ef341dd7c267ad795607722cb65..a1abf9a2eb61a9431d52feb18bf908f240559e30 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -196,7 +196,6 @@ action("js2c") {
     "src/debug-debugger.js",
     "src/mirror-debugger.js",
     "src/liveedit-debugger.js",
-    "src/harmony-string.js",
     "src/macros.py",
   ]

@@ -235,6 +234,7 @@ 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",
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 5830370960cfa7b75f3a390dc87ef8a295be12a6..5fed34927993fb38b850f6de753833bd70b32edc 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1342,11 +1342,6 @@ void Genesis::InitializeGlobal(Handle<GlobalObject> 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<FixedArray> embedder_data = factory->NewFixedArray(3);
   native_context()->set_embedder_data(*embedder_data);
@@ -1381,6 +1376,7 @@ void Genesis::InitializeExperimentalGlobal() {

   HARMONY_INPROGRESS(FEATURE_INITIALIZE_GLOBAL)
   HARMONY_STAGED(FEATURE_INITIALIZE_GLOBAL)
+  HARMONY_SHIPPING(FEATURE_INITIALIZE_GLOBAL)
 #undef FEATURE_INITIALIZE_GLOBAL
 }

@@ -1560,10 +1556,6 @@ 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
 }


@@ -1578,6 +1570,7 @@ 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
 }

@@ -2195,16 +2188,12 @@ 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;
 }
Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index d17f64facba134f1bc03770c5f97c7aecc8f7124..16e9171eb9ce4aff6cc378b649d42ad1570d8ec8 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -157,6 +157,7 @@ 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)

@@ -200,8 +201,9 @@ HARMONY_INPROGRESS(FLAG_INPROGRESS_FEATURES)
 HARMONY_STAGED(FLAG_STAGED_FEATURES)
 #undef FLAG_STAGED_FEATURES

-#define FLAG_SHIPPING_FEATURES(id, description) \
-  DEFINE_BOOL_READONLY(id, true, "enable " #description)
+#define FLAG_SHIPPING_FEATURES(id, description)  \
+  DEFINE_BOOL(id, false, "enable " #description) \
+  DEFINE_IMPLICATION(harmony_shipping, id)
 HARMONY_SHIPPING(FLAG_SHIPPING_FEATURES)
 #undef FLAG_SHIPPING_FEATURES

Index: src/mksnapshot.cc
diff --git a/src/mksnapshot.cc b/src/mksnapshot.cc
index 3264f3743f7f166fbbe239c1bd572c8bbc98d376..544e7393eae59da5d79f81cfcf760e30248ae9ef 100644
--- a/src/mksnapshot.cc
+++ b/src/mksnapshot.cc
@@ -262,6 +262,10 @@ 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);
Index: test/mjsunit/debug-script.js
diff --git a/test/mjsunit/debug-script.js b/test/mjsunit/debug-script.js
index 44102c29a2e2763980512ed88b594d068d3847d0..2d4b350b2070a7832d3ae18016b5f005e4ad67b0 100644
--- a/test/mjsunit/debug-script.js
+++ b/test/mjsunit/debug-script.js
@@ -26,7 +26,7 @@
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 // Flags: --expose-debug-as debug --expose-gc --send-idle-notification
-// Flags: --allow-natives-syntax
+// Flags: --allow-natives-syntax --noharmony-shipping

 // Get the Debug object exposed from the debug context global object.
 Debug = debug.Debug;
Index: tools/gyp/v8.gyp
diff --git a/tools/gyp/v8.gyp b/tools/gyp/v8.gyp
index 4958528e8cc58b369dffda0f20ea87050e3778d0..fb67a2fc340af2d716ea73865d263f71798396c5 100644
--- a/tools/gyp/v8.gyp
+++ b/tools/gyp/v8.gyp
@@ -1627,13 +1627,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',


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to