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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 | 196 |
197 static void JumpToExceptionHandler(Isolate* isolate, | 197 static void JumpToExceptionHandler(Isolate* isolate, |
198 uword program_counter, | 198 uword program_counter, |
199 uword stack_pointer, | 199 uword stack_pointer, |
200 uword frame_pointer, | 200 uword frame_pointer, |
201 const Object& exception_object, | 201 const Object& exception_object, |
202 const Object& stacktrace_object) { | 202 const Object& stacktrace_object) { |
203 // The no_gc StackResource is unwound through the tear down of | 203 // The no_gc StackResource is unwound through the tear down of |
204 // stack resources below. | 204 // stack resources below. |
205 NoGCScope no_gc; | 205 NoSafepointScope no_safepoint; |
206 RawObject* raw_exception = exception_object.raw(); | 206 RawObject* raw_exception = exception_object.raw(); |
207 RawObject* raw_stacktrace = stacktrace_object.raw(); | 207 RawObject* raw_stacktrace = stacktrace_object.raw(); |
208 | 208 |
209 #if defined(USING_SIMULATOR) | 209 #if defined(USING_SIMULATOR) |
210 // Unwinding of the C++ frames and destroying of their stack resources is done | 210 // Unwinding of the C++ frames and destroying of their stack resources is done |
211 // by the simulator, because the target stack_pointer is a simulated stack | 211 // by the simulator, because the target stack_pointer is a simulated stack |
212 // pointer and not the C++ stack pointer. | 212 // pointer and not the C++ stack pointer. |
213 | 213 |
214 // Continue simulating at the given pc in the given frame after setting up the | 214 // Continue simulating at the given pc in the given frame after setting up the |
215 // exception object in the kExceptionObjectReg register and the stacktrace | 215 // exception object in the kExceptionObjectReg register and the stacktrace |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 | 664 |
665 // Throw JavascriptCompatibilityError exception. | 665 // Throw JavascriptCompatibilityError exception. |
666 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { | 666 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { |
667 const Array& exc_args = Array::Handle(Array::New(1)); | 667 const Array& exc_args = Array::Handle(Array::New(1)); |
668 const String& msg_str = String::Handle(String::New(msg)); | 668 const String& msg_str = String::Handle(String::New(msg)); |
669 exc_args.SetAt(0, msg_str); | 669 exc_args.SetAt(0, msg_str); |
670 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); | 670 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); |
671 } | 671 } |
672 | 672 |
673 } // namespace dart | 673 } // namespace dart |
OLD | NEW |