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

Unified Diff: runtime/vm/class_table.cc

Issue 747463002: Fix allocation stats bug on ARM; add unit test. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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.h ('k') | runtime/vm/heap_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/class_table.cc
===================================================================
--- runtime/vm/class_table.cc (revision 41855)
+++ runtime/vm/class_table.cc (working copy)
@@ -212,6 +212,7 @@
void ClassHeapStats::ResetAtNewGC() {
+ Verify();
pre_gc.new_count = post_gc.new_count + recent.new_count;
pre_gc.new_size = post_gc.new_size + recent.new_size;
// Accumulate allocations.
@@ -226,6 +227,7 @@
void ClassHeapStats::ResetAtOldGC() {
+ Verify();
pre_gc.old_count = post_gc.old_count + recent.old_count;
pre_gc.old_size = post_gc.old_size + recent.old_size;
// Accumulate allocations.
@@ -237,6 +239,15 @@
}
+void ClassHeapStats::Verify() {
+ pre_gc.Verify();
+ post_gc.Verify();
+ recent.Verify();
+ accumulated.Verify();
+ last_reset.Verify();
+}
+
+
void ClassHeapStats::UpdateSize(intptr_t instance_size) {
pre_gc.UpdateSize(instance_size);
post_gc.UpdateSize(instance_size);
@@ -345,6 +356,7 @@
if (ShouldUpdateSizeForClassId(cid)) {
stats->UpdateSize(cls.instance_size());
}
+ stats->Verify();
return stats;
}
« no previous file with comments | « runtime/vm/class_table.h ('k') | runtime/vm/heap_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698