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

Side by Side Diff: runtime/vm/class_table.h

Issue 249843003: Fix accumulated size stats for fixed-size instances. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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/class_table.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_CLASS_TABLE_H_ 5 #ifndef VM_CLASS_TABLE_H_
6 #define VM_CLASS_TABLE_H_ 6 #define VM_CLASS_TABLE_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 old_count++; 45 old_count++;
46 old_size += size; 46 old_size += size;
47 } 47 }
48 48
49 void Reset() { 49 void Reset() {
50 new_count = 0; 50 new_count = 0;
51 new_size = 0; 51 new_size = 0;
52 old_count = 0; 52 old_count = 0;
53 old_size = 0; 53 old_size = 0;
54 } 54 }
55
56 // For classes with fixed instance size we do not emit code to update
57 // the size statistics. Update them by calling this method.
58 void UpdateSize(intptr_t instance_size) {
59 ASSERT(instance_size > 0);
60 old_size = old_count * instance_size;
61 new_size = new_count * instance_size;
62 }
55 }; 63 };
56 64
57 class ClassHeapStats { 65 class ClassHeapStats {
58 public: 66 public:
59 // Snapshot before GC. 67 // Snapshot before GC.
60 AllocStats<intptr_t> pre_gc; 68 AllocStats<intptr_t> pre_gc;
61 // Live after GC. 69 // Live after GC.
62 AllocStats<intptr_t> post_gc; 70 AllocStats<intptr_t> post_gc;
63 // Allocations since the last GC. 71 // Allocations since the last GC.
64 AllocStats<intptr_t> recent; 72 AllocStats<intptr_t> recent;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 ClassHeapStats* StatsAt(intptr_t cid); 181 ClassHeapStats* StatsAt(intptr_t cid);
174 void UpdateLiveOld(intptr_t cid, intptr_t size); 182 void UpdateLiveOld(intptr_t cid, intptr_t size);
175 void UpdateLiveNew(intptr_t cid, intptr_t size); 183 void UpdateLiveNew(intptr_t cid, intptr_t size);
176 184
177 DISALLOW_COPY_AND_ASSIGN(ClassTable); 185 DISALLOW_COPY_AND_ASSIGN(ClassTable);
178 }; 186 };
179 187
180 } // namespace dart 188 } // namespace dart
181 189
182 #endif // VM_CLASS_TABLE_H_ 190 #endif // VM_CLASS_TABLE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/class_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698