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

Unified Diff: src/heap.cc

Issue 255603002: Don't move the object start of objects on non-swept pages. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 5713537b5ab301076c51706d77f3eef5e5713970..a58b24c95d1c5af02d824dea16ae2f0857c9f1a4 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -3451,11 +3451,18 @@ bool Heap::CanMoveObjectStart(HeapObject* object) {
if (lo_space()->Contains(object)) return false;
- // We cannot move the object start if the given old space page is
- // concurrently swept.
+ Page* page = Page::FromAddress(address);
+ // We can move the object start if:
+ // (1) the object is not in old pointer or old data space,
+ // (2) the page of the object was already swept,
+ // (3) the page was already concurrently swept. This case is an optimization
+ // for concurrent sweeping. The WasSwept predicate for concurrently swept
+ // pages is set after sweeping all pages.
return (!is_in_old_pointer_space && !is_in_old_data_space) ||
- Page::FromAddress(address)->parallel_sweeping() <=
- MemoryChunk::PARALLEL_SWEEPING_FINALIZE;
+ page->WasSwept() ||
+ (mark_compact_collector()->AreSweeperThreadsActivated() &&
+ page->parallel_sweeping() <=
+ MemoryChunk::PARALLEL_SWEEPING_FINALIZE);
}
« no previous file with comments | « no previous file | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698