| 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/cpu.h" | 7 #include "vm/cpu.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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 } | 240 } |
| 241 // Throw TypeError instance. | 241 // Throw TypeError instance. |
| 242 Exceptions::Throw(type_error); | 242 Exceptions::Throw(type_error); |
| 243 UNREACHABLE(); | 243 UNREACHABLE(); |
| 244 } | 244 } |
| 245 | 245 |
| 246 | 246 |
| 247 void Exceptions::Throw(const Instance& exception) { | 247 void Exceptions::Throw(const Instance& exception) { |
| 248 Isolate* isolate = Isolate::Current(); | 248 Isolate* isolate = Isolate::Current(); |
| 249 if (isolate->debugger()->IsActive()) { | 249 isolate->debugger()->SignalExceptionThrown(exception); |
| 250 isolate->debugger()->SignalExceptionThrown(exception); | |
| 251 } | |
| 252 // Null object is a valid exception object. | 250 // Null object is a valid exception object. |
| 253 ThrowExceptionHelper(exception, Instance::Handle(isolate)); | 251 ThrowExceptionHelper(exception, Instance::Handle(isolate)); |
| 254 } | 252 } |
| 255 | 253 |
| 256 | 254 |
| 257 void Exceptions::ReThrow(const Instance& exception, | 255 void Exceptions::ReThrow(const Instance& exception, |
| 258 const Instance& stacktrace) { | 256 const Instance& stacktrace) { |
| 259 // Null object is a valid exception object. | 257 // Null object is a valid exception object. |
| 260 ThrowExceptionHelper(exception, stacktrace); | 258 ThrowExceptionHelper(exception, stacktrace); |
| 261 } | 259 } |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 case kIsolateSpawn: | 359 case kIsolateSpawn: |
| 362 library = Library::IsolateLibrary(); | 360 library = Library::IsolateLibrary(); |
| 363 class_name = String::NewSymbol("IsolateSpawnException"); | 361 class_name = String::NewSymbol("IsolateSpawnException"); |
| 364 break; | 362 break; |
| 365 } | 363 } |
| 366 | 364 |
| 367 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); | 365 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); |
| 368 } | 366 } |
| 369 | 367 |
| 370 } // namespace dart | 368 } // namespace dart |
| OLD | NEW |