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

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

Issue 9398014: Ignore deleted handles when processing weak roots. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: final revision Created 8 years, 10 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 | « runtime/vm/dart_api_state.h ('k') | runtime/vm/scavenger.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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 class MarkingWeakVisitor : public HandleVisitor { 191 class MarkingWeakVisitor : public HandleVisitor {
192 public: 192 public:
193 MarkingWeakVisitor() { 193 MarkingWeakVisitor() {
194 } 194 }
195 195
196 void VisitHandle(uword addr) { 196 void VisitHandle(uword addr) {
197 WeakPersistentHandle* handle = 197 WeakPersistentHandle* handle =
198 reinterpret_cast<WeakPersistentHandle*>(addr); 198 reinterpret_cast<WeakPersistentHandle*>(addr);
199 RawObject* raw_obj = handle->raw(); 199 RawObject* raw_obj = handle->raw();
200 ASSERT(raw_obj->IsHeapObject()); 200 if (!raw_obj->IsHeapObject()) return;
201 if (!raw_obj->IsMarked() && raw_obj->IsOldObject()) { 201 if (!raw_obj->IsMarked() && raw_obj->IsOldObject()) {
202 WeakPersistentHandle::Finalize(handle); 202 WeakPersistentHandle::Finalize(handle);
203 } 203 }
204 } 204 }
205 205
206 private: 206 private:
207 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); 207 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor);
208 }; 208 };
209 209
210 210
(...skipping 28 matching lines...) Expand all
239 MarkingStack marking_stack; 239 MarkingStack marking_stack;
240 Prologue(isolate); 240 Prologue(isolate);
241 MarkingVisitor mark(heap_, page_space, &marking_stack); 241 MarkingVisitor mark(heap_, page_space, &marking_stack);
242 IterateRoots(isolate, &mark); 242 IterateRoots(isolate, &mark);
243 DrainMarkingStack(isolate, &mark); 243 DrainMarkingStack(isolate, &mark);
244 MarkingWeakVisitor mark_weak; 244 MarkingWeakVisitor mark_weak;
245 IterateWeakRoots(isolate, &mark_weak); 245 IterateWeakRoots(isolate, &mark_weak);
246 } 246 }
247 247
248 } // namespace dart 248 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698