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

Unified Diff: vm/dart_api_impl.cc

Issue 8334031: - Fix the snapshot generation python script to return an error code when snapshot generation fail... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: '' Created 9 years, 1 month 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/dart.cc ('k') | vm/message_queue_test.cc » ('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 1223)
+++ vm/dart_api_impl.cc (working copy)
@@ -82,10 +82,28 @@
DART_EXPORT Dart_Isolate Dart_CreateIsolate(const Dart_Snapshot* snapshot,
void* data) {
- ASSERT(Isolate::Current() == NULL);
- Isolate* isolate = Dart::CreateIsolate(snapshot, data);
- START_TIMER(time_total_runtime);
- return reinterpret_cast<Dart_Isolate>(isolate);
+ Isolate* isolate = Dart::CreateIsolate();
+ ASSERT(isolate != NULL);
+ LongJump* base = isolate->long_jump_base();
+ LongJump jump;
+ isolate->set_long_jump_base(&jump);
+ if (setjmp(*jump.Set()) == 0) {
+ Dart::InitializeIsolate(snapshot, data);
+ START_TIMER(time_total_runtime);
+ isolate->set_long_jump_base(base);
+ return reinterpret_cast<Dart_Isolate>(isolate);
+ } else {
+ {
+ Zone zone; // Setup a VM zone as we are creating some handles.
+ HandleScope scope; // Setup a VM handle scope.
+ const String& error =
+ String::Handle(Isolate::Current()->object_store()->sticky_error());
+ // TODO(asiva): Need to return this as a error.
+ OS::PrintErr(error.ToCString());
+ }
+ Dart::ShutdownIsolate();
+ }
+ return reinterpret_cast<Dart_Isolate>(NULL);
}
« no previous file with comments | « vm/dart.cc ('k') | vm/message_queue_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698