Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Unified Diff: src/api.cc

Issue 2736923002: SnapshotCreator: start from existing snapshot if we have one (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/external-reference-table.h » ('j') | src/snapshot/code-serializer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 866a0bc22441e84f5339397ba42f9ce2c190ea44..063cfa75bbd5e6bded8254dc0e08bb8db9320cd2 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -515,7 +515,15 @@ SnapshotCreator::SnapshotCreator(intptr_t* external_references,
internal_isolate->set_snapshot_blob(existing_snapshot);
i::Snapshot::Initialize(internal_isolate);
} else {
- internal_isolate->Init(nullptr);
+ // If we have a snapshot, use it for bootstrapping; otherwise start
+ // from scratch.
+ const StartupData* snapshot_blob = i::Snapshot::DefaultSnapshotBlob();
Yang 2017/03/07 11:28:11 We could also make this the default parameter for
Jakob Kummerow 2017/03/07 12:39:15 Done.
+ if (snapshot_blob != nullptr && snapshot_blob->raw_size > 0) {
+ internal_isolate->set_snapshot_blob(snapshot_blob);
+ i::Snapshot::Initialize(internal_isolate);
+ } else {
+ internal_isolate->Init(nullptr);
+ }
}
data_ = data;
}
« no previous file with comments | « no previous file | src/external-reference-table.h » ('j') | src/snapshot/code-serializer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698