| 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 |
| 11 namespace dart { | 11 namespace dart { |
| 12 | 12 |
| 13 class Class; | 13 class Class; |
| 14 class ClassStats; | 14 class ClassStats; |
| 15 class JSONArray; | 15 class JSONArray; |
| 16 class JSONObject; |
| 16 class JSONStream; | 17 class JSONStream; |
| 17 class ObjectPointerVisitor; | 18 class ObjectPointerVisitor; |
| 18 class RawClass; | 19 class RawClass; |
| 19 | 20 |
| 20 template<typename T> | 21 template<typename T> |
| 21 class AllocStats { | 22 class AllocStats { |
| 22 public: | 23 public: |
| 23 T new_count; | 24 T new_count; |
| 24 T new_size; | 25 T new_size; |
| 25 T old_count; | 26 T old_count; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void Register(const Class& cls); | 117 void Register(const Class& cls); |
| 117 | 118 |
| 118 void RegisterAt(intptr_t index, const Class& cls); | 119 void RegisterAt(intptr_t index, const Class& cls); |
| 119 | 120 |
| 120 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 121 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 121 | 122 |
| 122 void Validate(); | 123 void Validate(); |
| 123 | 124 |
| 124 void Print(); | 125 void Print(); |
| 125 | 126 |
| 126 void PrintToJSONStream(JSONStream* stream); | 127 void PrintToJSONObject(JSONObject* object); |
| 127 | 128 |
| 128 static intptr_t table_offset() { | 129 static intptr_t table_offset() { |
| 129 return OFFSET_OF(ClassTable, table_); | 130 return OFFSET_OF(ClassTable, table_); |
| 130 } | 131 } |
| 131 | 132 |
| 132 // Called whenever a class is allocated in the runtime. | 133 // Called whenever a class is allocated in the runtime. |
| 133 void UpdateAllocatedNew(intptr_t cid, intptr_t size); | 134 void UpdateAllocatedNew(intptr_t cid, intptr_t size); |
| 134 void UpdateAllocatedOld(intptr_t cid, intptr_t size); | 135 void UpdateAllocatedOld(intptr_t cid, intptr_t size); |
| 135 | 136 |
| 136 // Called whenever a old GC occurs. | 137 // Called whenever a old GC occurs. |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 ClassHeapStats* StatsAt(intptr_t cid); | 173 ClassHeapStats* StatsAt(intptr_t cid); |
| 173 void UpdateLiveOld(intptr_t cid, intptr_t size); | 174 void UpdateLiveOld(intptr_t cid, intptr_t size); |
| 174 void UpdateLiveNew(intptr_t cid, intptr_t size); | 175 void UpdateLiveNew(intptr_t cid, intptr_t size); |
| 175 | 176 |
| 176 DISALLOW_COPY_AND_ASSIGN(ClassTable); | 177 DISALLOW_COPY_AND_ASSIGN(ClassTable); |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace dart | 180 } // namespace dart |
| 180 | 181 |
| 181 #endif // VM_CLASS_TABLE_H_ | 182 #endif // VM_CLASS_TABLE_H_ |
| OLD | NEW |