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

Unified Diff: runtime/vm/scavenger.h

Issue 2992753002: Prepares allocation for proper sync with mutator and bg threads. (Closed)
Patch Set: Removes comments and checks for unscheduled mutator 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.h
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index de6d01f9712af815797e8981b5dcaafbe9e38277..954919ef9be2a5085c994595d4ef35da0528097c 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -10,6 +10,7 @@
#include "vm/dart.h"
#include "vm/flags.h"
#include "vm/globals.h"
+#include "vm/lockers.h"
#include "vm/raw_object.h"
#include "vm/ring_buffer.h"
#include "vm/spaces.h"
@@ -125,6 +126,7 @@ class Scavenger {
ASSERT(Utils::IsAligned(size, kObjectAlignment));
ASSERT(heap_ != Dart::vm_isolate()->heap());
ASSERT(!scavenging_);
+ MutexLocker ml(space_lock_);
uword result = top_;
intptr_t remaining = end_ - top_;
if (remaining < size) {
@@ -235,7 +237,9 @@ class Scavenger {
void FreeExternal(intptr_t size);
void MakeNewSpaceIterable() const;
- uword FirstObjectStart() const { return to_->start() | object_alignment_; }
+ int64_t FreeSpaceInWords(Isolate* isolate) const;
+ void MakeAllTLABsIterable(Isolate* isolate) const;
+ void AbandonAllTLABs(Isolate* isolate);
private:
// Ids for time and data records in Heap::GCStats.
@@ -254,6 +258,7 @@ class Scavenger {
kToKBAfterStoreBuffer = 3
};
+ uword FirstObjectStart() const { return to_->start() | object_alignment_; }
SemiSpace* Prologue(Isolate* isolate, bool invoke_api_callbacks);
void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor);
void IterateObjectIdTable(Isolate* isolate, ScavengerVisitor* visitor);
@@ -333,6 +338,8 @@ class Scavenger {
bool failed_to_promote_;
+ // Protects new space during the allocation of new TLABs
+ Mutex* space_lock_;
friend class ScavengerVisitor;
friend class ScavengerWeakVisitor;
« no previous file with comments | « runtime/vm/heap.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698