Commit 5918a23a authored by Ali Ijaz Sheikh's avatar Ali Ijaz Sheikh Committed by Commit Bot

[heap] MinorMC: pause observers before toggling gc state

Bug: v8:7407
Change-Id: Icb13921872a9e41dced3ae95ff37ddf72ae30568
Reviewed-on: https://chromium-review.googlesource.com/902009Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#51101}
parent f62356e0
...@@ -1816,12 +1816,12 @@ void Heap::MarkCompact() { ...@@ -1816,12 +1816,12 @@ void Heap::MarkCompact() {
void Heap::MinorMarkCompact() { void Heap::MinorMarkCompact() {
DCHECK(FLAG_minor_mc); DCHECK(FLAG_minor_mc);
PauseAllocationObserversScope pause_observers(this);
SetGCState(MINOR_MARK_COMPACT); SetGCState(MINOR_MARK_COMPACT);
LOG(isolate_, ResourceEvent("MinorMarkCompact", "begin")); LOG(isolate_, ResourceEvent("MinorMarkCompact", "begin"));
TRACE_GC(tracer(), GCTracer::Scope::MINOR_MC); TRACE_GC(tracer(), GCTracer::Scope::MINOR_MC);
AlwaysAllocateScope always_allocate(isolate()); AlwaysAllocateScope always_allocate(isolate());
PauseAllocationObserversScope pause_observers(this);
IncrementalMarking::PauseBlackAllocationScope pause_black_allocation( IncrementalMarking::PauseBlackAllocationScope pause_black_allocation(
incremental_marking()); incremental_marking());
CodeSpaceMemoryModificationScope code_modifcation(this); CodeSpaceMemoryModificationScope code_modifcation(this);
......
...@@ -71,6 +71,8 @@ bool HeapObjectIterator::AdvanceToNextPage() { ...@@ -71,6 +71,8 @@ bool HeapObjectIterator::AdvanceToNextPage() {
PauseAllocationObserversScope::PauseAllocationObserversScope(Heap* heap) PauseAllocationObserversScope::PauseAllocationObserversScope(Heap* heap)
: heap_(heap) { : heap_(heap) {
DCHECK_EQ(heap->gc_state(), Heap::NOT_IN_GC);
for (SpaceIterator it(heap_); it.has_next();) { for (SpaceIterator it(heap_); it.has_next();) {
it.next()->PauseAllocationObservers(); it.next()->PauseAllocationObservers();
} }
......
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