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

Unified Diff: runtime/vm/dart.cc

Issue 2441193002: Complain if an embedder fails to provide a vm isolate or isolate snapshot to a VM built without DAR… (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index b4534c9b535636401494231df15f31c768c1a64f..413dad3b8e021c43b6268efe394575c276f6b56f 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -270,6 +270,8 @@ char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
} else {
#if defined(DART_PRECOMPILED_RUNTIME)
return strdup("Precompiled runtime requires a precompiled snapshot");
+#elif !defined(DART_NO_SNAPSHOT)
+ return strdup("Missing vm isolate snapshot");
#else
snapshot_kind_ = Snapshot::kNone;
StubCode::InitOnce();
@@ -522,7 +524,7 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer);
if (snapshot == NULL) {
const String& message = String::Handle(
- String::New("Invalid snapshot."));
+ String::New("Invalid snapshot"));
return ApiError::New(message);
}
ASSERT(Snapshot::IsFull(snapshot->kind()));
@@ -551,7 +553,11 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
MegamorphicCacheTable::PrintSizes(I);
}
} else {
- ASSERT(snapshot_kind_ == Snapshot::kNone);
+ if (snapshot_kind_ != Snapshot::kNone) {
+ const String& message = String::Handle(
+ String::New("Missing isolate snapshot"));
+ return ApiError::New(message);
+ }
}
Object::VerifyBuiltinVtables();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698