|
|
Chromium Code Reviews|
Created:
5 years ago by Michael Lippautz Modified:
5 years ago Reviewers:
Hannes Payer (out of office) CC:
v8-reviews_googlegroups.com, Hannes Payer (out of office), ulan Base URL:
https://chromium.googlesource.com/v8/v8.git@master Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
Description[heap] Remove SweeperType and clean up SweepSpace a bit.
R=hpayer@chromium.org
BUG=
Patch Set 1 #Patch Set 2 : Fix typo #Patch Set 3 : Rebase #
Messages
Total messages: 17 (9 generated)
PTAL, this is independent from the other sweeper/compaction changes.
lgtm
The CQ bit was checked by mlippautz@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1521573002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1521573002/1
The CQ bit was unchecked by mlippautz@chromium.org
The CQ bit was checked by mlippautz@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from hpayer@chromium.org Link to the patchset: https://codereview.chromium.org/1521573002/#ps20001 (title: "Fix typo")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1521573002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1521573002/20001
The CQ bit was unchecked by commit-bot@chromium.org
Failed to apply patch for src/heap/mark-compact.cc:
While running git apply --index -3 -p1;
error: patch failed: src/heap/mark-compact.cc:3835
Falling back to three-way merge...
Applied patch to 'src/heap/mark-compact.cc' with conflicts.
U src/heap/mark-compact.cc
Patch: src/heap/mark-compact.cc
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index
fcc99c3b6bee028963e3692d9a4304073d7a9aa2..ed7e3e97e65946b163f63f03d6bc503adeffbd68
100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3716,7 +3716,7 @@ int MarkCompactCollector::SweepInParallel(Page* page,
PagedSpace* space) {
}
-void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
+void MarkCompactCollector::StartSweepSpace(PagedSpace* space) {
space->ClearStats();
// We defensively initialize end_of_unswept_pages_ here with the first page
@@ -3747,8 +3747,7 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space,
SweeperType sweeper) {
if (p->LiveBytes() == 0) {
if (unused_page_present) {
if (FLAG_gc_verbose) {
- PrintF("Sweeping 0x%" V8PRIxPTR " released page.\n",
- reinterpret_cast<intptr_t>(p));
+ PrintIsolate(isolate(), "sweeping: released page: %p", p);
}
space->ReleasePage(p);
continue;
@@ -3756,64 +3755,38 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space,
SweeperType sweeper) {
unused_page_present = true;
}
- switch (sweeper) {
- case CONCURRENT_SWEEPING:
- if (!parallel_sweeping_active) {
- if (FLAG_gc_verbose) {
- PrintF("Sweeping 0x%" V8PRIxPTR ".\n",
- reinterpret_cast<intptr_t>(p));
- }
- if (space->identity() == CODE_SPACE) {
- if (FLAG_zap_code_space) {
- Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, REBUILD_SKIP_LIST,
- ZAP_FREE_SPACE>(space, NULL, p, NULL);
- } else {
- Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, REBUILD_SKIP_LIST,
- IGNORE_FREE_SPACE>(space, NULL, p, NULL);
- }
- } else {
- Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, IGNORE_SKIP_LIST,
- IGNORE_FREE_SPACE>(space, NULL, p, NULL);
- }
- pages_swept++;
- parallel_sweeping_active = true;
- } else {
- if (FLAG_gc_verbose) {
- PrintF("Sweeping 0x%" V8PRIxPTR " in parallel.\n",
- reinterpret_cast<intptr_t>(p));
- }
- p->parallel_sweeping_state().SetValue(MemoryChunk::kSweepingPending);
- int to_sweep = p->area_size() - p->LiveBytes();
- space->accounting_stats_.ShrinkSpace(to_sweep);
- }
- space->set_end_of_unswept_pages(p);
- break;
- case SEQUENTIAL_SWEEPING: {
- if (FLAG_gc_verbose) {
- PrintF("Sweeping 0x%" V8PRIxPTR ".\n",
reinterpret_cast<intptr_t>(p));
- }
- if (space->identity() == CODE_SPACE) {
- if (FLAG_zap_code_space) {
- Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, REBUILD_SKIP_LIST,
- ZAP_FREE_SPACE>(space, NULL, p, NULL);
- } else {
- Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, REBUILD_SKIP_LIST,
- IGNORE_FREE_SPACE>(space, NULL, p, NULL);
- }
+ if (!parallel_sweeping_active) {
+ if (FLAG_gc_verbose) {
+ PrintIsolate(isolate(), "sweeping: %p", p);
+ }
+ if (space->identity() == CODE_SPACE) {
+ if (FLAG_zap_code_space) {
+ Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, REBUILD_SKIP_LIST,
+ ZAP_FREE_SPACE>(space, NULL, p, NULL);
} else {
- Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, IGNORE_SKIP_LIST,
+ Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, REBUILD_SKIP_LIST,
IGNORE_FREE_SPACE>(space, NULL, p, NULL);
}
- pages_swept++;
- break;
+ } else {
+ Sweep<SWEEP_ONLY, SWEEP_ON_MAIN_THREAD, IGNORE_SKIP_LIST,
+ IGNORE_FREE_SPACE>(space, NULL, p, NULL);
+ }
+ pages_swept++;
+ parallel_sweeping_active = true;
+ } else {
+ if (FLAG_gc_verbose) {
+ PrintIsolate(isolate(), "sweeping: initialized for parallel: %p", p);
}
- default: { UNREACHABLE(); }
+ p->parallel_sweeping_state().SetValue(MemoryChunk::kSweepingPending);
+ int to_sweep = p->area_size() - p->LiveBytes();
+ space->accounting_stats_.ShrinkSpace(to_sweep);
}
+ space->set_end_of_unswept_pages(p);
}
if (FLAG_gc_verbose) {
- PrintF("SweepSpace: %s (%d pages swept)\n",
- AllocationSpaceName(space->identity()), pages_swept);
+ PrintIsolate(isolate(), "sweeping: space=%s pages_swept=%d",
+ AllocationSpaceName(space->identity()), pages_swept);
}
}
@@ -3835,17 +3808,17 @@ void MarkCompactCollector::SweepSpaces() {
{
GCTracer::Scope sweep_scope(heap()->tracer(),
GCTracer::Scope::MC_SWEEP_OLDSPACE);
- SweepSpace(heap()->old_space(), CONCURRENT_SWEEPING);
+ StartSweepSpace(heap()->old_space());
}
{
GCTracer::Scope sweep_scope(heap()->tracer(),
GCTracer::Scope::MC_SWEEP_CODE);
- SweepSpace(heap()->code_space(), CONCURRENT_SWEEPING);
+ StartSweepSpace(heap()->code_space());
}
{
GCTracer::Scope sweep_scope(heap()->tracer(),
GCTracer::Scope::MC_SWEEP_MAP);
- SweepSpace(heap()->map_space(), CONCURRENT_SWEEPING);
+ StartSweepSpace(heap()->map_space());
}
sweeping_in_progress_ = true;
if (heap()->concurrent_sweeping_enabled()) {
The CQ bit was checked by mlippautz@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from hpayer@chromium.org Link to the patchset: https://codereview.chromium.org/1521573002/#ps40001 (title: "Rebase")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1521573002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1521573002/40001
Message was sent while issue was closed.
Description was changed from ========== [heap] Remove SweeperType and clean up SweepSpace a bit. R=hpayer@chromium.org BUG= ========== to ========== [heap] Remove SweeperType and clean up SweepSpace a bit. R=hpayer@chromium.org BUG= Committed: https://crrev.com/38d889ec190fca8a0f9fd550c3f664e99ce280d4 Cr-Commit-Position: refs/heads/master@{#32793} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/38d889ec190fca8a0f9fd550c3f664e99ce280d4 Cr-Commit-Position: refs/heads/master@{#32793}
Message was sent while issue was closed.
Description was changed from ========== [heap] Remove SweeperType and clean up SweepSpace a bit. R=hpayer@chromium.org BUG= Committed: https://crrev.com/38d889ec190fca8a0f9fd550c3f664e99ce280d4 Cr-Commit-Position: refs/heads/master@{#32793} ========== to ========== [heap] Remove SweeperType and clean up SweepSpace a bit. R=hpayer@chromium.org BUG= ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
