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

Unified Diff: runtime/vm/dart_api_impl.cc

Issue 10871005: Make ClassFinalizer indifferent on whether we are generating a snapshot or not. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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 | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_impl.cc
===================================================================
--- runtime/vm/dart_api_impl.cc (revision 11197)
+++ runtime/vm/dart_api_impl.cc (working copy)
@@ -85,19 +85,12 @@
// TODO(turnidge): Make this function return an error handle directly
// rather than returning an error string. The current behavior can
// cause compilation errors to appear to be api errors.
-const char* CheckIsolateState(Isolate* isolate, bool generating_snapshot) {
- bool success = true;
- if (!ClassFinalizer::AllClassesFinalized()) {
- success = (generating_snapshot) ?
- ClassFinalizer::FinalizePendingClassesForSnapshotCreation() :
- ClassFinalizer::FinalizePendingClasses();
+const char* CheckIsolateState(Isolate* isolate) {
+ if (ClassFinalizer::FinalizePendingClasses() &&
+ isolate->object_store()->PreallocateObjects()) {
+ // Success.
+ return NULL;
}
- if (success) {
- success = isolate->object_store()->PreallocateObjects();
- if (success) {
- return NULL;
- }
- }
// 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 Error& err = Error::Handle(isolate->object_store()->sticky_error());
@@ -816,8 +809,7 @@
if (size == NULL) {
RETURN_NULL_ERROR(size);
}
- const char* msg = CheckIsolateState(isolate,
- ClassFinalizer::kGeneratingSnapshot);
+ const char* msg = CheckIsolateState(isolate);
if (msg != NULL) {
return Api::NewError(msg);
}
« no previous file with comments | « runtime/vm/dart_api_impl.h ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698