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

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

Issue 226973003: Simpler, more consistent triggering of old GC; also, use external in policy. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
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_SCAVENGER_H_ 5 #ifndef VM_SCAVENGER_H_
6 #define VM_SCAVENGER_H_ 6 #define VM_SCAVENGER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "platform/utils.h" 9 #include "platform/utils.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 92
93 void VisitObjects(ObjectVisitor* visitor) const; 93 void VisitObjects(ObjectVisitor* visitor) const;
94 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; 94 void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
95 95
96 void StartEndAddress(uword* start, uword* end) const { 96 void StartEndAddress(uword* start, uword* end) const {
97 *start = to_->start(); 97 *start = to_->start();
98 *end = to_->end(); 98 *end = to_->end();
99 } 99 }
100 100
101 // Returns true if the last scavenge had a promotion failure.
102 bool HadPromotionFailure() {
103 return had_promotion_failure_;
104 }
105
106 void WriteProtect(bool read_only); 101 void WriteProtect(bool read_only);
107 102
108 void AddGCTime(int64_t micros) { 103 void AddGCTime(int64_t micros) {
109 gc_time_micros_ += micros; 104 gc_time_micros_ += micros;
110 } 105 }
111 106
112 int64_t gc_time_micros() const { 107 int64_t gc_time_micros() const {
113 return gc_time_micros_; 108 return gc_time_micros_;
114 } 109 }
115 110
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 uword resolved_top_; 197 uword resolved_top_;
203 198
204 // Objects below this address have survived a scavenge. 199 // Objects below this address have survived a scavenge.
205 uword survivor_end_; 200 uword survivor_end_;
206 201
207 // All object are aligned to this value. 202 // All object are aligned to this value.
208 uword object_alignment_; 203 uword object_alignment_;
209 204
210 // Keep track whether a scavenge is currently running. 205 // Keep track whether a scavenge is currently running.
211 bool scavenging_; 206 bool scavenging_;
212 // Keep track whether the scavenge had a promotion failure.
213 bool had_promotion_failure_;
214 207
215 int64_t gc_time_micros_; 208 int64_t gc_time_micros_;
216 intptr_t collections_; 209 intptr_t collections_;
217 210
218 // The total size of external data associated with objects in this scavenger. 211 // The total size of external data associated with objects in this scavenger.
219 intptr_t external_size_; 212 intptr_t external_size_;
220 213
221 friend class ScavengerVisitor; 214 friend class ScavengerVisitor;
222 friend class ScavengerWeakVisitor; 215 friend class ScavengerWeakVisitor;
223 216
224 DISALLOW_COPY_AND_ASSIGN(Scavenger); 217 DISALLOW_COPY_AND_ASSIGN(Scavenger);
225 }; 218 };
226 219
227 } // namespace dart 220 } // namespace dart
228 221
229 #endif // VM_SCAVENGER_H_ 222 #endif // VM_SCAVENGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698