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

Unified Diff: runtime/vm/dart.cc

Issue 2583673002: When creating a JIT app snapshot, don't recreate the VM isolate snapshot. (Closed)
Patch Set: Created 4 years 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
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 5658980b7d86317e9e888daedab1c508b7ad9d0c..ddc82d89265021e75cee507406bd9f0dd235f0a6 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -224,23 +224,21 @@ char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
if (data_snapshot == NULL) {
return strdup("Missing rodata snapshot");
}
- vm_isolate_->SetupInstructionsSnapshotPage(instructions_snapshot);
- vm_isolate_->SetupDataSnapshotPage(data_snapshot);
} else if (Snapshot::IsFull(snapshot_kind_)) {
#if defined(DART_PRECOMPILED_RUNTIME)
return strdup("Precompiled runtime requires a precompiled snapshot");
#else
- if (instructions_snapshot != NULL) {
- return strdup("Unexpected instructions snapshot");
- }
- if (data_snapshot != NULL) {
- return strdup("Unexpected rodata snapshot");
- }
StubCode::InitOnce();
#endif
} else {
return strdup("Invalid vm isolate snapshot seen");
}
+ if (instructions_snapshot != NULL) {
+ vm_isolate_->SetupInstructionsSnapshotPage(instructions_snapshot);
+ }
+ if (instructions_snapshot != NULL) {
+ vm_isolate_->SetupDataSnapshotPage(data_snapshot);
+ }
VmIsolateSnapshotReader reader(snapshot->kind(), snapshot->content(),
snapshot->length(), instructions_snapshot,
data_snapshot, T);
@@ -531,7 +529,9 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer,
const String& message = String::Handle(String::New("Invalid snapshot"));
return ApiError::New(message);
}
- if (snapshot->kind() != snapshot_kind_) {
+ if (snapshot->kind() != snapshot_kind_ &&
+ !((snapshot->kind() == Snapshot::kAppJIT) &&
+ (snapshot_kind_ == Snapshot::kCore))) {
const String& message = String::Handle(
String::NewFormatted("Invalid snapshot kind: got '%s', expected '%s'",
Snapshot::KindToCString(snapshot->kind()),

Powered by Google App Engine
This is Rietveld 408576698