| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 uword handler_fp = 0; | 136 uword handler_fp = 0; |
| 137 GrowableArray<uword> stack_frame_pcs; | 137 GrowableArray<uword> stack_frame_pcs; |
| 138 bool handler_exists = FindExceptionHandler(&handler_pc, | 138 bool handler_exists = FindExceptionHandler(&handler_pc, |
| 139 &handler_sp, | 139 &handler_sp, |
| 140 &handler_fp, | 140 &handler_fp, |
| 141 &stack_frame_pcs); | 141 &stack_frame_pcs); |
| 142 // TODO(5411263): At some point we can optimize by figuring out if a | 142 // TODO(5411263): At some point we can optimize by figuring out if a |
| 143 // stack trace is needed based on whether the catch code specifies a | 143 // stack trace is needed based on whether the catch code specifies a |
| 144 // stack trace object or there is a rethrow in the catch clause. | 144 // stack trace object or there is a rethrow in the catch clause. |
| 145 Stacktrace& stacktrace = Stacktrace::Handle(); | 145 Stacktrace& stacktrace = Stacktrace::Handle(); |
| 146 if (stack_frame_pcs.length() > 0) { | 146 if (!stack_frame_pcs.is_empty()) { |
| 147 if (existing_stacktrace.IsNull()) { | 147 if (existing_stacktrace.IsNull()) { |
| 148 stacktrace = Stacktrace::New(stack_frame_pcs); | 148 stacktrace = Stacktrace::New(stack_frame_pcs); |
| 149 } else { | 149 } else { |
| 150 stacktrace ^= existing_stacktrace.raw(); | 150 stacktrace ^= existing_stacktrace.raw(); |
| 151 stacktrace.Append(stack_frame_pcs); | 151 stacktrace.Append(stack_frame_pcs); |
| 152 } | 152 } |
| 153 } else { | 153 } else { |
| 154 stacktrace ^= existing_stacktrace.raw(); | 154 stacktrace ^= existing_stacktrace.raw(); |
| 155 } | 155 } |
| 156 if (FLAG_print_stacktrace_at_throw) { | 156 if (FLAG_print_stacktrace_at_throw) { |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 case kIsolateSpawn: | 417 case kIsolateSpawn: |
| 418 library = Library::IsolateLibrary(); | 418 library = Library::IsolateLibrary(); |
| 419 class_name = String::NewSymbol("IsolateSpawnException"); | 419 class_name = String::NewSymbol("IsolateSpawnException"); |
| 420 break; | 420 break; |
| 421 } | 421 } |
| 422 | 422 |
| 423 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); | 423 return DartLibraryCalls::ExceptionCreate(library, class_name, arguments); |
| 424 } | 424 } |
| 425 | 425 |
| 426 } // namespace dart | 426 } // namespace dart |
| OLD | NEW |