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

Unified Diff: src/heap/mark-compact.h

Issue 2446583003: Revert of Reland "[heap] Start sweeper tasks after evacuation. (patchset #2 id:20001 of https://chromiumcoder… (Closed)
Patch Set: fix formatting Created 4 years, 2 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 | « src/heap/incremental-marking.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index 7203ad05c0eda3e9afb309149d725cc066930191..a5d4b0e64282f1e0354993ca99978c07db8e8f21 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -316,25 +316,24 @@ class MarkCompactCollector {
: heap_(heap),
pending_sweeper_tasks_semaphore_(0),
sweeping_in_progress_(false),
+ late_pages_(false),
num_sweeping_tasks_(0) {}
bool sweeping_in_progress() { return sweeping_in_progress_; }
+ bool contains_late_pages() { return late_pages_; }
void AddPage(AllocationSpace space, Page* page);
+ void AddLatePage(AllocationSpace space, Page* page);
int ParallelSweepSpace(AllocationSpace identity, int required_freed_bytes,
int max_pages = 0);
int ParallelSweepPage(Page* page, AllocationSpace identity);
- // After calling this function sweeping is considered to be in progress
- // and the main thread can sweep lazily, but the background sweeper tasks
- // are not running yet.
void StartSweeping();
- void StartSweeperTasks();
+ void StartSweepingHelper(AllocationSpace space_to_start);
void EnsureCompleted();
void EnsureNewSpaceCompleted();
- bool AreSweeperTasksRunning();
- bool IsSweepingCompleted(AllocationSpace space);
+ bool IsSweepingCompleted();
void SweepOrWaitUntilSweepingCompleted(Page* page);
void AddSweptPageSafe(PagedSpace* space, Page* page);
@@ -363,6 +362,7 @@ class MarkCompactCollector {
SweptList swept_list_[kAllocationSpaces];
SweepingList sweeping_list_[kAllocationSpaces];
bool sweeping_in_progress_;
+ bool late_pages_;
base::AtomicNumber<intptr_t> num_sweeping_tasks_;
};
@@ -637,10 +637,21 @@ class MarkCompactCollector {
void AbortTransitionArrays();
- // Starts sweeping of spaces by contributing on the main thread and setting
- // up other pages for sweeping. Does not start sweeper tasks.
- void StartSweepSpaces();
- void StartSweepSpace(PagedSpace* space);
+ // -----------------------------------------------------------------------
+ // Phase 2: Sweeping to clear mark bits and free non-live objects for
+ // a non-compacting collection.
+ //
+ // Before: Live objects are marked and non-live objects are unmarked.
+ //
+ // After: Live objects are unmarked, non-live regions have been added to
+ // their space's free list. Active eden semispace is compacted by
+ // evacuation.
+ //
+
+ // If we are not compacting the heap, we simply sweep the spaces except
+ // for the large object space, clearing mark bits and adding unmarked
+ // regions to each space's free list.
+ void SweepSpaces();
void EvacuateNewSpacePrologue();
@@ -663,6 +674,9 @@ class MarkCompactCollector {
void ReleaseEvacuationCandidates();
+ // Starts sweeping of a space by contributing on the main thread and setting
+ // up other pages for sweeping.
+ void StartSweepSpace(PagedSpace* space);
#ifdef DEBUG
friend class MarkObjectVisitor;
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698