| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index 6ef3607fc56180c07a424a63dfe63a0b3b8ee661..37eb00485f7ae463aadeb41b3a5d3a6b4143a70b 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -138,7 +138,6 @@ Heap::Heap()
|
| store_buffer_(this),
|
| marking_(this),
|
| incremental_marking_(this),
|
| - gc_count_at_last_idle_gc_(0),
|
| full_codegen_bytes_generated_(0),
|
| crankshaft_codegen_bytes_generated_(0),
|
| new_space_allocation_counter_(0),
|
| @@ -4591,8 +4590,7 @@ GCIdleTimeHandler::HeapState Heap::ComputeHeapState() {
|
|
|
| bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
|
| GCIdleTimeHandler::HeapState heap_state,
|
| - double deadline_in_ms,
|
| - bool is_long_idle_notification) {
|
| + double deadline_in_ms) {
|
| bool result = false;
|
| switch (action.type) {
|
| case DONE:
|
| @@ -4623,7 +4621,7 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
|
| break;
|
| }
|
| case DO_FULL_GC: {
|
| - if (is_long_idle_notification && gc_count_at_last_idle_gc_ == gc_count_) {
|
| + if (action.reduce_memory) {
|
| isolate_->compilation_cache()->Clear();
|
| }
|
| if (contexts_disposed_) {
|
| @@ -4633,7 +4631,6 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
|
| CollectAllGarbage(kReduceMemoryFootprintMask,
|
| "idle notification: finalize idle round");
|
| }
|
| - gc_count_at_last_idle_gc_ = gc_count_;
|
| gc_idle_time_handler_.NotifyIdleMarkCompact();
|
| break;
|
| }
|
| @@ -4653,8 +4650,7 @@ bool Heap::PerformIdleTimeAction(GCIdleTimeAction action,
|
|
|
| void Heap::IdleNotificationEpilogue(GCIdleTimeAction action,
|
| GCIdleTimeHandler::HeapState heap_state,
|
| - double start_ms, double deadline_in_ms,
|
| - bool is_long_idle_notification) {
|
| + double start_ms, double deadline_in_ms) {
|
| double idle_time_in_ms = deadline_in_ms - start_ms;
|
| double current_time = MonotonicallyIncreasingTimeInMs();
|
| last_idle_notification_time_ = current_time;
|
| @@ -4665,15 +4661,6 @@ void Heap::IdleNotificationEpilogue(GCIdleTimeAction action,
|
| isolate()->counters()->gc_idle_time_allotted_in_ms()->AddSample(
|
| static_cast<int>(idle_time_in_ms));
|
|
|
| - if (is_long_idle_notification) {
|
| - int committed_memory = static_cast<int>(CommittedMemory() / KB);
|
| - int used_memory = static_cast<int>(heap_state.size_of_objects / KB);
|
| - isolate()->counters()->aggregated_memory_heap_committed()->AddSample(
|
| - start_ms, committed_memory);
|
| - isolate()->counters()->aggregated_memory_heap_used()->AddSample(
|
| - start_ms, used_memory);
|
| - }
|
| -
|
| if (deadline_difference >= 0) {
|
| if (action.type != DONE && action.type != DO_NOTHING) {
|
| isolate()->counters()->gc_idle_time_limit_undershot()->AddSample(
|
| @@ -4727,25 +4714,18 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
|
| isolate_->counters()->gc_idle_notification());
|
| double start_ms = MonotonicallyIncreasingTimeInMs();
|
| double idle_time_in_ms = deadline_in_ms - start_ms;
|
| - bool is_long_idle_notification =
|
| - static_cast<size_t>(idle_time_in_ms) >
|
| - GCIdleTimeHandler::kMaxFrameRenderingIdleTime;
|
|
|
| - if (is_long_idle_notification) {
|
| - tracer()->SampleAllocation(start_ms, NewSpaceAllocationCounter(),
|
| - OldGenerationAllocationCounter());
|
| - }
|
| + tracer()->SampleAllocation(start_ms, NewSpaceAllocationCounter(),
|
| + OldGenerationAllocationCounter());
|
|
|
| GCIdleTimeHandler::HeapState heap_state = ComputeHeapState();
|
|
|
| GCIdleTimeAction action =
|
| gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);
|
|
|
| - bool result = PerformIdleTimeAction(action, heap_state, deadline_in_ms,
|
| - is_long_idle_notification);
|
| + bool result = PerformIdleTimeAction(action, heap_state, deadline_in_ms);
|
|
|
| - IdleNotificationEpilogue(action, heap_state, start_ms, deadline_in_ms,
|
| - is_long_idle_notification);
|
| + IdleNotificationEpilogue(action, heap_state, start_ms, deadline_in_ms);
|
| return result;
|
| }
|
|
|
|
|