| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/exceptions.h" | 5 #include "vm/exceptions.h" |
| 6 | 6 |
| 7 #include "platform/address_sanitizer.h" | 7 #include "platform/address_sanitizer.h" |
| 8 | 8 |
| 9 #include "lib/stacktrace.h" | 9 #include "lib/stacktrace.h" |
| 10 | 10 |
| (...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 756 |
| 757 // Throw TypeError or CastError instance. | 757 // Throw TypeError or CastError instance. |
| 758 Exceptions::ThrowByType(exception_type, args); | 758 Exceptions::ThrowByType(exception_type, args); |
| 759 UNREACHABLE(); | 759 UNREACHABLE(); |
| 760 } | 760 } |
| 761 | 761 |
| 762 void Exceptions::Throw(Thread* thread, const Instance& exception) { | 762 void Exceptions::Throw(Thread* thread, const Instance& exception) { |
| 763 // Do not notify debugger on stack overflow and out of memory exceptions. | 763 // Do not notify debugger on stack overflow and out of memory exceptions. |
| 764 // The VM would crash when the debugger calls back into the VM to | 764 // The VM would crash when the debugger calls back into the VM to |
| 765 // get values of variables. | 765 // get values of variables. |
| 766 #if !defined(PRODUCT) |
| 766 if (FLAG_support_debugger) { | 767 if (FLAG_support_debugger) { |
| 767 Isolate* isolate = thread->isolate(); | 768 Isolate* isolate = thread->isolate(); |
| 768 if (exception.raw() != isolate->object_store()->out_of_memory() && | 769 if (exception.raw() != isolate->object_store()->out_of_memory() && |
| 769 exception.raw() != isolate->object_store()->stack_overflow()) { | 770 exception.raw() != isolate->object_store()->stack_overflow()) { |
| 770 isolate->debugger()->PauseException(exception); | 771 isolate->debugger()->PauseException(exception); |
| 771 } | 772 } |
| 772 } | 773 } |
| 774 #endif |
| 773 // Null object is a valid exception object. | 775 // Null object is a valid exception object. |
| 774 ThrowExceptionHelper(thread, exception, StackTrace::Handle(thread->zone()), | 776 ThrowExceptionHelper(thread, exception, StackTrace::Handle(thread->zone()), |
| 775 false); | 777 false); |
| 776 } | 778 } |
| 777 | 779 |
| 778 void Exceptions::ReThrow(Thread* thread, | 780 void Exceptions::ReThrow(Thread* thread, |
| 779 const Instance& exception, | 781 const Instance& exception, |
| 780 const Instance& stacktrace) { | 782 const Instance& stacktrace) { |
| 781 // Null object is a valid exception object. | 783 // Null object is a valid exception object. |
| 782 ThrowExceptionHelper(thread, exception, stacktrace, true); | 784 ThrowExceptionHelper(thread, exception, stacktrace, true); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 break; | 954 break; |
| 953 } | 955 } |
| 954 | 956 |
| 955 Thread* thread = Thread::Current(); | 957 Thread* thread = Thread::Current(); |
| 956 NoReloadScope no_reload_scope(thread->isolate(), thread); | 958 NoReloadScope no_reload_scope(thread->isolate(), thread); |
| 957 return DartLibraryCalls::InstanceCreate(library, *class_name, | 959 return DartLibraryCalls::InstanceCreate(library, *class_name, |
| 958 *constructor_name, arguments); | 960 *constructor_name, arguments); |
| 959 } | 961 } |
| 960 | 962 |
| 961 } // namespace dart | 963 } // namespace dart |
| OLD | NEW |