| 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 } |
| 165 // Find pc descriptor for the current pc. | 170 // Find pc descriptor for the current pc. |
| 166 const PcDescriptors& descriptors = | 171 const PcDescriptors& descriptors = |
| 167 PcDescriptors::Handle(code.pc_descriptors()); | 172 PcDescriptors::Handle(code.pc_descriptors()); |
| 168 ExceptionHandlers& handlers = ExceptionHandlers::Handle(); | |
| 169 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 173 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 170 if ((static_cast<uword>(descriptors.PC(i)) == pc()) && | 174 if ((static_cast<uword>(descriptors.PC(i)) == pc()) && |
| 171 (descriptors.TryIndex(i) != -1)) { | 175 (descriptors.TryIndex(i) != -1)) { |
| 172 const intptr_t try_index = descriptors.TryIndex(i); | 176 const intptr_t try_index = descriptors.TryIndex(i); |
| 173 handlers = code.exception_handlers(); | 177 handlers = code.exception_handlers(); |
| 174 *handler_pc = handlers.HandlerPC(try_index); | 178 *handler_pc = handlers.HandlerPC(try_index); |
| 175 *needs_stacktrace = handlers.NeedsStacktrace(try_index); | 179 *needs_stacktrace = handlers.NeedsStacktrace(try_index); |
| 176 *is_catch_all = handlers.HasCatchAll(try_index); | 180 *is_catch_all = handlers.HasCatchAll(try_index); |
| 177 return true; | 181 return true; |
| 178 } | 182 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); | 389 pc_ = DeoptInstr::GetRetAddress(deopt_instr, object_table_, &func); |
| 386 code_ = func.unoptimized_code(); | 390 code_ = func.unoptimized_code(); |
| 387 function_ = func.raw(); | 391 function_ = func.raw(); |
| 388 return; | 392 return; |
| 389 } | 393 } |
| 390 } | 394 } |
| 391 SetDone(); | 395 SetDone(); |
| 392 } | 396 } |
| 393 | 397 |
| 394 } // namespace dart | 398 } // namespace dart |
| OLD | NEW |