| 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 "vm/dart_api_impl.h" | 9 #include "vm/dart_api_impl.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 } | 475 } |
| 476 | 476 |
| 477 | 477 |
| 478 void Exceptions::Throw(Thread* thread, const Instance& exception) { | 478 void Exceptions::Throw(Thread* thread, const Instance& exception) { |
| 479 // Do not notify debugger on stack overflow and out of memory exceptions. | 479 // Do not notify debugger on stack overflow and out of memory exceptions. |
| 480 // The VM would crash when the debugger calls back into the VM to | 480 // The VM would crash when the debugger calls back into the VM to |
| 481 // get values of variables. | 481 // get values of variables. |
| 482 Isolate* isolate = thread->isolate(); | 482 Isolate* isolate = thread->isolate(); |
| 483 if (exception.raw() != isolate->object_store()->out_of_memory() && | 483 if (exception.raw() != isolate->object_store()->out_of_memory() && |
| 484 exception.raw() != isolate->object_store()->stack_overflow()) { | 484 exception.raw() != isolate->object_store()->stack_overflow()) { |
| 485 ASSERT(isolate->debugger() != NULL); |
| 485 isolate->debugger()->SignalExceptionThrown(exception); | 486 isolate->debugger()->SignalExceptionThrown(exception); |
| 486 } | 487 } |
| 487 // Null object is a valid exception object. | 488 // Null object is a valid exception object. |
| 488 ThrowExceptionHelper(thread, exception, Stacktrace::Handle(isolate), false); | 489 ThrowExceptionHelper(thread, exception, Stacktrace::Handle(isolate), false); |
| 489 } | 490 } |
| 490 | 491 |
| 491 void Exceptions::ReThrow(Thread* thread, | 492 void Exceptions::ReThrow(Thread* thread, |
| 492 const Instance& exception, | 493 const Instance& exception, |
| 493 const Instance& stacktrace) { | 494 const Instance& stacktrace) { |
| 494 // Null object is a valid exception object. | 495 // Null object is a valid exception object. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 671 |
| 671 // Throw JavascriptCompatibilityError exception. | 672 // Throw JavascriptCompatibilityError exception. |
| 672 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { | 673 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { |
| 673 const Array& exc_args = Array::Handle(Array::New(1)); | 674 const Array& exc_args = Array::Handle(Array::New(1)); |
| 674 const String& msg_str = String::Handle(String::New(msg)); | 675 const String& msg_str = String::Handle(String::New(msg)); |
| 675 exc_args.SetAt(0, msg_str); | 676 exc_args.SetAt(0, msg_str); |
| 676 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); | 677 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); |
| 677 } | 678 } |
| 678 | 679 |
| 679 } // namespace dart | 680 } // namespace dart |
| OLD | NEW |