| OLD | NEW |
| 1 // Copyright (c) 2011, 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" |
| 11 #include "vm/os.h" | 11 #include "vm/os.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 Code code; | 55 Code code; |
| 56 code = LookupDartCode(); | 56 code = LookupDartCode(); |
| 57 if (!code.IsNull()) { | 57 if (!code.IsNull()) { |
| 58 Array maps; | 58 Array maps; |
| 59 maps = Array::null(); | 59 maps = Array::null(); |
| 60 Stackmap map; | 60 Stackmap map; |
| 61 map = code.GetStackmap(pc(), &maps, &map); | 61 map = code.GetStackmap(pc(), &maps, &map); |
| 62 if (!map.IsNull()) { | 62 if (!map.IsNull()) { |
| 63 // A stack map is present in the code object, use the stack map to visit | 63 // A stack map is present in the code object, use the stack map to visit |
| 64 // frame slots which are marked as having objects. | 64 // frame slots which are marked as having objects. |
| 65 intptr_t bit_offset = map.MinimumBitOffset(); | 65 intptr_t bit_index = map.MinimumBitIndex(); |
| 66 intptr_t end_bit_offset = map.MaximumBitOffset(); | 66 ASSERT(bit_index != Stackmap::kNoMinimum); |
| 67 while (bit_offset <= end_bit_offset) { | 67 intptr_t end_bit_index = map.MaximumBitIndex(); |
| 68 uword addr = (fp() - ((bit_offset + 1) * kWordSize)); | 68 ASSERT(end_bit_index != Stackmap::kNoMaximum); |
| 69 uword base_addr = |
| 70 fp() + (ParsedFunction::kFirstLocalSlotIndex * kWordSize); |
| 71 while (bit_index <= end_bit_index) { |
| 72 uword addr = base_addr - (bit_index * kWordSize); |
| 69 ASSERT(addr >= sp()); | 73 ASSERT(addr >= sp()); |
| 70 if (map.IsObject(bit_offset)) { | 74 if (map.IsObject(bit_index)) { |
| 71 visitor->VisitPointer(reinterpret_cast<RawObject**>(addr)); | 75 visitor->VisitPointer(reinterpret_cast<RawObject**>(addr)); |
| 72 } | 76 } |
| 73 bit_offset += 1; | 77 ++bit_index; |
| 74 } | 78 } |
| 75 return; | 79 return; |
| 76 } | 80 } |
| 77 } | 81 } |
| 78 // No stack maps are present in the code object which means this | 82 // No stack maps are present in the code object which means this |
| 79 // frame relies on tagged pointers and hence we visit each entry | 83 // frame relies on tagged pointers and hence we visit each entry |
| 80 // on the frame between SP and FP. | 84 // on the frame between SP and FP. |
| 81 ASSERT(visitor != NULL); | 85 ASSERT(visitor != NULL); |
| 82 RawObject** start = reinterpret_cast<RawObject**>(sp()); | 86 RawObject** start = reinterpret_cast<RawObject**>(sp()); |
| 83 RawObject** end = reinterpret_cast<RawObject**>( | 87 RawObject** end = reinterpret_cast<RawObject**>( |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 EntryFrame* StackFrameIterator::NextEntryFrame() { | 247 EntryFrame* StackFrameIterator::NextEntryFrame() { |
| 244 ASSERT(!frames_.HasNext()); | 248 ASSERT(!frames_.HasNext()); |
| 245 entry_.sp_ = frames_.sp_; | 249 entry_.sp_ = frames_.sp_; |
| 246 entry_.fp_ = frames_.fp_; | 250 entry_.fp_ = frames_.fp_; |
| 247 SetupNextExitFrameData(); // Setup data for next exit frame in chain. | 251 SetupNextExitFrameData(); // Setup data for next exit frame in chain. |
| 248 ASSERT(entry_.IsValid()); | 252 ASSERT(entry_.IsValid()); |
| 249 return &entry_; | 253 return &entry_; |
| 250 } | 254 } |
| 251 | 255 |
| 252 } // namespace dart | 256 } // namespace dart |
| OLD | NEW |