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

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

Issue 1961033003: Add GC stats to GC timeline events (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | runtime/vm/heap.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_HEAP_H_ 5 #ifndef VM_HEAP_H_
6 #define VM_HEAP_H_ 6 #define VM_HEAP_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/allocation.h" 9 #include "vm/allocation.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
11 #include "vm/globals.h" 11 #include "vm/globals.h"
12 #include "vm/pages.h" 12 #include "vm/pages.h"
13 #include "vm/scavenger.h" 13 #include "vm/scavenger.h"
14 #include "vm/spaces.h" 14 #include "vm/spaces.h"
15 #include "vm/verifier.h" 15 #include "vm/verifier.h"
16 #include "vm/weak_table.h" 16 #include "vm/weak_table.h"
17 17
18 namespace dart { 18 namespace dart {
19 19
20 // Forward declarations. 20 // Forward declarations.
21 class Isolate; 21 class Isolate;
22 class ObjectPointerVisitor; 22 class ObjectPointerVisitor;
23 class ObjectSet; 23 class ObjectSet;
24 class ServiceEvent; 24 class ServiceEvent;
25 class TimelineEventScope;
25 class VirtualMemory; 26 class VirtualMemory;
26 27
27 class Heap { 28 class Heap {
28 public: 29 public:
29 enum Space { 30 enum Space {
30 kNew, 31 kNew,
31 kOld, 32 kOld,
32 kCode, 33 kCode,
33 // TODO(koda): Harmonize all old-space allocation and get rid of this. 34 // TODO(koda): Harmonize all old-space allocation and get rid of this.
34 kPretenured, 35 kPretenured,
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 Thread* thread, ApiCallbacks api_callbacks, GCReason reason); 321 Thread* thread, ApiCallbacks api_callbacks, GCReason reason);
321 void CollectOldSpaceGarbage( 322 void CollectOldSpaceGarbage(
322 Thread* thread, ApiCallbacks api_callbacks, GCReason reason); 323 Thread* thread, ApiCallbacks api_callbacks, GCReason reason);
323 324
324 // GC stats collection. 325 // GC stats collection.
325 void RecordBeforeGC(Space space, GCReason reason); 326 void RecordBeforeGC(Space space, GCReason reason);
326 void RecordAfterGC(Space space); 327 void RecordAfterGC(Space space);
327 void PrintStats(); 328 void PrintStats();
328 void UpdateClassHeapStatsBeforeGC(Heap::Space space); 329 void UpdateClassHeapStatsBeforeGC(Heap::Space space);
329 void UpdatePretenurePolicy(); 330 void UpdatePretenurePolicy();
331 void PrintStatsToTimeline(TimelineEventScope* event);
330 332
331 // Updates gc in progress flags. 333 // Updates gc in progress flags.
332 bool BeginNewSpaceGC(Thread* thread); 334 bool BeginNewSpaceGC(Thread* thread);
333 void EndNewSpaceGC(); 335 void EndNewSpaceGC();
334 bool BeginOldSpaceGC(Thread* thread); 336 bool BeginOldSpaceGC(Thread* thread);
335 void EndOldSpaceGC(); 337 void EndOldSpaceGC();
336 338
337 // If this heap is non-empty, updates start and end to the smallest range that 339 // If this heap is non-empty, updates start and end to the smallest range that
338 // contains both the original [start, end) and the [lowest, highest) addresses 340 // contains both the original [start, end) and the [lowest, highest) addresses
339 // of this heap. 341 // of this heap.
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 // Note: During this scope, the code pages are non-executable. 397 // Note: During this scope, the code pages are non-executable.
396 class WritableVMIsolateScope : StackResource { 398 class WritableVMIsolateScope : StackResource {
397 public: 399 public:
398 explicit WritableVMIsolateScope(Thread* thread); 400 explicit WritableVMIsolateScope(Thread* thread);
399 ~WritableVMIsolateScope(); 401 ~WritableVMIsolateScope();
400 }; 402 };
401 403
402 } // namespace dart 404 } // namespace dart
403 405
404 #endif // VM_HEAP_H_ 406 #endif // VM_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698