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

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

Issue 187113003: Track external allocated memory for weak persistent handles. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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/heap.h » ('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 <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 class MarkingWeakVisitor : public HandleVisitor { 299 class MarkingWeakVisitor : public HandleVisitor {
300 public: 300 public:
301 MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) { 301 MarkingWeakVisitor() : HandleVisitor(Isolate::Current()) {
302 } 302 }
303 303
304 void VisitHandle(uword addr, bool is_prologue_weak) { 304 void VisitHandle(uword addr, bool is_prologue_weak) {
305 FinalizablePersistentHandle* handle = 305 FinalizablePersistentHandle* handle =
306 reinterpret_cast<FinalizablePersistentHandle*>(addr); 306 reinterpret_cast<FinalizablePersistentHandle*>(addr);
307 RawObject* raw_obj = handle->raw(); 307 RawObject* raw_obj = handle->raw();
308 if (IsUnreachable(raw_obj)) { 308 if (IsUnreachable(raw_obj)) {
309 FinalizablePersistentHandle::Finalize(isolate(), 309 handle->UpdateUnreachable(isolate(), is_prologue_weak);
310 handle,
311 is_prologue_weak);
312 } 310 }
313 } 311 }
314 312
315 private: 313 private:
316 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); 314 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor);
317 }; 315 };
318 316
319 317
320 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { 318 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
321 if (invoke_api_callbacks) { 319 if (invoke_api_callbacks) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 MarkingWeakVisitor mark_weak; 497 MarkingWeakVisitor mark_weak;
500 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); 498 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
501 mark.Finalize(); 499 mark.Finalize();
502 ProcessWeakTables(page_space); 500 ProcessWeakTables(page_space);
503 ProcessObjectIdTable(isolate); 501 ProcessObjectIdTable(isolate);
504 502
505 Epilogue(isolate, invoke_api_callbacks); 503 Epilogue(isolate, invoke_api_callbacks);
506 } 504 }
507 505
508 } // namespace dart 506 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_state.h ('k') | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698