Reviewers: ulan,
Message:
This simplifies the code, but the idle limit may get removed soon.
Description:
Idle old generation limit is used when allocation rate is low.
BUG=
Please review this at https://codereview.chromium.org/1153763003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+13, -16 lines):
M src/heap/heap.h
M src/heap/heap.cc
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.
+ 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);
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index
742aa4ba89c0c3535e7a3c7d8ab0b473479e2544..d398599f1d591faebe488d1adb56f6965c3422e3
100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -2135,7 +2135,7 @@ class Heap {
double idle_time_in_ms, size_t size_of_objects,
size_t mark_compact_speed_in_bytes_per_ms);
- GCIdleTimeHandler::HeapState ComputeHeapState(bool reduce_memory);
+ GCIdleTimeHandler::HeapState ComputeHeapState();
bool PerformIdleTimeAction(GCIdleTimeAction action,
GCIdleTimeHandler::HeapState heap_state,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.