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

Unified Diff: src/heap/spaces.h

Issue 2250423002: [heap] Don't unmap new space pages while sweeping is active (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove weak barrier Created 4 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
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index ae2f86c32073bd195b377e86e972d997e70767ce..465601252d3b465ab253d5505b8c19843278c746 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -1205,7 +1205,12 @@ class MemoryAllocator {
template <ChunkQueueType type>
void AddMemoryChunkSafe(MemoryChunk* chunk) {
base::LockGuard<base::Mutex> guard(&mutex_);
- chunks_[type].push_back(chunk);
+ if (type != kRegular || allocator_->CanFreeMemoryChunk(chunk)) {
+ chunks_[type].push_back(chunk);
+ } else {
+ DCHECK_EQ(type, kRegular);
+ delayed_regular_chunks_.push_back(chunk);
+ }
}
template <ChunkQueueType type>
@@ -1217,11 +1222,15 @@ class MemoryAllocator {
return chunk;
}
+ void ReconsiderDelayedChunks();
void PerformFreeMemoryOnQueuedChunks();
base::Mutex mutex_;
MemoryAllocator* allocator_;
std::list<MemoryChunk*> chunks_[kNumberOfChunkQueues];
+ // Delayed chunks cannot be processed in the current unmapping cycle because
+ // of dependencies. See MemoryAllocator::CanFreeMemoryChunk.
Hannes Payer (out of office) 2016/08/18 09:38:42 Just spell out the "dependencies" here.
Michael Lippautz 2016/08/18 09:59:40 Done.
+ std::list<MemoryChunk*> delayed_regular_chunks_;
base::Semaphore pending_unmapping_tasks_semaphore_;
intptr_t concurrent_unmapping_tasks_active_;
@@ -1260,6 +1269,8 @@ class MemoryAllocator {
template <MemoryAllocator::FreeMode mode = kFull>
void Free(MemoryChunk* chunk);
+ bool CanFreeMemoryChunk(MemoryChunk* chunk);
+
// Returns allocated spaces in bytes.
intptr_t Size() { return size_.Value(); }
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698