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