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

Unified Diff: src/api.cc

Issue 2736923002: SnapshotCreator: start from existing snapshot if we have one (Closed)
Patch Set: addressed comments 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') | no next file with comments »
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..483f07a9f241d1df59627af1c1d52c1d4cf19dc8 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -511,8 +511,11 @@ SnapshotCreator::SnapshotCreator(intptr_t* external_references,
internal_isolate->set_array_buffer_allocator(&data->allocator_);
internal_isolate->set_api_external_references(external_references);
isolate->Enter();
- if (existing_snapshot) {
- internal_isolate->set_snapshot_blob(existing_snapshot);
+ const StartupData* blob = existing_snapshot
+ ? existing_snapshot
+ : i::Snapshot::DefaultSnapshotBlob();
+ if (blob && blob->raw_size > 0) {
+ internal_isolate->set_snapshot_blob(blob);
i::Snapshot::Initialize(internal_isolate);
} else {
internal_isolate->Init(nullptr);
« no previous file with comments | « no previous file | src/external-reference-table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698