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

Unified Diff: runtime/vm/gc_marker.cc

Issue 51653006: Track live instance and allocation counts for classes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/class_table.cc ('k') | runtime/vm/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.cc
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index 4a9eabd58c62eb5d4ecc93c6267ca41754b2982b..13ab9acb27e958f1ba3e2eefacd70f1342d1e985 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -128,6 +128,7 @@ class MarkingVisitor : public ObjectPointerVisitor {
: ObjectPointerVisitor(isolate),
heap_(heap),
vm_heap_(Dart::vm_isolate()->heap()),
+ class_table_(isolate->class_table()),
page_space_(page_space),
marking_stack_(marking_stack),
visiting_old_object_(NULL),
@@ -226,6 +227,11 @@ class MarkingVisitor : public ObjectPointerVisitor {
}
return;
}
+ if (RawObject::IsVariableSizeClassId(raw_obj->GetClassId())) {
+ class_table_->UpdateLiveOld(raw_obj->GetClassId(), raw_obj->Size());
+ } else {
+ class_table_->UpdateLiveOld(raw_obj->GetClassId(), 0);
+ }
MarkAndPush(raw_obj);
}
@@ -257,6 +263,7 @@ class MarkingVisitor : public ObjectPointerVisitor {
Heap* heap_;
Heap* vm_heap_;
+ ClassTable* class_table_;
PageSpace* page_space_;
MarkingStack* marking_stack_;
RawObject* visiting_old_object_;
« no previous file with comments | « runtime/vm/class_table.cc ('k') | runtime/vm/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698