| OLD | NEW |
| 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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 } | 148 } |
| 149 | 149 |
| 150 | 150 |
| 151 bool IsolateMessageHandler::UnhandledExceptionCallbackHandler( | 151 bool IsolateMessageHandler::UnhandledExceptionCallbackHandler( |
| 152 const Object& message, const UnhandledException& error) { | 152 const Object& message, const UnhandledException& error) { |
| 153 const Instance& cause = Instance::Handle(isolate_, error.exception()); | 153 const Instance& cause = Instance::Handle(isolate_, error.exception()); |
| 154 const Instance& stacktrace = | 154 const Instance& stacktrace = |
| 155 Instance::Handle(isolate_, error.stacktrace()); | 155 Instance::Handle(isolate_, error.stacktrace()); |
| 156 | 156 |
| 157 // Wrap these args into an IsolateUncaughtException object. | 157 // Wrap these args into an IsolateUncaughtException object. |
| 158 GrowableArray<const Object*> exception_args(3); | 158 const Array& exception_args = Array::Handle(Array::New(3)); |
| 159 exception_args.Add(&message); | 159 exception_args.SetAt(0, message); |
| 160 exception_args.Add(&cause); | 160 exception_args.SetAt(1, cause); |
| 161 exception_args.Add(&stacktrace); | 161 exception_args.SetAt(2, stacktrace); |
| 162 const Object& exception = | 162 const Object& exception = |
| 163 Object::Handle(isolate_, | 163 Object::Handle(isolate_, |
| 164 Exceptions::Create(Exceptions::kIsolateUnhandledException, | 164 Exceptions::Create(Exceptions::kIsolateUnhandledException, |
| 165 exception_args)); | 165 exception_args)); |
| 166 if (exception.IsError()) { | 166 if (exception.IsError()) { |
| 167 return false; | 167 return false; |
| 168 } | 168 } |
| 169 ASSERT(exception.IsInstance()); | 169 ASSERT(exception.IsInstance()); |
| 170 | 170 |
| 171 // Invoke script's callback function. | 171 // Invoke script's callback function. |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 | 601 |
| 602 | 602 |
| 603 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, | 603 void Isolate::VisitWeakPersistentHandles(HandleVisitor* visitor, |
| 604 bool visit_prologue_weak_handles) { | 604 bool visit_prologue_weak_handles) { |
| 605 if (api_state() != NULL) { | 605 if (api_state() != NULL) { |
| 606 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); | 606 api_state()->VisitWeakHandles(visitor, visit_prologue_weak_handles); |
| 607 } | 607 } |
| 608 } | 608 } |
| 609 | 609 |
| 610 } // namespace dart | 610 } // namespace dart |
| OLD | NEW |