Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 4e4f04a11293e71b330eba36293406c69c8e628d..05a7db2405cbeaaedb49349ee66f30bfcdf5e8d3 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -4612,23 +4612,13 @@ bool Heap::TryFinalizeIdleIncrementalMarking( |
} |
-GCIdleTimeHandler::HeapState Heap::ComputeHeapState(bool reduce_memory) { |
+GCIdleTimeHandler::HeapState Heap::ComputeHeapState() { |
GCIdleTimeHandler::HeapState heap_state; |
heap_state.contexts_disposed = contexts_disposed_; |
heap_state.contexts_disposal_rate = |
tracer()->ContextDisposalRateInMilliseconds(); |
heap_state.size_of_objects = static_cast<size_t>(SizeOfObjects()); |
heap_state.incremental_marking_stopped = incremental_marking()->IsStopped(); |
- // TODO(ulan): Start incremental marking only for large heaps. |
- intptr_t limit = old_generation_allocation_limit_; |
- if (reduce_memory) { |
- limit = idle_old_generation_allocation_limit_; |
- } |
- |
- heap_state.can_start_incremental_marking = |
- incremental_marking()->CanBeActivated() && |
- HeapIsFullEnoughToStartIncrementalMarking(limit) && |
- !mark_compact_collector()->sweeping_in_progress(); |
heap_state.sweeping_in_progress = |
mark_compact_collector()->sweeping_in_progress(); |
heap_state.sweeping_completed = |
@@ -4648,6 +4638,16 @@ GCIdleTimeHandler::HeapState Heap::ComputeHeapState(bool reduce_memory) { |
tracer()->NewSpaceAllocationThroughputInBytesPerMillisecond(); |
heap_state.current_new_space_allocation_throughput_in_bytes_per_ms = |
tracer()->CurrentNewSpaceAllocationThroughputInBytesPerMillisecond(); |
+ // TODO(ulan): Start incremental marking only for large heaps. |
ulan
2015/05/22 12:04:13
We can remove the todo.
Hannes Payer (out of office)
2015/05/22 12:19:46
Done.
|
+ intptr_t limit = old_generation_allocation_limit_; |
+ if (HasLowAllocationRate( |
+ heap_state.current_new_space_allocation_throughput_in_bytes_per_ms)) { |
+ limit = idle_old_generation_allocation_limit_; |
+ } |
+ heap_state.can_start_incremental_marking = |
+ incremental_marking()->CanBeActivated() && |
+ HeapIsFullEnoughToStartIncrementalMarking(limit) && |
+ !mark_compact_collector()->sweeping_in_progress(); |
return heap_state; |
} |
@@ -4783,7 +4783,6 @@ bool Heap::IdleNotification(int idle_time_in_ms) { |
bool Heap::IdleNotification(double deadline_in_seconds) { |
CHECK(HasBeenSetUp()); |
- static const double kLastGCTimeTreshold = 1000; |
double deadline_in_ms = |
deadline_in_seconds * |
static_cast<double>(base::Time::kMillisecondsPerSecond); |
@@ -4794,14 +4793,12 @@ bool Heap::IdleNotification(double deadline_in_seconds) { |
bool is_long_idle_notification = |
static_cast<size_t>(idle_time_in_ms) > |
GCIdleTimeHandler::kMaxFrameRenderingIdleTime; |
- bool has_low_gc_activity = (start_ms - last_gc_time_) > kLastGCTimeTreshold; |
if (is_long_idle_notification) { |
tracer()->SampleNewSpaceAllocation(start_ms, NewSpaceAllocationCounter()); |
} |
- GCIdleTimeHandler::HeapState heap_state = |
- ComputeHeapState(is_long_idle_notification && has_low_gc_activity); |
+ GCIdleTimeHandler::HeapState heap_state = ComputeHeapState(); |
GCIdleTimeAction action = |
gc_idle_time_handler_.Compute(idle_time_in_ms, heap_state); |