Commit efe828e6 authored by yangguo's avatar yangguo Committed by Commit bot

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.

R=vogelheim@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#26982}
parent bde19497
......@@ -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.
......
......@@ -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
......
......@@ -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);
......
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