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

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

Issue 1241863002: VM: Refactor allocation stats code and remove duplicate code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: addressed comments Created 5 years, 5 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
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | 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/bitfield.h" 9 #include "vm/bitfield.h"
10 #include "vm/globals.h" 10 #include "vm/globals.h"
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void UpdateAllocatedOld(intptr_t cid, intptr_t size); 188 void UpdateAllocatedOld(intptr_t cid, intptr_t size);
189 189
190 // Called whenever a old GC occurs. 190 // Called whenever a old GC occurs.
191 void ResetCountersOld(); 191 void ResetCountersOld();
192 // Called whenever a new GC occurs. 192 // Called whenever a new GC occurs.
193 void ResetCountersNew(); 193 void ResetCountersNew();
194 // Called immediately after a new GC. 194 // Called immediately after a new GC.
195 void UpdatePromoted(); 195 void UpdatePromoted();
196 196
197 // Used by the generated code. 197 // Used by the generated code.
198 uword PredefinedClassHeapStatsTableAddress() { 198 static intptr_t ClassOffsetFor(intptr_t cid);
199 return reinterpret_cast<uword>(predefined_class_heap_stats_table_);
200 }
201 199
202 // Used by generated code. 200 // Used by the generated code.
203 uword ClassStatsTableAddress() { 201 ClassHeapStats** TableAddressFor(intptr_t cid);
204 return reinterpret_cast<uword>(&class_heap_stats_table_); 202 static intptr_t TableOffsetFor(intptr_t cid);
205 } 203
204 // Used by the generated code.
205 static intptr_t CounterOffsetFor(intptr_t cid, bool is_new_space);
206
207 // Used by the generated code.
208 ClassHeapStats** StateAddressFor(intptr_t cid,
209 intptr_t* state_offset);
210
211 // Used by the generated code.
212 static intptr_t SizeOffsetFor(intptr_t cid, bool is_new_space);
206 213
207 ClassHeapStats* StatsWithUpdatedSize(intptr_t cid); 214 ClassHeapStats* StatsWithUpdatedSize(intptr_t cid);
208 215
209 void AllocationProfilePrintJSON(JSONStream* stream); 216 void AllocationProfilePrintJSON(JSONStream* stream);
210 void ResetAllocationAccumulators(); 217 void ResetAllocationAccumulators();
211 218
212 // Deallocates table copies. Do not call during concurrent access to table. 219 // Deallocates table copies. Do not call during concurrent access to table.
213 void FreeOldTables(); 220 void FreeOldTables();
214 221
215 void TraceAllocationsFor(intptr_t cid, bool trace); 222 void TraceAllocationsFor(intptr_t cid, bool trace);
(...skipping 22 matching lines...) Expand all
238 ClassHeapStats* PreliminaryStatsAt(intptr_t cid); 245 ClassHeapStats* PreliminaryStatsAt(intptr_t cid);
239 void UpdateLiveOld(intptr_t cid, intptr_t size); 246 void UpdateLiveOld(intptr_t cid, intptr_t size);
240 void UpdateLiveNew(intptr_t cid, intptr_t size); 247 void UpdateLiveNew(intptr_t cid, intptr_t size);
241 248
242 DISALLOW_COPY_AND_ASSIGN(ClassTable); 249 DISALLOW_COPY_AND_ASSIGN(ClassTable);
243 }; 250 };
244 251
245 } // namespace dart 252 } // namespace dart
246 253
247 #endif // VM_CLASS_TABLE_H_ 254 #endif // VM_CLASS_TABLE_H_
OLDNEW
« no previous file with comments | « runtime/vm/assembler_x64.cc ('k') | runtime/vm/class_table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698