Commit 97ddfc3e authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

Reland "[heap] Unprotect code pages on demand in MinorMC"

This reverts commit be2f237d.

Original change's description:
> [heap] Unprotect code pages on demand in MinorMC
>
> This reduces average pause of MinorMC in Richards benchmark from 0.32ms
> to 0.25ms:
>
> baseline pause
>   len: 22
>   min: 0.3
>   max: 0.6
>   avg: 0.322727272727
>   [0,5[: 22
>
> pause
>   len: 22
>   min: 0.2
>   max: 0.7
>   avg: 0.254545454545
>   [0,5[: 22
>
> Bug: chromium:651354

Change-Id: I9d70037dda612528368fb1ba330dc6f6510a14a6
Reviewed-on: https://chromium-review.googlesource.com/1055450Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53129}
parent dc1906a7
...@@ -1884,7 +1884,6 @@ void Heap::MinorMarkCompact() { ...@@ -1884,7 +1884,6 @@ void Heap::MinorMarkCompact() {
AlwaysAllocateScope always_allocate(isolate()); AlwaysAllocateScope always_allocate(isolate());
IncrementalMarking::PauseBlackAllocationScope pause_black_allocation( IncrementalMarking::PauseBlackAllocationScope pause_black_allocation(
incremental_marking()); incremental_marking());
CodeSpaceMemoryModificationScope code_modifcation(this);
ConcurrentMarking::PauseScope pause_scope(concurrent_marking()); ConcurrentMarking::PauseScope pause_scope(concurrent_marking());
minor_mark_compact_collector()->CollectGarbage(); minor_mark_compact_collector()->CollectGarbage();
......
...@@ -270,11 +270,12 @@ void EvacuationVerifier::VerifyEvacuation(NewSpace* space) { ...@@ -270,11 +270,12 @@ void EvacuationVerifier::VerifyEvacuation(NewSpace* space) {
void EvacuationVerifier::VerifyEvacuation(PagedSpace* space) { void EvacuationVerifier::VerifyEvacuation(PagedSpace* space) {
for (Page* p : *space) { for (Page* p : *space) {
if (p->IsEvacuationCandidate()) continue; if (p->IsEvacuationCandidate()) continue;
if (p->Contains(space->top())) if (p->Contains(space->top())) {
CodePageMemoryModificationScope memory_modification_scope(p);
heap_->CreateFillerObjectAt( heap_->CreateFillerObjectAt(
space->top(), static_cast<int>(space->limit() - space->top()), space->top(), static_cast<int>(space->limit() - space->top()),
ClearRecordedSlots::kNo); ClearRecordedSlots::kNo);
}
VerifyEvacuationOnPage(p->area_start(), p->area_end()); VerifyEvacuationOnPage(p->area_start(), p->area_end());
} }
} }
...@@ -2763,6 +2764,7 @@ class RememberedSetUpdatingItem : public UpdatingItem { ...@@ -2763,6 +2764,7 @@ class RememberedSetUpdatingItem : public UpdatingItem {
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.gc"),
"RememberedSetUpdatingItem::Process"); "RememberedSetUpdatingItem::Process");
base::LockGuard<base::Mutex> guard(chunk_->mutex()); base::LockGuard<base::Mutex> guard(chunk_->mutex());
CodePageMemoryModificationScope memory_modification_scope(chunk_);
UpdateUntypedPointers(); UpdateUntypedPointers();
UpdateTypedPointers(); UpdateTypedPointers();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment