mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 15:21:54 +00:00
Complain if an embedder fails to provide a vm isolate or isolate snapshot to a VM built without DART_NO_SNAPSHOT.
Closes #27649 R=asiva@google.com Review URL: https://codereview.chromium.org/2441193002 .
This commit is contained in:
parent
7c14d5e7d7
commit
e56d8eef56
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue