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

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

Issue 2992753002: Prepares allocation for proper sync with mutator and bg threads. (Closed)
Patch Set: Splits FindTopOfSpace to two functions 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_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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 intptr_t collections() const { return collections_; } 228 intptr_t collections() const { return collections_; }
229 229
230 #ifndef PRODUCT 230 #ifndef PRODUCT
231 void PrintToJSONObject(JSONObject* object) const; 231 void PrintToJSONObject(JSONObject* object) const;
232 #endif // !PRODUCT 232 #endif // !PRODUCT
233 233
234 void AllocateExternal(intptr_t size); 234 void AllocateExternal(intptr_t size);
235 void FreeExternal(intptr_t size); 235 void FreeExternal(intptr_t size);
236 236
237 uword FlushTLS() const; 237 uword FindTopOfSpace(Isolate* isolate) const;
238 void UnflushTLS(uword value) const; 238 void MakeALLTLABsIterable(Isolate* isolate) const;
239 void FlushTLS() const;
240 void AbandonAllTLABs();
239 uword FirstObjectStart() const { return to_->start() | object_alignment_; } 241 uword FirstObjectStart() const { return to_->start() | object_alignment_; }
240 242
241 private: 243 private:
242 // Ids for time and data records in Heap::GCStats. 244 // Ids for time and data records in Heap::GCStats.
243 enum { 245 enum {
244 // Time 246 // Time
245 kDummyScavengeTime = 0, 247 kDummyScavengeTime = 0,
246 kSafePoint = 1, 248 kSafePoint = 1,
247 kVisitIsolateRoots = 2, 249 kVisitIsolateRoots = 2,
248 kIterateStoreBuffers = 3, 250 kIterateStoreBuffers = 3,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 int64_t gc_time_micros_; 329 int64_t gc_time_micros_;
328 intptr_t collections_; 330 intptr_t collections_;
329 static const int kStatsHistoryCapacity = 2; 331 static const int kStatsHistoryCapacity = 2;
330 RingBuffer<ScavengeStats, kStatsHistoryCapacity> stats_history_; 332 RingBuffer<ScavengeStats, kStatsHistoryCapacity> stats_history_;
331 333
332 // The total size of external data associated with objects in this scavenger. 334 // The total size of external data associated with objects in this scavenger.
333 intptr_t external_size_; 335 intptr_t external_size_;
334 336
335 bool failed_to_promote_; 337 bool failed_to_promote_;
336 338
339 Mutex* space_lock_;
337 friend class ScavengerVisitor; 340 friend class ScavengerVisitor;
338 friend class ScavengerWeakVisitor; 341 friend class ScavengerWeakVisitor;
339 342
340 DISALLOW_COPY_AND_ASSIGN(Scavenger); 343 DISALLOW_COPY_AND_ASSIGN(Scavenger);
341 }; 344 };
342 345
343 } // namespace dart 346 } // namespace dart
344 347
345 #endif // RUNTIME_VM_SCAVENGER_H_ 348 #endif // RUNTIME_VM_SCAVENGER_H_
OLDNEW
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.cc » ('j') | runtime/vm/scavenger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698