| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 | 274 |
| 275 // Continue simulating at the given pc in the given frame after setting up the | 275 // Continue simulating at the given pc in the given frame after setting up the |
| 276 // exception object in the kExceptionObjectReg register and the stacktrace | 276 // exception object in the kExceptionObjectReg register and the stacktrace |
| 277 // object (may be raw null) in the kStackTraceObjectReg register. | 277 // object (may be raw null) in the kStackTraceObjectReg register. |
| 278 | 278 |
| 279 Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer, | 279 Simulator::Current()->Longjmp(program_counter, stack_pointer, frame_pointer, |
| 280 raw_exception, raw_stacktrace, isolate); | 280 raw_exception, raw_stacktrace, isolate); |
| 281 #else | 281 #else |
| 282 // Prepare for unwinding frames by destroying all the stack resources | 282 // Prepare for unwinding frames by destroying all the stack resources |
| 283 // in the previous frames. | 283 // in the previous frames. |
| 284 | 284 StackResource::Unwind(isolate, stack_pointer); |
| 285 while (isolate->top_resource() != NULL && | |
| 286 (reinterpret_cast<uword>(isolate->top_resource()) < stack_pointer)) { | |
| 287 isolate->top_resource()->~StackResource(); | |
| 288 } | |
| 289 | 285 |
| 290 // Call a stub to set up the exception object in kExceptionObjectReg, | 286 // Call a stub to set up the exception object in kExceptionObjectReg, |
| 291 // to set up the stacktrace object in kStackTraceObjectReg, and to | 287 // to set up the stacktrace object in kStackTraceObjectReg, and to |
| 292 // continue execution at the given pc in the given frame. | 288 // continue execution at the given pc in the given frame. |
| 293 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*, | 289 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*, |
| 294 Isolate*); | 290 Isolate*); |
| 295 ExcpHandler func = reinterpret_cast<ExcpHandler>( | 291 ExcpHandler func = reinterpret_cast<ExcpHandler>( |
| 296 StubCode::JumpToExceptionHandlerEntryPoint()); | 292 StubCode::JumpToExceptionHandlerEntryPoint()); |
| 297 | 293 |
| 298 // Unpoison the stack before we tear it down in the generated stub code. | 294 // Unpoison the stack before we tear it down in the generated stub code. |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 | 750 |
| 755 // Throw JavascriptCompatibilityError exception. | 751 // Throw JavascriptCompatibilityError exception. |
| 756 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { | 752 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { |
| 757 const Array& exc_args = Array::Handle(Array::New(1)); | 753 const Array& exc_args = Array::Handle(Array::New(1)); |
| 758 const String& msg_str = String::Handle(String::New(msg)); | 754 const String& msg_str = String::Handle(String::New(msg)); |
| 759 exc_args.SetAt(0, msg_str); | 755 exc_args.SetAt(0, msg_str); |
| 760 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); | 756 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); |
| 761 } | 757 } |
| 762 | 758 |
| 763 } // namespace dart | 759 } // namespace dart |
| OLD | NEW |