| Index: src/heap/incremental-marking.cc
|
| diff --git a/src/heap/incremental-marking.cc b/src/heap/incremental-marking.cc
|
| index 3e5e6c0697cd505bf49880d407891ef8f938458a..e900d26d156dcef83a3e659033d1194d88b7e00b 100644
|
| --- a/src/heap/incremental-marking.cc
|
| +++ b/src/heap/incremental-marking.cc
|
| @@ -546,6 +546,12 @@ static void PatchIncrementalMarkingRecordWriteStubs(
|
| }
|
|
|
|
|
| +static void IncrementalMarkingStepCallback(int bytes_allocated, void* arg) {
|
| + auto im = static_cast<IncrementalMarking*>(arg);
|
| + im->Step(bytes_allocated, IncrementalMarking::GC_VIA_STACK_GUARD);
|
| +}
|
| +
|
| +
|
| void IncrementalMarking::Start(const char* reason) {
|
| if (FLAG_trace_incremental_marking) {
|
| PrintF("[IncrementalMarking] Start (%s)\n",
|
| @@ -569,7 +575,9 @@ void IncrementalMarking::Start(const char* reason) {
|
| state_ = SWEEPING;
|
| }
|
|
|
| - heap_->LowerInlineAllocationLimit(kAllocatedThreshold);
|
| + heap_->new_space()->AddInlineAllocationObserver(
|
| + kAllocatedThreshold, IncrementalMarkingStepCallback, this);
|
| +
|
| incremental_marking_job()->Start(heap_);
|
| }
|
|
|
| @@ -821,7 +829,9 @@ void IncrementalMarking::Stop() {
|
| if (FLAG_trace_incremental_marking) {
|
| PrintF("[IncrementalMarking] Stopping.\n");
|
| }
|
| - heap_->ResetInlineAllocationLimit();
|
| + heap_->new_space()->RemoveInlineAllocationObserver(
|
| + IncrementalMarkingStepCallback);
|
| +
|
| IncrementalMarking::set_should_hurry(false);
|
| ResetStepCounters();
|
| if (IsMarking()) {
|
| @@ -849,7 +859,8 @@ void IncrementalMarking::Finalize() {
|
| Hurry();
|
| state_ = STOPPED;
|
| is_compacting_ = false;
|
| - heap_->ResetInlineAllocationLimit();
|
| + heap_->new_space()->RemoveInlineAllocationObserver(
|
| + IncrementalMarkingStepCallback);
|
| IncrementalMarking::set_should_hurry(false);
|
| ResetStepCounters();
|
| PatchIncrementalMarkingRecordWriteStubs(heap_,
|
|
|