Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: runtime/vm/stack_frame.cc

Issue 10882055: Put live register bits in stackmaps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 code = LookupDartCode(); 60 code = LookupDartCode();
61 if (!code.IsNull()) { 61 if (!code.IsNull()) {
62 Array maps; 62 Array maps;
63 maps = Array::null(); 63 maps = Array::null();
64 Stackmap map; 64 Stackmap map;
65 map = code.GetStackmap(pc(), &maps, &map); 65 map = code.GetStackmap(pc(), &maps, &map);
66 if (!map.IsNull()) { 66 if (!map.IsNull()) {
67 // A stack map is present in the code object, use the stack map to visit 67 // A stack map is present in the code object, use the stack map to visit
68 // frame slots which are marked as having objects. 68 // frame slots which are marked as having objects.
69 intptr_t length = map.Length(); 69 intptr_t length = map.Length();
70 for (intptr_t bit_index = 0; bit_index < length; ++bit_index) { 70 // Spill slots are at the 'bottom' of the frame.
Vyacheslav Egorov (Google) 2012/08/27 14:54:51 This only works for calls with no arguments. Consi
Kevin Millikin (Google) 2012/08/29 12:40:41 Done.
71 if (map.IsObject(bit_index)) { 71 intptr_t spill_slot_count = length - map.RegisterCount();
72 visitor->VisitPointer(end_addr - bit_index); 72 for (intptr_t bit = 0; bit < spill_slot_count; ++bit) {
73 } 73 if (map.IsObject(bit)) visitor->VisitPointer(end_addr);
74 --end_addr;
74 } 75 }
75 // The stack slots that are not spill slots (i.e., outgoing arguments) 76
76 // are tagged objects. 77 // The live registers at the 'top' of the frame comprise the rest of the
77 end_addr -= length; 78 // stack map.
79 for (intptr_t bit = length - 1; bit >= spill_slot_count; --bit) {
80 if (map.IsObject(bit)) visitor->VisitPointer(start_addr);
81 ++start_addr;
82 }
83
78 // The end address can be one slot (but not more) past the start 84 // The end address can be one slot (but not more) past the start
79 // address in the case that all slots were covered by the stack map. 85 // address in the case that all slots were covered by the stack map.
80 ASSERT((end_addr + 1) >= start_addr); 86 ASSERT((end_addr + 1) >= start_addr);
81 } 87 }
82 } 88 }
83 // Each slot between the start and end address are tagged objects. 89 // Each slot between the start and end address are tagged objects.
84 visitor->VisitPointers(start_addr, end_addr); 90 visitor->VisitPointers(start_addr, end_addr);
85 } 91 }
86 92
87 93
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 EntryFrame* StackFrameIterator::NextEntryFrame() { 248 EntryFrame* StackFrameIterator::NextEntryFrame() {
243 ASSERT(!frames_.HasNext()); 249 ASSERT(!frames_.HasNext());
244 entry_.sp_ = frames_.sp_; 250 entry_.sp_ = frames_.sp_;
245 entry_.fp_ = frames_.fp_; 251 entry_.fp_ = frames_.fp_;
246 SetupNextExitFrameData(); // Setup data for next exit frame in chain. 252 SetupNextExitFrameData(); // Setup data for next exit frame in chain.
247 ASSERT(entry_.IsValid()); 253 ASSERT(entry_.IsValid());
248 return &entry_; 254 return &entry_;
249 } 255 }
250 256
251 } // namespace dart 257 } // namespace dart
OLDNEW
« runtime/vm/flow_graph_compiler_x64.cc ('K') | « runtime/vm/raw_object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698