| Index: runtime/vm/dart_api_impl.cc
|
| ===================================================================
|
| --- runtime/vm/dart_api_impl.cc (revision 2103)
|
| +++ runtime/vm/dart_api_impl.cc (working copy)
|
| @@ -56,10 +56,15 @@
|
| static const char* CheckIsolateState(
|
| Isolate* isolate,
|
| bool generating_snapshot = ClassFinalizer::kNotGeneratingSnapshot) {
|
| - bool result = (generating_snapshot) ?
|
| + bool success = (generating_snapshot) ?
|
| ClassFinalizer::FinalizePendingClassesForSnapshotCreation() :
|
| ClassFinalizer::FinalizePendingClasses();
|
| - if (!result) {
|
| + if (success && !generating_snapshot) {
|
| + success = isolate->object_store()->PreallocateObjects();
|
| + }
|
| + if (success) {
|
| + return NULL;
|
| + } else {
|
| // Make a copy of the error message as the original message string
|
| // may get deallocated when we return back from the Dart API call.
|
| const String& err =
|
| @@ -70,7 +75,6 @@
|
| OS::SNPrint(msg, errlen, "%s", errmsg);
|
| return msg;
|
| }
|
| - return NULL;
|
| }
|
|
|
|
|
|
|