| OLD | NEW |
| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 intptr_t collections() const { return collections_; } | 230 intptr_t collections() const { return collections_; } |
| 231 | 231 |
| 232 #ifndef PRODUCT | 232 #ifndef PRODUCT |
| 233 void PrintToJSONObject(JSONObject* object) const; | 233 void PrintToJSONObject(JSONObject* object) const; |
| 234 #endif // !PRODUCT | 234 #endif // !PRODUCT |
| 235 | 235 |
| 236 void AllocateExternal(intptr_t size); | 236 void AllocateExternal(intptr_t size); |
| 237 void FreeExternal(intptr_t size); | 237 void FreeExternal(intptr_t size); |
| 238 | 238 |
| 239 uword FindTopOfSpace(Isolate* isolate) const; |
| 239 uword FlushTLS() const; | 240 uword FlushTLS() const; |
| 240 void UnflushTLS(uword value) const; | 241 void UnflushTLS(uword value) const; |
| 242 void AbandonAllTLABs(); |
| 241 uword FirstObjectStart() const { return to_->start() | object_alignment_; } | 243 uword FirstObjectStart() const { return to_->start() | object_alignment_; } |
| 242 | 244 |
| 243 private: | 245 private: |
| 244 // Ids for time and data records in Heap::GCStats. | 246 // Ids for time and data records in Heap::GCStats. |
| 245 enum { | 247 enum { |
| 246 // Time | 248 // Time |
| 247 kDummyScavengeTime = 0, | 249 kDummyScavengeTime = 0, |
| 248 kSafePoint = 1, | 250 kSafePoint = 1, |
| 249 kVisitIsolateRoots = 2, | 251 kVisitIsolateRoots = 2, |
| 250 kIterateStoreBuffers = 3, | 252 kIterateStoreBuffers = 3, |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 int64_t gc_time_micros_; | 331 int64_t gc_time_micros_; |
| 330 intptr_t collections_; | 332 intptr_t collections_; |
| 331 static const int kStatsHistoryCapacity = 2; | 333 static const int kStatsHistoryCapacity = 2; |
| 332 RingBuffer<ScavengeStats, kStatsHistoryCapacity> stats_history_; | 334 RingBuffer<ScavengeStats, kStatsHistoryCapacity> stats_history_; |
| 333 | 335 |
| 334 // The total size of external data associated with objects in this scavenger. | 336 // The total size of external data associated with objects in this scavenger. |
| 335 intptr_t external_size_; | 337 intptr_t external_size_; |
| 336 | 338 |
| 337 bool failed_to_promote_; | 339 bool failed_to_promote_; |
| 338 | 340 |
| 341 Mutex* space_lock_; |
| 339 friend class ScavengerVisitor; | 342 friend class ScavengerVisitor; |
| 340 friend class ScavengerWeakVisitor; | 343 friend class ScavengerWeakVisitor; |
| 341 | 344 |
| 342 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 345 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
| 343 }; | 346 }; |
| 344 | 347 |
| 345 } // namespace dart | 348 } // namespace dart |
| 346 | 349 |
| 347 #endif // RUNTIME_VM_SCAVENGER_H_ | 350 #endif // RUNTIME_VM_SCAVENGER_H_ |
| OLD | NEW |