| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |