| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/stack_frame.h" | 5 #include "vm/stack_frame.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/deopt_instructions.h" | 8 #include "vm/deopt_instructions.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 | 156 |
| 157 bool StackFrame::FindExceptionHandler(uword* handler_pc, | 157 bool StackFrame::FindExceptionHandler(uword* handler_pc, |
| 158 bool* needs_stacktrace, | 158 bool* needs_stacktrace, |
| 159 bool* is_catch_all) const { | 159 bool* is_catch_all) const { |
| 160 const Code& code = Code::Handle(LookupDartCode()); | 160 const Code& code = Code::Handle(LookupDartCode()); |
| 161 if (code.IsNull()) { | 161 if (code.IsNull()) { |
| 162 return false; // Stub frames do not have exception handlers. | 162 return false; // Stub frames do not have exception handlers. |
| 163 } | 163 } |
| 164 | 164 |
| 165 ExceptionHandlers& handlers = | |
| 166 ExceptionHandlers::Handle(code.exception_handlers()); | |
| 167 if (handlers.Length() == 0) { | |
| 168 return false; | |
| 169 } | |
| 170 // Find pc descriptor for the current pc. | 165 // Find pc descriptor for the current pc. |
| 171 const PcDescriptors& descriptors = | 166 const PcDescriptors& descriptors = |
| 172 PcDescriptors::Handle(code.pc_descriptors()); | 167 PcDescriptors::Handle(code.pc_descriptors()); |
| 168 ExceptionHandlers& handlers = ExceptionHandlers::Handle(); |
| 173 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 169 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 174 if ((static_cast<uword>(descriptors.PC(i)) == pc()) && | 170 if ((static_cast<uword>(descriptors.PC(i)) == pc()) && |
| 175 (descriptors.TryIndex(i) != -1)) { | 171 (descriptors.TryIndex(i) != -1)) { |
| 176 const intptr_t try_index = descriptors.TryIndex(i); | 172 const intptr_t try_index = descriptors.TryIndex(i); |
| 177 handlers = code.exception_handlers(); | 173 handlers = code.exception_handlers(); |
| 178 *handler_pc = handlers.HandlerPC(try_index); | 174 *handler_pc = handlers.HandlerPC(try_index); |
| 179 *needs_stacktrace = handlers.NeedsStacktrace(try_index); | 175 *needs_stacktrace = handlers.NeedsStacktrace(try_index); |
| 180 *is_catch_all = handlers.HasCatchAll(try_index); | 176 *is_catch_all = handlers.HasCatchAll(try_index); |
| 181 return true; | 177 return true; |
| 182 } | 178 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); | 385 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); |
| 390 code_ = func.unoptimized_code(); | 386 code_ = func.unoptimized_code(); |
| 391 function_ = func.raw(); | 387 function_ = func.raw(); |
| 392 return; | 388 return; |
| 393 } | 389 } |
| 394 } | 390 } |
| 395 SetDone(); | 391 SetDone(); |
| 396 } | 392 } |
| 397 | 393 |
| 398 } // namespace dart | 394 } // namespace dart |
| OLD | NEW |