| 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/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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 } | 163 } |
| 164 return (LookupDartCode() != Code::null()); | 164 return (LookupDartCode() != Code::null()); |
| 165 } | 165 } |
| 166 | 166 |
| 167 | 167 |
| 168 StackFrameIterator::StackFrameIterator(bool validate) | 168 StackFrameIterator::StackFrameIterator(bool validate) |
| 169 : validate_(validate), entry_(), exit_(), current_frame_(NULL) { | 169 : validate_(validate), entry_(), exit_(), current_frame_(NULL) { |
| 170 SetupLastExitFrameData(); // Setup data for last exit frame. | 170 SetupLastExitFrameData(); // Setup data for last exit frame. |
| 171 } | 171 } |
| 172 | 172 |
| 173 StackFrameIterator::StackFrameIterator(uword last_fp, bool validate) |
| 174 : validate_(validate), entry_(), exit_(), current_frame_(NULL) { |
| 175 frames_.fp_ = last_fp; |
| 176 } |
| 177 |
| 173 | 178 |
| 174 StackFrame* StackFrameIterator::NextFrame() { | 179 StackFrame* StackFrameIterator::NextFrame() { |
| 175 // When we are at the start of iteration after having created an | 180 // When we are at the start of iteration after having created an |
| 176 // iterator object current_frame_ will be NULL as we haven't seen | 181 // iterator object current_frame_ will be NULL as we haven't seen |
| 177 // any frames yet. At this point if NextFrame is called it tries | 182 // any frames yet. At this point if NextFrame is called it tries |
| 178 // to set up the next exit frame by reading the top_exit_frame_info | 183 // to set up the next exit frame by reading the top_exit_frame_info |
| 179 // from the isolate. If we do not have any dart invocations yet | 184 // from the isolate. If we do not have any dart invocations yet |
| 180 // top_exit_frame_info will be 0 and so we would return NULL. | 185 // top_exit_frame_info will be 0 and so we would return NULL. |
| 181 | 186 |
| 182 // current_frame_ will also be NULL, when we are at the end of having | 187 // current_frame_ will also be NULL, when we are at the end of having |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 EntryFrame* StackFrameIterator::NextEntryFrame() { | 243 EntryFrame* StackFrameIterator::NextEntryFrame() { |
| 239 ASSERT(!frames_.HasNext()); | 244 ASSERT(!frames_.HasNext()); |
| 240 entry_.sp_ = frames_.sp_; | 245 entry_.sp_ = frames_.sp_; |
| 241 entry_.fp_ = frames_.fp_; | 246 entry_.fp_ = frames_.fp_; |
| 242 SetupNextExitFrameData(); // Setup data for next exit frame in chain. | 247 SetupNextExitFrameData(); // Setup data for next exit frame in chain. |
| 243 ASSERT(entry_.IsValid()); | 248 ASSERT(entry_.IsValid()); |
| 244 return &entry_; | 249 return &entry_; |
| 245 } | 250 } |
| 246 | 251 |
| 247 } // namespace dart | 252 } // namespace dart |
| OLD | NEW |