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

Unified Diff: vm/dart_api_impl.cc

Issue 9580036: - Always write a Null Object for Code objects (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 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 | « vm/code_generator.cc ('k') | vm/object_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl.cc
===================================================================
--- vm/dart_api_impl.cc (revision 4911)
+++ vm/dart_api_impl.cc (working copy)
@@ -62,22 +62,20 @@
ClassFinalizer::FinalizePendingClassesForSnapshotCreation() :
ClassFinalizer::FinalizePendingClasses();
}
- if (success && !generating_snapshot) {
+ if (success) {
success = isolate->object_store()->PreallocateObjects();
+ if (success) {
+ return NULL;
+ }
}
- 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 Error& err =
- Error::Handle(isolate->object_store()->sticky_error());
- const char* errmsg = err.ToErrorCString();
- intptr_t errlen = strlen(errmsg) + 1;
- char* msg = reinterpret_cast<char*>(Api::Allocate(errlen));
- OS::SNPrint(msg, errlen, "%s", errmsg);
- return msg;
- }
+ // 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());
+ const char* errmsg = err.ToErrorCString();
+ intptr_t errlen = strlen(errmsg) + 1;
+ char* msg = reinterpret_cast<char*>(Api::Allocate(errlen));
+ OS::SNPrint(msg, errlen, "%s", errmsg);
+ return msg;
}
« no previous file with comments | « vm/code_generator.cc ('k') | vm/object_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698