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

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

Issue 2960063002: Revert "Modifies the debug garbage collector (CollectAllGarbage()) to correctly remove inter-genera… (Closed)
Patch Set: Created 3 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/raw_object.h ('k') | runtime/vm/scavenger.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 RUNTIME_VM_SCAVENGER_H_ 5 #ifndef RUNTIME_VM_SCAVENGER_H_
6 #define RUNTIME_VM_SCAVENGER_H_ 6 #define RUNTIME_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/dart.h" 10 #include "vm/dart.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 top_ += size; 142 top_ += size;
143 ASSERT(to_->Contains(top_) || (top_ == to_->end())); 143 ASSERT(to_->Contains(top_) || (top_ == to_->end()));
144 return result; 144 return result;
145 } 145 }
146 146
147 // Collect the garbage in this scavenger. 147 // Collect the garbage in this scavenger.
148 void Scavenge(); 148 void Scavenge();
149 void Scavenge(bool invoke_api_callbacks); 149 void Scavenge(bool invoke_api_callbacks);
150 150
151 // Promote all live objects. 151 // Promote all live objects.
152 void Evacuate(); 152 void Evacuate() {
153 Scavenge();
154 Scavenge();
155 ASSERT(UsedInWords() == 0);
156 }
153 157
154 // Accessors to generate code for inlined allocation. 158 // Accessors to generate code for inlined allocation.
155 uword* TopAddress() { return &top_; } 159 uword* TopAddress() { return &top_; }
156 uword* EndAddress() { return &end_; } 160 uword* EndAddress() { return &end_; }
157 static intptr_t top_offset() { return OFFSET_OF(Scavenger, top_); } 161 static intptr_t top_offset() { return OFFSET_OF(Scavenger, top_); }
158 static intptr_t end_offset() { return OFFSET_OF(Scavenger, end_); } 162 static intptr_t end_offset() { return OFFSET_OF(Scavenger, end_); }
159 163
160 int64_t UsedInWords() const { 164 int64_t UsedInWords() const {
161 return (top_ - FirstObjectStart()) >> kWordSizeLog2; 165 return (top_ - FirstObjectStart()) >> kWordSizeLog2;
162 } 166 }
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 RawWeakProperty* delayed_weak_properties_; 290 RawWeakProperty* delayed_weak_properties_;
287 291
288 int64_t gc_time_micros_; 292 int64_t gc_time_micros_;
289 intptr_t collections_; 293 intptr_t collections_;
290 static const int kStatsHistoryCapacity = 2; 294 static const int kStatsHistoryCapacity = 2;
291 RingBuffer<ScavengeStats, kStatsHistoryCapacity> stats_history_; 295 RingBuffer<ScavengeStats, kStatsHistoryCapacity> stats_history_;
292 296
293 // The total size of external data associated with objects in this scavenger. 297 // The total size of external data associated with objects in this scavenger.
294 intptr_t external_size_; 298 intptr_t external_size_;
295 299
296 bool failed_to_promote_;
297
298 friend class ScavengerVisitor; 300 friend class ScavengerVisitor;
299 friend class ScavengerWeakVisitor; 301 friend class ScavengerWeakVisitor;
300 302
301 DISALLOW_COPY_AND_ASSIGN(Scavenger); 303 DISALLOW_COPY_AND_ASSIGN(Scavenger);
302 }; 304 };
303 305
304 } // namespace dart 306 } // namespace dart
305 307
306 #endif // RUNTIME_VM_SCAVENGER_H_ 308 #endif // RUNTIME_VM_SCAVENGER_H_
OLDNEW
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698