| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 // be able to reuse the handle based code and avoid having to add | 52 // be able to reuse the handle based code and avoid having to add |
| 53 // helper functions to the raw object interface. | 53 // helper functions to the raw object interface. |
| 54 ASSERT(visitor != NULL); | 54 ASSERT(visitor != NULL); |
| 55 NoGCScope no_gc; | 55 NoGCScope no_gc; |
| 56 RawObject** start_addr = reinterpret_cast<RawObject**>(sp()); | 56 RawObject** start_addr = reinterpret_cast<RawObject**>(sp()); |
| 57 RawObject** end_addr = reinterpret_cast<RawObject**>(fp()) + | 57 RawObject** end_addr = reinterpret_cast<RawObject**>(fp()) + |
| 58 ParsedFunction::kFirstLocalSlotIndex; | 58 ParsedFunction::kFirstLocalSlotIndex; |
| 59 Code code; | 59 Code code; |
| 60 code = LookupDartCode(); | 60 code = LookupDartCode(); |
| 61 if (!code.IsNull()) { | 61 if (!code.IsNull()) { |
| 62 // Visit the code object. |
| 63 RawObject* raw_code = code.raw(); |
| 64 visitor->VisitPointer(&raw_code); |
| 65 // Visit stack based on stack maps. |
| 62 Array maps; | 66 Array maps; |
| 63 maps = Array::null(); | 67 maps = Array::null(); |
| 64 Stackmap map; | 68 Stackmap map; |
| 65 map = code.GetStackmap(pc(), &maps, &map); | 69 map = code.GetStackmap(pc(), &maps, &map); |
| 66 if (!map.IsNull()) { | 70 if (!map.IsNull()) { |
| 67 // A stack map is present in the code object, use the stack map to | 71 // A stack map is present in the code object, use the stack map to |
| 68 // visit frame slots which are marked as having objects. | 72 // visit frame slots which are marked as having objects. |
| 69 // | 73 // |
| 70 // The layout of the frame is (lower addresses to the right): | 74 // The layout of the frame is (lower addresses to the right): |
| 71 // | spill slots | outgoing arguments | saved registers | | 75 // | spill slots | outgoing arguments | saved registers | |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 EntryFrame* StackFrameIterator::NextEntryFrame() { | 264 EntryFrame* StackFrameIterator::NextEntryFrame() { |
| 261 ASSERT(!frames_.HasNext()); | 265 ASSERT(!frames_.HasNext()); |
| 262 entry_.sp_ = frames_.sp_; | 266 entry_.sp_ = frames_.sp_; |
| 263 entry_.fp_ = frames_.fp_; | 267 entry_.fp_ = frames_.fp_; |
| 264 SetupNextExitFrameData(); // Setup data for next exit frame in chain. | 268 SetupNextExitFrameData(); // Setup data for next exit frame in chain. |
| 265 ASSERT(entry_.IsValid()); | 269 ASSERT(entry_.IsValid()); |
| 266 return &entry_; | 270 return &entry_; |
| 267 } | 271 } |
| 268 | 272 |
| 269 } // namespace dart | 273 } // namespace dart |
| OLD | NEW |