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

Unified Diff: src/spaces.cc

Issue 361983003: Wait for sweeper threads only if we have to. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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
« src/spaces.h ('K') | « src/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index 300d19e0d6dbd6cb78bfd32e47e19b643a0356dd..3c9b34a4c58a29995523c9269927b7846bb95728 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -936,6 +936,7 @@ PagedSpace::PagedSpace(Heap* heap,
: Space(heap, id, executable),
free_list_(this),
was_swept_conservatively_(false),
+ was_swept_concurrently_(false),
unswept_free_bytes_(0),
end_of_unswept_pages_(NULL) {
if (id == CODE_SPACE) {
@@ -2546,8 +2547,8 @@ void PagedSpace::PrepareForMarkCompact() {
intptr_t PagedSpace::SizeOfObjects() {
- ASSERT(heap()->mark_compact_collector()->IsConcurrentSweepingInProgress() ||
- (unswept_free_bytes_ == 0));
+ ASSERT(heap()->mark_compact_collector()->
+ IsConcurrentSweepingInProgress(this) || (unswept_free_bytes_ == 0));
return Size() - unswept_free_bytes_ - (limit() - top());
}
@@ -2582,7 +2583,7 @@ HeapObject* PagedSpace::WaitForSweeperThreadsAndRetryAllocation(
MarkCompactCollector* collector = heap()->mark_compact_collector();
// If sweeper threads are still running, wait for them.
- if (collector->IsConcurrentSweepingInProgress()) {
+ if (collector->IsConcurrentSweepingInProgress(this)) {
collector->WaitUntilSweepingCompleted();
// After waiting for the sweeper threads, there may be new free-list
@@ -2598,7 +2599,7 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
// If sweeper threads are active, try to re-fill the free-lists.
MarkCompactCollector* collector = heap()->mark_compact_collector();
- if (collector->IsConcurrentSweepingInProgress()) {
+ if (collector->IsConcurrentSweepingInProgress(this)) {
collector->RefillFreeList(this);
// Retry the free list allocation.
« src/spaces.h ('K') | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698