Reviewers: Yang,

Message:
PTAL

Description:
Switch the order of experimental global initialization and running natives.

The order should match the one for normal natives.

[email protected]

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

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

Affected files (+12, -12 lines):
  M src/bootstrapper.cc
  M src/regexp.js


Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index ff4026ce6ba4dfada69e9f831470bd4a215c1bc6..4a28639197f71cf5ee639105aa5983239d153f20 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1706,10 +1706,9 @@ void Genesis::InitializeGlobal_harmony_regexps() {

   Handle<HeapObject> flag(FLAG_harmony_regexps ? heap()->true_value()
                                                : heap()->false_value());
-  PropertyAttributes attributes =
-      static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY);
- Runtime::DefineObjectProperty(builtins, factory()->harmony_regexps_string(),
-                                flag, attributes).Assert();
+  Runtime::SetObjectProperty(isolate(), builtins,
+                             factory()->harmony_regexps_string(), flag,
+                             STRICT).Assert();
 }


@@ -1718,11 +1717,9 @@ void Genesis::InitializeGlobal_harmony_unicode_regexps() {

Handle<HeapObject> flag(FLAG_harmony_unicode_regexps ? heap()->true_value() : heap()->false_value());
-  PropertyAttributes attributes =
-      static_cast<PropertyAttributes>(DONT_DELETE | READ_ONLY);
-  Runtime::DefineObjectProperty(builtins,
- factory()->harmony_unicode_regexps_string(),
-                                flag, attributes).Assert();
+  Runtime::SetObjectProperty(isolate(), builtins,
+ factory()->harmony_unicode_regexps_string(), flag,
+                             STRICT).Assert();
 }


@@ -2890,9 +2887,10 @@ Genesis::Genesis(Isolate* isolate,
// Install experimental natives. Do not include them into the snapshot as we
   // should be able to turn them off at runtime. Re-installing them after
   // they have already been deserialized would also fail.
- if (!isolate->serializer_enabled() && !InstallExperimentalNatives()) return;
-
-  InitializeExperimentalGlobal();
+  if (!isolate->serializer_enabled()) {
+    InitializeExperimentalGlobal();
+    if (!InstallExperimentalNatives()) return;
+  }

   // The serializer cannot serialize typed arrays. Reset those typed arrays
   // for each new context.
Index: src/regexp.js
diff --git a/src/regexp.js b/src/regexp.js
index 416f5865e217973554c2192c816b915db372c20a..babbae74aab450eee92032d21761f9fc598a6b7e 100644
--- a/src/regexp.js
+++ b/src/regexp.js
@@ -8,6 +8,8 @@
 // var $Array = global.Array;

 var $RegExp = global.RegExp;
+var harmony_regexps = false;
+var harmony_unicode_regexps = false;

 // -------------------------------------------------------------------



--
--
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