| 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_macros.h" | 7 #include "vm/assembler_macros.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 const Code& code = Code::Handle(LookupDartCode()); | 145 const Code& code = Code::Handle(LookupDartCode()); |
| 146 if (code.IsNull()) { | 146 if (code.IsNull()) { |
| 147 return false; // Stub frames do not have exception handlers. | 147 return false; // Stub frames do not have exception handlers. |
| 148 } | 148 } |
| 149 | 149 |
| 150 // First try to find pc descriptor for the current pc. | 150 // First try to find pc descriptor for the current pc. |
| 151 intptr_t try_index = -1; | 151 intptr_t try_index = -1; |
| 152 const PcDescriptors& descriptors = | 152 const PcDescriptors& descriptors = |
| 153 PcDescriptors::Handle(code.pc_descriptors()); | 153 PcDescriptors::Handle(code.pc_descriptors()); |
| 154 for (intptr_t i = 0; i < descriptors.Length(); i++) { | 154 for (intptr_t i = 0; i < descriptors.Length(); i++) { |
| 155 // TryIndex is invalid for PcDescriptors::kDeoptIndex. | |
| 156 if ((static_cast<uword>(descriptors.PC(i)) == pc()) && | 155 if ((static_cast<uword>(descriptors.PC(i)) == pc()) && |
| 157 (descriptors.DescriptorKind(i) != PcDescriptors::kDeoptIndex) && | |
| 158 (descriptors.TryIndex(i) != -1)) { | 156 (descriptors.TryIndex(i) != -1)) { |
| 159 try_index = descriptors.TryIndex(i); | 157 try_index = descriptors.TryIndex(i); |
| 160 break; | 158 break; |
| 161 } | 159 } |
| 162 } | 160 } |
| 163 if (try_index != -1) { | 161 if (try_index != -1) { |
| 164 // We found a pc descriptor, now try to see if we have an | 162 // We found a pc descriptor, now try to see if we have an |
| 165 // exception catch handler for this try index. | 163 // exception catch handler for this try index. |
| 166 const ExceptionHandlers& handlers = | 164 const ExceptionHandlers& handlers = |
| 167 ExceptionHandlers::Handle(code.exception_handlers()); | 165 ExceptionHandlers::Handle(code.exception_handlers()); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 EntryFrame* StackFrameIterator::NextEntryFrame() { | 260 EntryFrame* StackFrameIterator::NextEntryFrame() { |
| 263 ASSERT(!frames_.HasNext()); | 261 ASSERT(!frames_.HasNext()); |
| 264 entry_.sp_ = frames_.sp_; | 262 entry_.sp_ = frames_.sp_; |
| 265 entry_.fp_ = frames_.fp_; | 263 entry_.fp_ = frames_.fp_; |
| 266 SetupNextExitFrameData(); // Setup data for next exit frame in chain. | 264 SetupNextExitFrameData(); // Setup data for next exit frame in chain. |
| 267 ASSERT(entry_.IsValid()); | 265 ASSERT(entry_.IsValid()); |
| 268 return &entry_; | 266 return &entry_; |
| 269 } | 267 } |
| 270 | 268 |
| 271 } // namespace dart | 269 } // namespace dart |
| OLD | NEW |