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

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

Issue 3001423002: Initial idle GC logic. (Closed)
Patch Set: . Created 3 years, 4 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
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 RUNTIME_VM_HEAP_H_ 5 #ifndef RUNTIME_VM_HEAP_H_
6 #define RUNTIME_VM_HEAP_H_ 6 #define RUNTIME_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"
(...skipping 29 matching lines...) Expand all
40 #endif 40 #endif
41 kObjectIds, 41 kObjectIds,
42 kNumWeakSelectors 42 kNumWeakSelectors
43 }; 43 };
44 44
45 enum GCReason { 45 enum GCReason {
46 kNewSpace, 46 kNewSpace,
47 kPromotion, 47 kPromotion,
48 kOldSpace, 48 kOldSpace,
49 kFull, 49 kFull,
50 kIdle,
50 kGCAtAlloc, 51 kGCAtAlloc,
51 kGCTestCase, 52 kGCTestCase,
52 }; 53 };
53 54
54 // Pattern for unused new space and swept old space. 55 // Pattern for unused new space and swept old space.
55 static const uint8_t kZapByte = 0xf3; 56 static const uint8_t kZapByte = 0xf3;
56 57
57 ~Heap(); 58 ~Heap();
58 59
59 Scavenger* new_space() { return &new_space_; } 60 Scavenger* new_space() { return &new_space_; }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // object is found, traversal through the heap space stops at that 98 // object is found, traversal through the heap space stops at that
98 // point. 99 // point.
99 // The 'visitor' function should return false if the object is not found, 100 // The 'visitor' function should return false if the object is not found,
100 // traversal through the heap space continues. 101 // traversal through the heap space continues.
101 // Returns null object if nothing is found. 102 // Returns null object if nothing is found.
102 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor) const; 103 RawInstructions* FindObjectInCodeSpace(FindObjectVisitor* visitor) const;
103 RawObject* FindOldObject(FindObjectVisitor* visitor) const; 104 RawObject* FindOldObject(FindObjectVisitor* visitor) const;
104 RawObject* FindNewObject(FindObjectVisitor* visitor) const; 105 RawObject* FindNewObject(FindObjectVisitor* visitor) const;
105 RawObject* FindObject(FindObjectVisitor* visitor) const; 106 RawObject* FindObject(FindObjectVisitor* visitor) const;
106 107
108 void NotifyIdle(int64_t deadline);
109
107 void CollectGarbage(Space space); 110 void CollectGarbage(Space space);
108 void CollectGarbage(Space space, GCReason reason); 111 void CollectGarbage(Space space, GCReason reason);
109 void CollectAllGarbage(); 112 void CollectAllGarbage();
110 bool NeedsGarbageCollection() const { 113 bool NeedsGarbageCollection() const {
111 return old_space_.NeedsGarbageCollection(); 114 return old_space_.NeedsGarbageCollection();
112 } 115 }
113 116
114 void WaitForSweeperTasks(Thread* thread); 117 void WaitForSweeperTasks(Thread* thread);
115 118
116 // Enables growth control on the page space heaps. This should be 119 // Enables growth control on the page space heaps. This should be
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 // Note: During this scope, the code pages are non-executable. 406 // Note: During this scope, the code pages are non-executable.
404 class WritableVMIsolateScope : StackResource { 407 class WritableVMIsolateScope : StackResource {
405 public: 408 public:
406 explicit WritableVMIsolateScope(Thread* thread); 409 explicit WritableVMIsolateScope(Thread* thread);
407 ~WritableVMIsolateScope(); 410 ~WritableVMIsolateScope();
408 }; 411 };
409 412
410 } // namespace dart 413 } // namespace dart
411 414
412 #endif // RUNTIME_VM_HEAP_H_ 415 #endif // RUNTIME_VM_HEAP_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/heap.cc » ('j') | runtime/vm/scavenger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698