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

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

Issue 1596343004: [heap] Sort sweep pages list by free memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Adressed final comment Created 4 years, 11 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 | « no previous file | 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 cfb2d9d27022f033341acce33c68212faa8ac31a..304bd1e4c4cea80747d1da7c76a49ea6efbbb1f6 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -421,7 +421,8 @@ class MarkCompactCollector {
// required_freed_bytes was freed. If required_freed_bytes was set to zero
// then the whole given space is swept. It returns the size of the maximum
// continuous freed memory chunk.
- int SweepInParallel(PagedSpace* space, int required_freed_bytes);
+ int SweepInParallel(PagedSpace* space, int required_freed_bytes,
+ int max_pages = 0);
// Sweeps a given page concurrently to the sweeper threads. It returns the
// size of the maximum continuous freed memory chunk.
@@ -511,6 +512,8 @@ class MarkCompactCollector {
class HeapObjectVisitor;
class SweeperTask;
+ typedef std::vector<Page*> SweepingList;
+
static const int kInitialLocalPretenuringFeedbackCapacity = 256;
explicit MarkCompactCollector(Heap* heap);
@@ -693,6 +696,8 @@ class MarkCompactCollector {
// evacuation.
//
+ inline SweepingList& sweeping_list(Space* space);
+
// 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.
@@ -736,10 +741,6 @@ class MarkCompactCollector {
void ReleaseEvacuationCandidates();
- // Moves the pages of the evacuation_candidates_ list to the end of their
- // corresponding space pages list.
- void MoveEvacuationCandidatesToEndOfPagesList();
-
// Starts sweeping of a space by contributing on the main thread and setting
// up other pages for sweeping.
void StartSweepSpace(PagedSpace* space);
@@ -793,6 +794,10 @@ class MarkCompactCollector {
base::SmartPointer<FreeList> free_list_code_space_;
base::SmartPointer<FreeList> free_list_map_space_;
+ SweepingList sweeping_list_old_space_;
+ SweepingList sweeping_list_code_space_;
+ SweepingList sweeping_list_map_space_;
+
// True if we are collecting slots to perform evacuation from evacuation
// candidates.
bool compacting_;
« no previous file with comments | « no previous file | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698