Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/heap/heap.cc

Issue 727323004: Distinguish beween final incremental mark-compact and full mark-compact event in IdleNotification. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 4356 matching lines...) Expand 10 before | Expand all | Expand 10 after
4367 gc_count_at_last_idle_gc_ = gc_count_; 4367 gc_count_at_last_idle_gc_ = gc_count_;
4368 if (uncommit) { 4368 if (uncommit) {
4369 new_space_.Shrink(); 4369 new_space_.Shrink();
4370 UncommitFromSpace(); 4370 UncommitFromSpace();
4371 } 4371 }
4372 } 4372 }
4373 4373
4374 4374
4375 void Heap::TryFinalizeIdleIncrementalMarking( 4375 void Heap::TryFinalizeIdleIncrementalMarking(
4376 size_t idle_time_in_ms, size_t size_of_objects, 4376 size_t idle_time_in_ms, size_t size_of_objects,
4377 size_t mark_compact_speed_in_bytes_per_ms) { 4377 size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
4378 if (incremental_marking()->IsComplete() || 4378 if (incremental_marking()->IsComplete() ||
4379 (mark_compact_collector()->IsMarkingDequeEmpty() && 4379 (mark_compact_collector()->IsMarkingDequeEmpty() &&
4380 gc_idle_time_handler_.ShouldDoMarkCompact( 4380 gc_idle_time_handler_.ShouldDoFinalIncrementalMarkCompact(
4381 idle_time_in_ms, size_of_objects, 4381 idle_time_in_ms, size_of_objects,
4382 mark_compact_speed_in_bytes_per_ms))) { 4382 final_incremental_mark_compact_speed_in_bytes_per_ms))) {
4383 IdleMarkCompact("idle notification: finalize incremental"); 4383 IdleMarkCompact("idle notification: finalize incremental");
4384 } 4384 }
4385 } 4385 }
4386 4386
4387 4387
4388 bool Heap::WorthActivatingIncrementalMarking() { 4388 bool Heap::WorthActivatingIncrementalMarking() {
4389 return incremental_marking()->IsStopped() && 4389 return incremental_marking()->IsStopped() &&
4390 incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull(); 4390 incremental_marking()->WorthActivating() && NextGCIsLikelyToBeFull();
4391 } 4391 }
4392 4392
(...skipping 14 matching lines...) Expand all
4407 heap_state.incremental_marking_stopped = incremental_marking()->IsStopped(); 4407 heap_state.incremental_marking_stopped = incremental_marking()->IsStopped();
4408 // TODO(ulan): Start incremental marking only for large heaps. 4408 // TODO(ulan): Start incremental marking only for large heaps.
4409 heap_state.can_start_incremental_marking = 4409 heap_state.can_start_incremental_marking =
4410 incremental_marking()->ShouldActivate() && FLAG_incremental_marking; 4410 incremental_marking()->ShouldActivate() && FLAG_incremental_marking;
4411 heap_state.sweeping_in_progress = 4411 heap_state.sweeping_in_progress =
4412 mark_compact_collector()->sweeping_in_progress(); 4412 mark_compact_collector()->sweeping_in_progress();
4413 heap_state.mark_compact_speed_in_bytes_per_ms = 4413 heap_state.mark_compact_speed_in_bytes_per_ms =
4414 static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond()); 4414 static_cast<size_t>(tracer()->MarkCompactSpeedInBytesPerMillisecond());
4415 heap_state.incremental_marking_speed_in_bytes_per_ms = static_cast<size_t>( 4415 heap_state.incremental_marking_speed_in_bytes_per_ms = static_cast<size_t>(
4416 tracer()->IncrementalMarkingSpeedInBytesPerMillisecond()); 4416 tracer()->IncrementalMarkingSpeedInBytesPerMillisecond());
4417 heap_state.final_incremental_mark_compact_speed_in_bytes_per_ms =
4418 static_cast<size_t>(
4419 tracer()->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond());
4417 heap_state.scavenge_speed_in_bytes_per_ms = 4420 heap_state.scavenge_speed_in_bytes_per_ms =
4418 static_cast<size_t>(tracer()->ScavengeSpeedInBytesPerMillisecond()); 4421 static_cast<size_t>(tracer()->ScavengeSpeedInBytesPerMillisecond());
4419 heap_state.used_new_space_size = new_space_.Size(); 4422 heap_state.used_new_space_size = new_space_.Size();
4420 heap_state.new_space_capacity = new_space_.Capacity(); 4423 heap_state.new_space_capacity = new_space_.Capacity();
4421 heap_state.new_space_allocation_throughput_in_bytes_per_ms = 4424 heap_state.new_space_allocation_throughput_in_bytes_per_ms =
4422 static_cast<size_t>( 4425 static_cast<size_t>(
4423 tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond()); 4426 tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond());
4424 4427
4425 GCIdleTimeAction action = 4428 GCIdleTimeAction action =
4426 gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state); 4429 gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state);
(...skipping 10 matching lines...) Expand all
4437 } 4440 }
4438 incremental_marking()->Step(action.parameter, 4441 incremental_marking()->Step(action.parameter,
4439 IncrementalMarking::NO_GC_VIA_STACK_GUARD, 4442 IncrementalMarking::NO_GC_VIA_STACK_GUARD,
4440 IncrementalMarking::FORCE_MARKING, 4443 IncrementalMarking::FORCE_MARKING,
4441 IncrementalMarking::DO_NOT_FORCE_COMPLETION); 4444 IncrementalMarking::DO_NOT_FORCE_COMPLETION);
4442 actual_time_in_ms = static_cast<int>(timer.Elapsed().InMilliseconds()); 4445 actual_time_in_ms = static_cast<int>(timer.Elapsed().InMilliseconds());
4443 int remaining_idle_time_in_ms = idle_time_in_ms - actual_time_in_ms; 4446 int remaining_idle_time_in_ms = idle_time_in_ms - actual_time_in_ms;
4444 if (remaining_idle_time_in_ms > 0) { 4447 if (remaining_idle_time_in_ms > 0) {
4445 TryFinalizeIdleIncrementalMarking( 4448 TryFinalizeIdleIncrementalMarking(
4446 remaining_idle_time_in_ms, heap_state.size_of_objects, 4449 remaining_idle_time_in_ms, heap_state.size_of_objects,
4447 heap_state.mark_compact_speed_in_bytes_per_ms); 4450 heap_state.final_incremental_mark_compact_speed_in_bytes_per_ms);
4448 } 4451 }
4449 break; 4452 break;
4450 } 4453 }
4451 case DO_FULL_GC: { 4454 case DO_FULL_GC: {
4452 HistogramTimerScope scope(isolate_->counters()->gc_context()); 4455 HistogramTimerScope scope(isolate_->counters()->gc_context());
4453 if (contexts_disposed_) { 4456 if (contexts_disposed_) {
4454 CollectAllGarbage(kNoGCFlags, "idle notification: contexts disposed"); 4457 CollectAllGarbage(kNoGCFlags, "idle notification: contexts disposed");
4455 gc_idle_time_handler_.NotifyIdleMarkCompact(); 4458 gc_idle_time_handler_.NotifyIdleMarkCompact();
4456 gc_count_at_last_idle_gc_ = gc_count_; 4459 gc_count_at_last_idle_gc_ = gc_count_;
4457 } else { 4460 } else {
(...skipping 1853 matching lines...) Expand 10 before | Expand all | Expand 10 after
6311 static_cast<int>(object_sizes_last_time_[index])); 6314 static_cast<int>(object_sizes_last_time_[index]));
6312 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) 6315 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT)
6313 #undef ADJUST_LAST_TIME_OBJECT_COUNT 6316 #undef ADJUST_LAST_TIME_OBJECT_COUNT
6314 6317
6315 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 6318 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
6316 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 6319 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
6317 ClearObjectStats(); 6320 ClearObjectStats();
6318 } 6321 }
6319 } 6322 }
6320 } // namespace v8::internal 6323 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/gc-tracer.cc ('k') | test/unittests/heap/gc-idle-time-handler-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698