diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc index 2282075445..813b9219bf 100644 --- a/src/extensions/gc-extension.cc +++ b/src/extensions/gc-extension.cc @@ -43,7 +43,7 @@ v8::Handle GCExtension::GC(const v8::Arguments& args) { if (args[0]->BooleanValue()) { HEAP->CollectGarbage(NEW_SPACE, "gc extension"); } else { - HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask, "gc extension"); + HEAP->CollectAllGarbage(Heap::kNoGCFlags, "gc extension"); } return v8::Undefined(); } diff --git a/src/heap.cc b/src/heap.cc index b31564f363..ff791d8338 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -5323,7 +5323,8 @@ bool Heap::IdleNotification(int hint) { AgeInlineCaches(); } int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); - if (hint >= mark_sweep_time && incremental_marking()->IsStopped()) { + if (hint >= mark_sweep_time && !FLAG_expose_gc && + incremental_marking()->IsStopped()) { HistogramTimerScope scope(isolate_->counters()->gc_context()); CollectAllGarbage(kReduceMemoryFootprintMask, "idle notification: contexts disposed"); @@ -5338,7 +5339,7 @@ bool Heap::IdleNotification(int hint) { return false; } - if (!FLAG_incremental_marking || Serializer::enabled()) { + if (!FLAG_incremental_marking || FLAG_expose_gc || Serializer::enabled()) { return IdleGlobalGC(); } diff --git a/src/incremental-marking.cc b/src/incremental-marking.cc index 3030bdf8ca..1457ee3094 100644 --- a/src/incremental-marking.cc +++ b/src/incremental-marking.cc @@ -491,7 +491,8 @@ bool IncrementalMarking::WorthActivating() { static const intptr_t kActivationThreshold = 0; #endif - return FLAG_incremental_marking && + return !FLAG_expose_gc && + FLAG_incremental_marking && !Serializer::enabled() && heap_->PromotedSpaceSizeOfObjects() > kActivationThreshold; }