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

Unified Diff: src/mark-compact.cc

Issue 405373003: Revert "Set the state of a swept page after being done with sweeping." (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 595d6ee3ce09ddf35ae26cd6a7f7444e78c48802..2e276d1a474ac313986d1da029aa658c9bf8b479 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -3267,6 +3267,12 @@ static int SweepPrecisely(PagedSpace* space,
start_time = base::OS::TimeCurrentMillis();
}
+ if (parallelism == MarkCompactCollector::SWEEP_IN_PARALLEL) {
+ p->set_parallel_sweeping(MemoryChunk::SWEEPING_FINALIZE);
+ } else {
+ p->MarkSweptPrecisely();
+ }
+
Address free_start = p->area_start();
ASSERT(reinterpret_cast<intptr_t>(free_start) % (32 * kPointerSize) == 0);
int offsets[16];
@@ -3340,14 +3346,6 @@ static int SweepPrecisely(PagedSpace* space,
if (FLAG_print_cumulative_gc_stat) {
space->heap()->AddSweepingTime(base::OS::TimeCurrentMillis() - start_time);
}
-
- if (parallelism == MarkCompactCollector::SWEEP_IN_PARALLEL) {
- // When concurrent sweeping is active, the page will be marked after
- // sweeping by the main thread.
- p->set_parallel_sweeping(MemoryChunk::SWEEPING_FINALIZE);
- } else {
- p->MarkSweptPrecisely();
- }
return FreeList::GuaranteedAllocatable(static_cast<int>(max_freed_bytes));
}
@@ -4001,6 +3999,14 @@ int MarkCompactCollector::SweepConservatively(PagedSpace* space,
(mode == MarkCompactCollector::SWEEP_ON_MAIN_THREAD &&
free_list == NULL));
+ // When parallel sweeping is active, the page will be marked after
+ // sweeping by the main thread.
+ if (mode == MarkCompactCollector::SWEEP_IN_PARALLEL) {
+ p->set_parallel_sweeping(MemoryChunk::SWEEPING_FINALIZE);
+ } else {
+ p->MarkSweptConservatively();
+ }
+
intptr_t freed_bytes = 0;
intptr_t max_freed_bytes = 0;
size_t size = 0;
@@ -4021,13 +4027,6 @@ int MarkCompactCollector::SweepConservatively(PagedSpace* space,
static_cast<int>(size));
max_freed_bytes = Max(freed_bytes, max_freed_bytes);
ASSERT_EQ(0, p->LiveBytes());
- if (mode == MarkCompactCollector::SWEEP_IN_PARALLEL) {
- // When concurrent sweeping is active, the page will be marked after
- // sweeping by the main thread.
- p->set_parallel_sweeping(MemoryChunk::SWEEPING_FINALIZE);
- } else {
- p->MarkSweptConservatively();
- }
return FreeList::GuaranteedAllocatable(static_cast<int>(max_freed_bytes));
}
@@ -4085,13 +4084,6 @@ int MarkCompactCollector::SweepConservatively(PagedSpace* space,
}
p->ResetLiveBytes();
- if (mode == MarkCompactCollector::SWEEP_IN_PARALLEL) {
- // When concurrent sweeping is active, the page will be marked after
- // sweeping by the main thread.
- p->set_parallel_sweeping(MemoryChunk::SWEEPING_FINALIZE);
- } else {
- p->MarkSweptConservatively();
- }
return FreeList::GuaranteedAllocatable(static_cast<int>(max_freed_bytes));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698