| 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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 // Prepare for unwinding frames by destroying all the stack resources | 221 // Prepare for unwinding frames by destroying all the stack resources |
| 222 // in the previous frames. | 222 // in the previous frames. |
| 223 StackResource::Unwind(thread); | 223 StackResource::Unwind(thread); |
| 224 | 224 |
| 225 // Call a stub to set up the exception object in kExceptionObjectReg, | 225 // Call a stub to set up the exception object in kExceptionObjectReg, |
| 226 // to set up the stacktrace object in kStackTraceObjectReg, and to | 226 // to set up the stacktrace object in kStackTraceObjectReg, and to |
| 227 // continue execution at the given pc in the given frame. | 227 // continue execution at the given pc in the given frame. |
| 228 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*, | 228 typedef void (*ExcpHandler)(uword, uword, uword, RawObject*, RawObject*, |
| 229 Thread*); | 229 Thread*); |
| 230 ExcpHandler func = reinterpret_cast<ExcpHandler>( | 230 ExcpHandler func = reinterpret_cast<ExcpHandler>( |
| 231 StubCode::JumpToExceptionHandlerEntryPoint()); | 231 StubCode::JumpToExceptionHandler_entry()->EntryPoint()); |
| 232 | 232 |
| 233 // Unpoison the stack before we tear it down in the generated stub code. | 233 // Unpoison the stack before we tear it down in the generated stub code. |
| 234 uword current_sp = Isolate::GetCurrentStackPointer() - 1024; | 234 uword current_sp = Isolate::GetCurrentStackPointer() - 1024; |
| 235 ASAN_UNPOISON(reinterpret_cast<void*>(current_sp), | 235 ASAN_UNPOISON(reinterpret_cast<void*>(current_sp), |
| 236 stack_pointer - current_sp); | 236 stack_pointer - current_sp); |
| 237 | 237 |
| 238 func(program_counter, stack_pointer, frame_pointer, | 238 func(program_counter, stack_pointer, frame_pointer, |
| 239 raw_exception, raw_stacktrace, thread); | 239 raw_exception, raw_stacktrace, thread); |
| 240 #endif | 240 #endif |
| 241 UNREACHABLE(); | 241 UNREACHABLE(); |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 670 |
| 671 // Throw JavascriptCompatibilityError exception. | 671 // Throw JavascriptCompatibilityError exception. |
| 672 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { | 672 void Exceptions::ThrowJavascriptCompatibilityError(const char* msg) { |
| 673 const Array& exc_args = Array::Handle(Array::New(1)); | 673 const Array& exc_args = Array::Handle(Array::New(1)); |
| 674 const String& msg_str = String::Handle(String::New(msg)); | 674 const String& msg_str = String::Handle(String::New(msg)); |
| 675 exc_args.SetAt(0, msg_str); | 675 exc_args.SetAt(0, msg_str); |
| 676 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); | 676 Exceptions::ThrowByType(Exceptions::kJavascriptCompatibilityError, exc_args); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace dart | 679 } // namespace dart |
| OLD | NEW |