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 "vm/dart_api_impl.h" | 7 #include "vm/dart_api_impl.h" |
8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
10 #include "vm/flags.h" | 10 #include "vm/flags.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 StubCode::JumpToErrorHandlerEntryPoint()); | 136 StubCode::JumpToErrorHandlerEntryPoint()); |
137 func(program_counter, stack_pointer, frame_pointer, raw_error); | 137 func(program_counter, stack_pointer, frame_pointer, raw_error); |
138 UNREACHABLE(); | 138 UNREACHABLE(); |
139 } | 139 } |
140 | 140 |
141 | 141 |
142 static void ThrowExceptionHelper(const Instance& incoming_exception, | 142 static void ThrowExceptionHelper(const Instance& incoming_exception, |
143 const Instance& existing_stacktrace) { | 143 const Instance& existing_stacktrace) { |
144 Instance& exception = Instance::Handle(incoming_exception.raw()); | 144 Instance& exception = Instance::Handle(incoming_exception.raw()); |
145 if (exception.IsNull()) { | 145 if (exception.IsNull()) { |
146 const Array& arguments = Array::Handle(Object::empty_array()); | 146 exception ^= Exceptions::Create(Exceptions::kNullThrown, |
147 exception ^= Exceptions::Create(Exceptions::kNullThrown, arguments); | 147 Object::empty_array()); |
148 } | 148 } |
149 uword handler_pc = 0; | 149 uword handler_pc = 0; |
150 uword handler_sp = 0; | 150 uword handler_sp = 0; |
151 uword handler_fp = 0; | 151 uword handler_fp = 0; |
152 const GrowableObjectArray& func_list = | 152 const GrowableObjectArray& func_list = |
153 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 153 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
154 const GrowableObjectArray& code_list = | 154 const GrowableObjectArray& code_list = |
155 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 155 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
156 const GrowableObjectArray& pc_offset_list = | 156 const GrowableObjectArray& pc_offset_list = |
157 GrowableObjectArray::Handle(GrowableObjectArray::New()); | 157 GrowableObjectArray::Handle(GrowableObjectArray::New()); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 case kIsolateUnhandledException: | 441 case kIsolateUnhandledException: |
442 library = Library::IsolateLibrary(); | 442 library = Library::IsolateLibrary(); |
443 class_name = Symbols::New("IsolateUnhandledException"); | 443 class_name = Symbols::New("IsolateUnhandledException"); |
444 break; | 444 break; |
445 } | 445 } |
446 | 446 |
447 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); | 447 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); |
448 } | 448 } |
449 | 449 |
450 } // namespace dart | 450 } // namespace dart |
OLD | NEW |