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

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

Issue 10232003: - Improve marking performance by pre-marking RawInstructions objects, (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/gc_marker.h" 5 #include "vm/gc_marker.h"
6 6
7 #include "vm/allocation.h" 7 #include "vm/allocation.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/pages.h" 10 #include "vm/pages.h"
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 // TODO(iposva): Add consistency check. 163 // TODO(iposva): Add consistency check.
164 return; 164 return;
165 } 165 }
166 166
167 uword raw_addr = RawObject::ToAddr(raw_obj); 167 uword raw_addr = RawObject::ToAddr(raw_obj);
168 // TODO(iposva): Premark vm_isolate objects, to avoid this extra check here. 168 // TODO(iposva): Premark vm_isolate objects, to avoid this extra check here.
169 if (vm_heap_->Contains(raw_addr)) { 169 if (vm_heap_->Contains(raw_addr)) {
170 return; 170 return;
171 } 171 }
172 // TODO(iposva): merge old and code spaces. 172 // TODO(iposva): merge old and code spaces.
173 ASSERT(heap_->Contains(raw_addr)); 173 ASSERT(page_space_->Contains(raw_addr));
174 if (!page_space_->Contains(raw_addr)) {
175 // TODO(iposva): Skip code space if marking data space and vice-versa.
176 return;
177 }
178
179 MarkAndPush(raw_obj); 174 MarkAndPush(raw_obj);
180 } 175 }
181 176
182 Heap* heap_; 177 Heap* heap_;
183 Heap* vm_heap_; 178 Heap* vm_heap_;
184 PageSpace* page_space_; 179 PageSpace* page_space_;
185 MarkingStack* marking_stack_; 180 MarkingStack* marking_stack_;
186 181
187 DISALLOW_IMPLICIT_CONSTRUCTORS(MarkingVisitor); 182 DISALLOW_IMPLICIT_CONSTRUCTORS(MarkingVisitor);
188 }; 183 };
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 MarkingVisitor mark(heap_, page_space, &marking_stack); 317 MarkingVisitor mark(heap_, page_space, &marking_stack);
323 IterateRoots(isolate, &mark, !invoke_api_callbacks); 318 IterateRoots(isolate, &mark, !invoke_api_callbacks);
324 DrainMarkingStack(isolate, &mark); 319 DrainMarkingStack(isolate, &mark);
325 IterateWeakReferences(isolate, &mark); 320 IterateWeakReferences(isolate, &mark);
326 MarkingWeakVisitor mark_weak; 321 MarkingWeakVisitor mark_weak;
327 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); 322 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
328 Epilogue(isolate, invoke_api_callbacks); 323 Epilogue(isolate, invoke_api_callbacks);
329 } 324 }
330 325
331 } // namespace dart 326 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698