X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fv8%2Fsrc%2Fheap%2Fheap.cc;h=7dfa7d57b011c7de73ec415849c2e7b9e0237613;hb=f5180d0a4dfe13ef74567dc9aa75047c1a9cd6de;hp=7a1319217653cb7fc3e553a8b337e48710d1c36b;hpb=669bbc0a54393464248e6bac22558cda42a9a350;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/v8/src/heap/heap.cc b/src/v8/src/heap/heap.cc index 7a13192..7dfa7d5 100644 --- a/src/v8/src/heap/heap.cc +++ b/src/v8/src/heap/heap.cc @@ -1548,6 +1548,8 @@ void Heap::Scavenge() { LOG(isolate_, ResourceEvent("scavenge", "end")); gc_state_ = NOT_IN_GC; + + gc_idle_time_handler_.NotifyScavenge(); } @@ -4305,25 +4307,29 @@ void Heap::MakeHeapIterable() { } +void Heap::IdleMarkCompact(const char* message) { + bool uncommit = false; + if (gc_count_at_last_idle_gc_ == gc_count_) { + // No GC since the last full GC, the mutator is probably not active. + isolate_->compilation_cache()->Clear(); + uncommit = true; + } + CollectAllGarbage(kReduceMemoryFootprintMask, message); + gc_idle_time_handler_.NotifyIdleMarkCompact(); + gc_count_at_last_idle_gc_ = gc_count_; + if (uncommit) { + new_space_.Shrink(); + UncommitFromSpace(); + } +} + + void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { incremental_marking()->Step(step_size, IncrementalMarking::NO_GC_VIA_STACK_GUARD, true); if (incremental_marking()->IsComplete()) { - bool uncommit = false; - if (gc_count_at_last_idle_gc_ == gc_count_) { - // No GC since the last full GC, the mutator is probably not active. - isolate_->compilation_cache()->Clear(); - uncommit = true; - } - CollectAllGarbage(kReduceMemoryFootprintMask, - "idle notification: finalize incremental"); - gc_idle_time_handler_.NotifyIdleMarkCompact(); - gc_count_at_last_idle_gc_ = gc_count_; - if (uncommit) { - new_space_.Shrink(); - UncommitFromSpace(); - } + IdleMarkCompact("idle notification: finalize incremental"); } } @@ -4381,11 +4387,14 @@ bool Heap::IdleNotification(int idle_time_in_ms) { break; case DO_FULL_GC: { HistogramTimerScope scope(isolate_->counters()->gc_context()); - const char* message = contexts_disposed_ - ? "idle notification: contexts disposed" - : "idle notification: finalize idle round"; - CollectAllGarbage(kReduceMemoryFootprintMask, message); - gc_idle_time_handler_.NotifyIdleMarkCompact(); + if (contexts_disposed_) { + CollectAllGarbage(kReduceMemoryFootprintMask, + "idle notification: contexts disposed"); + gc_idle_time_handler_.NotifyIdleMarkCompact(); + gc_count_at_last_idle_gc_ = gc_count_; + } else { + IdleMarkCompact("idle notification: finalize idle round"); + } break; } case DO_SCAVENGE: