| 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/bitfield.h" | 9 #include "vm/bitfield.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 static intptr_t TraceAllocationMask() { | 109 static intptr_t TraceAllocationMask() { |
| 110 return (1 << kTraceAllocationBit); | 110 return (1 << kTraceAllocationBit); |
| 111 } | 111 } |
| 112 | 112 |
| 113 void Initialize(); | 113 void Initialize(); |
| 114 void ResetAtNewGC(); | 114 void ResetAtNewGC(); |
| 115 void ResetAtOldGC(); | 115 void ResetAtOldGC(); |
| 116 void ResetAccumulator(); | 116 void ResetAccumulator(); |
| 117 void UpdatePromotedAfterNewGC(); | 117 void UpdatePromotedAfterNewGC(); |
| 118 void UpdateSize(intptr_t instance_size); | 118 void UpdateSize(intptr_t instance_size); |
| 119 #ifndef PRODUCT |
| 119 void PrintToJSONObject(const Class& cls, JSONObject* obj) const; | 120 void PrintToJSONObject(const Class& cls, JSONObject* obj) const; |
| 121 #endif |
| 120 void Verify(); | 122 void Verify(); |
| 121 | 123 |
| 122 bool trace_allocation() const { | 124 bool trace_allocation() const { |
| 123 return TraceAllocationBit::decode(state_); | 125 return TraceAllocationBit::decode(state_); |
| 124 } | 126 } |
| 125 | 127 |
| 126 void set_trace_allocation(bool trace_allocation) { | 128 void set_trace_allocation(bool trace_allocation) { |
| 127 state_ = TraceAllocationBit::update(trace_allocation, state_); | 129 state_ = TraceAllocationBit::update(trace_allocation, state_); |
| 128 } | 130 } |
| 129 | 131 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 187 |
| 186 #if defined(DEBUG) | 188 #if defined(DEBUG) |
| 187 void Unregister(intptr_t index); | 189 void Unregister(intptr_t index); |
| 188 #endif | 190 #endif |
| 189 | 191 |
| 190 void VisitObjectPointers(ObjectPointerVisitor* visitor); | 192 void VisitObjectPointers(ObjectPointerVisitor* visitor); |
| 191 | 193 |
| 192 void Validate(); | 194 void Validate(); |
| 193 | 195 |
| 194 void Print(); | 196 void Print(); |
| 195 | 197 #ifndef PRODUCT |
| 196 void PrintToJSONObject(JSONObject* object); | 198 void PrintToJSONObject(JSONObject* object); |
| 199 #endif |
| 197 | 200 |
| 198 // Used by the generated code. | 201 // Used by the generated code. |
| 199 static intptr_t table_offset() { | 202 static intptr_t table_offset() { |
| 200 return OFFSET_OF(ClassTable, table_); | 203 return OFFSET_OF(ClassTable, table_); |
| 201 } | 204 } |
| 202 | 205 |
| 203 // Called whenever a class is allocated in the runtime. | 206 // Called whenever a class is allocated in the runtime. |
| 204 void UpdateAllocatedNew(intptr_t cid, intptr_t size); | 207 void UpdateAllocatedNew(intptr_t cid, intptr_t size); |
| 205 void UpdateAllocatedOld(intptr_t cid, intptr_t size); | 208 void UpdateAllocatedOld(intptr_t cid, intptr_t size); |
| 206 | 209 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 ClassHeapStats* PreliminaryStatsAt(intptr_t cid); | 265 ClassHeapStats* PreliminaryStatsAt(intptr_t cid); |
| 263 void UpdateLiveOld(intptr_t cid, intptr_t size, intptr_t count = 1); | 266 void UpdateLiveOld(intptr_t cid, intptr_t size, intptr_t count = 1); |
| 264 void UpdateLiveNew(intptr_t cid, intptr_t size); | 267 void UpdateLiveNew(intptr_t cid, intptr_t size); |
| 265 | 268 |
| 266 DISALLOW_COPY_AND_ASSIGN(ClassTable); | 269 DISALLOW_COPY_AND_ASSIGN(ClassTable); |
| 267 }; | 270 }; |
| 268 | 271 |
| 269 } // namespace dart | 272 } // namespace dart |
| 270 | 273 |
| 271 #endif // VM_CLASS_TABLE_H_ | 274 #endif // VM_CLASS_TABLE_H_ |
| OLD | NEW |