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

Side by Side Diff: runtime/vm/isolate.cc

Issue 11413101: Added support for isolate unhandled exceptions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated code review feedback Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/isolate.h" 5 #include "vm/isolate.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "lib/mirrors.h" 9 #include "lib/mirrors.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 if (message->IsOOB()) { 104 if (message->IsOOB()) {
105 // For now the only OOB messages are Mirrors messages. 105 // For now the only OOB messages are Mirrors messages.
106 HandleMirrorsMessage(isolate_, message->reply_port(), msg); 106 HandleMirrorsMessage(isolate_, message->reply_port(), msg);
107 delete message; 107 delete message;
108 } else { 108 } else {
109 const Object& result = Object::Handle( 109 const Object& result = Object::Handle(
110 DartLibraryCalls::HandleMessage( 110 DartLibraryCalls::HandleMessage(
111 message->dest_port(), message->reply_port(), msg)); 111 message->dest_port(), message->reply_port(), msg));
112 delete message; 112 delete message;
113 if (result.IsError()) { 113 if (result.IsError() || result.IsUnhandledException()) {
114 isolate_->object_store()->set_sticky_error(Error::Cast(result)); 114 if (result.IsError()) {
115 isolate_->object_store()->set_sticky_error(Error::Cast(result));
116 }
117 if (Isolate::UnhandledExceptionCallback() != NULL) {
118 Dart_EnterScope();
119 Dart_Handle error = Api::NewHandle(isolate_, result.raw());
120 (Isolate::UnhandledExceptionCallback())(error);
121 Dart_ExitScope();
122 }
115 return false; 123 return false;
116 } 124 }
117 ASSERT(result.IsNull()); 125 ASSERT(result.IsNull());
118 } 126 }
119 return true; 127 return true;
120 } 128 }
121 129
122 130
123 #if defined(DEBUG) 131 #if defined(DEBUG)
124 void IsolateMessageHandler::CheckAccess() { 132 void IsolateMessageHandler::CheckAccess() {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 "\tisolate: %s\n", name()); 447 "\tisolate: %s\n", name());
440 } 448 }
441 // TODO(5411455): For now just make sure there are no current isolates 449 // TODO(5411455): For now just make sure there are no current isolates
442 // as we are shutting down the isolate. 450 // as we are shutting down the isolate.
443 SetCurrent(NULL); 451 SetCurrent(NULL);
444 } 452 }
445 453
446 454
447 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL; 455 Dart_IsolateCreateCallback Isolate::create_callback_ = NULL;
448 Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL; 456 Dart_IsolateInterruptCallback Isolate::interrupt_callback_ = NULL;
457 Dart_IsolateUnhandledExceptionCallback
458 Isolate::unhandled_exception_callback_ = NULL;
449 Dart_IsolateShutdownCallback Isolate::shutdown_callback_ = NULL; 459 Dart_IsolateShutdownCallback Isolate::shutdown_callback_ = NULL;
450 460
451 461
452 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor, 462 void Isolate::VisitObjectPointers(ObjectPointerVisitor* visitor,
453 bool visit_prologue_weak_handles, 463 bool visit_prologue_weak_handles,
454 bool validate_frames) { 464 bool validate_frames) {
455 ASSERT(visitor != NULL); 465 ASSERT(visitor != NULL);
456 466
457 // Visit objects in the object store. 467 // Visit objects in the object store.
458 object_store()->VisitObjectPointers(visitor); 468 object_store()->VisitObjectPointers(visitor);
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 501
492 502
493 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, 503 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor,
494 bool visit_prologue_weak_handles) { 504 bool visit_prologue_weak_handles) {
495 if (api_state() != NULL) { 505 if (api_state() != NULL) {
496 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); 506 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles);
497 } 507 }
498 } 508 }
499 509
500 } // namespace dart 510 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698