Reviewers: vogelheim,
Message:
This is actually long overdue.
Description:
Disable experimental natives when creating a start-up snapshot.
Re-installing experimental natives after deserialization causes failures if
said experimental native is already included in the snapshot. However, there
is no way to tell whether a certain harmony feature has been included.
Experimental natives may also be turned on/off on-demand, which a snapshot
that includes them would not support for all cases.
The simple solution for the meantime is to never include experimental
natives
in the snapshot and initialize them after deserialization on-demand.
[email protected]
Please review this at https://codereview.chromium.org/981473002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+7, -16 lines):
M src/bootstrapper.cc
M src/mksnapshot.cc
M test/cctest/test-serialize.cc
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index
eb2269c15ecf6292d86e553157b532a33d5894ab..960406d59ad6726b3bb4f3f4cc0dea541d8b1d6f
100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2891,9 +2891,13 @@ Genesis::Genesis(Isolate* isolate,
isolate->counters()->contexts_created_from_scratch()->Increment();
}
- // Install experimental natives.
- if (!InstallExperimentalNatives()) return;
- InitializeExperimentalGlobal();
+ // 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()) {
+ if (!InstallExperimentalNatives()) return;
+ InitializeExperimentalGlobal();
+ }
// The serializer cannot serialize typed arrays. Reset those typed arrays
// for each new context.
Index: src/mksnapshot.cc
diff --git a/src/mksnapshot.cc b/src/mksnapshot.cc
index
c9b8066959fc321a25e02ac2bfdb00774d5d972e..450dfac8a94ee0ba01aa652044a0d7755824a3c8
100644
--- a/src/mksnapshot.cc
+++ b/src/mksnapshot.cc
@@ -138,11 +138,6 @@ char* GetExtraCode(char* filename) {
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;
-
i::FLAG_logfile_per_isolate = false;
// Print the usage if an error occurs when parsing the command line
Index: test/cctest/test-serialize.cc
diff --git a/test/cctest/test-serialize.cc b/test/cctest/test-serialize.cc
index
3a2d6f26d97db3356a207bf98db69a20b072696d..e16be9775c582d925ec5c6c6e43fe116c46672f4
100644
--- a/test/cctest/test-serialize.cc
+++ b/test/cctest/test-serialize.cc
@@ -706,10 +706,6 @@
UNINITIALIZED_DEPENDENT_TEST(CustomContextDeserialization,
TEST(PerIsolateSnapshotBlobs) {
- // Disable experimental natives that are loaded after deserialization.
- FLAG_harmony_shipping = false;
- FlagList::EnforceFlagImplications();
-
const char* source1 = "function f() { return 42; }";
const char* source2 =
"function f() { return g() * 2; }"
@@ -749,10 +745,6 @@ TEST(PerIsolateSnapshotBlobs) {
TEST(PerIsolateSnapshotBlobsWithLocker) {
- // Disable experimental natives that are loaded after deserialization.
- FLAG_harmony_shipping = false;
- FlagList::EnforceFlagImplications();
-
v8::Isolate* isolate0 = v8::Isolate::New();
{
v8::Locker locker(isolate0);
--
--
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.