| 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_entry.h" | 7 #include "vm/dart_entry.h" |
| 8 #include "vm/debugger.h" | 8 #include "vm/debugger.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 GrowableArray<const Object*> arguments; | 146 GrowableArray<const Object*> arguments; |
| 147 exception ^= Exceptions::Create(Exceptions::kNullThrown, arguments); | 147 exception ^= Exceptions::Create(Exceptions::kNullPointer, arguments); |
| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 class_name = Symbols::New("StackOverflowError"); | 420 class_name = Symbols::New("StackOverflowError"); |
| 421 break; | 421 break; |
| 422 case kOutOfMemory: | 422 case kOutOfMemory: |
| 423 library = Library::CoreLibrary(); | 423 library = Library::CoreLibrary(); |
| 424 class_name = Symbols::New("OutOfMemoryError"); | 424 class_name = Symbols::New("OutOfMemoryError"); |
| 425 break; | 425 break; |
| 426 case kInternalError: | 426 case kInternalError: |
| 427 library = Library::CoreLibrary(); | 427 library = Library::CoreLibrary(); |
| 428 class_name = Symbols::New("InternalError"); | 428 class_name = Symbols::New("InternalError"); |
| 429 break; | 429 break; |
| 430 case kNullThrown: | 430 case kNullPointer: |
| 431 library = Library::CoreLibrary(); | 431 library = Library::CoreLibrary(); |
| 432 class_name = Symbols::New("NullThrownError"); | 432 class_name = Symbols::New("NullPointerException"); |
| 433 break; | 433 break; |
| 434 case kIllegalJSRegExp: | 434 case kIllegalJSRegExp: |
| 435 library = Library::CoreLibrary(); | 435 library = Library::CoreLibrary(); |
| 436 class_name = Symbols::New("IllegalJSRegExpException"); | 436 class_name = Symbols::New("IllegalJSRegExpException"); |
| 437 break; | 437 break; |
| 438 case kArgumentError: |
| 439 library = Library::CoreLibrary(); |
| 440 class_name = Symbols::New("ArgumentError"); |
| 441 break; |
| 438 case kIsolateSpawn: | 442 case kIsolateSpawn: |
| 439 library = Library::IsolateLibrary(); | 443 library = Library::IsolateLibrary(); |
| 440 class_name = Symbols::New("IsolateSpawnException"); | 444 class_name = Symbols::New("IsolateSpawnException"); |
| 441 break; | 445 break; |
| 442 } | 446 } |
| 443 | 447 |
| 444 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); | 448 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); |
| 445 } | 449 } |
| 446 | 450 |
| 447 } // namespace dart | 451 } // namespace dart |
| OLD | NEW |