Commit 59799252 authored by hpayer's avatar hpayer Committed by Commit bot

Rename kMaxFrameRenderingIdleTime to kMaxActiveIdleTime and adjust it to the...

Rename kMaxFrameRenderingIdleTime to kMaxActiveIdleTime and adjust it to the currently maximum value of 50ms passed in by the Blink scheduler.

BUG=468692
LOG=n

Review URL: https://codereview.chromium.org/1024543002

Cr-Commit-Position: refs/heads/master@{#27321}
parent 74cf8e01
...@@ -117,7 +117,7 @@ bool GCIdleTimeHandler::ShouldDoScavenge( ...@@ -117,7 +117,7 @@ bool GCIdleTimeHandler::ShouldDoScavenge(
size_t scavenge_speed_in_bytes_per_ms, size_t scavenge_speed_in_bytes_per_ms,
size_t new_space_allocation_throughput_in_bytes_per_ms) { size_t new_space_allocation_throughput_in_bytes_per_ms) {
size_t new_space_allocation_limit = size_t new_space_allocation_limit =
kMaxFrameRenderingIdleTime * scavenge_speed_in_bytes_per_ms; kMaxScheduledIdleTime * scavenge_speed_in_bytes_per_ms;
// If the limit is larger than the new space size, then scavenging used to be // If the limit is larger than the new space size, then scavenging used to be
// really fast. We can take advantage of the whole new space. // really fast. We can take advantage of the whole new space.
...@@ -133,8 +133,7 @@ bool GCIdleTimeHandler::ShouldDoScavenge( ...@@ -133,8 +133,7 @@ bool GCIdleTimeHandler::ShouldDoScavenge(
} else { } else {
// We have to trigger scavenge before we reach the end of new space. // We have to trigger scavenge before we reach the end of new space.
new_space_allocation_limit -= new_space_allocation_limit -=
new_space_allocation_throughput_in_bytes_per_ms * new_space_allocation_throughput_in_bytes_per_ms * kMaxScheduledIdleTime;
kMaxFrameRenderingIdleTime;
} }
if (scavenge_speed_in_bytes_per_ms == 0) { if (scavenge_speed_in_bytes_per_ms == 0) {
...@@ -244,7 +243,7 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms, ...@@ -244,7 +243,7 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms,
// can get rid of this special case and always start incremental marking. // can get rid of this special case and always start incremental marking.
int remaining_mark_sweeps = int remaining_mark_sweeps =
kMaxMarkCompactsInIdleRound - mark_compacts_since_idle_round_started_; kMaxMarkCompactsInIdleRound - mark_compacts_since_idle_round_started_;
if (static_cast<size_t>(idle_time_in_ms) > kMaxFrameRenderingIdleTime && if (static_cast<size_t>(idle_time_in_ms) > kMaxScheduledIdleTime &&
(remaining_mark_sweeps <= 2 || (remaining_mark_sweeps <= 2 ||
!heap_state.can_start_incremental_marking)) { !heap_state.can_start_incremental_marking)) {
return GCIdleTimeAction::FullGC(); return GCIdleTimeAction::FullGC();
......
...@@ -122,8 +122,9 @@ class GCIdleTimeHandler { ...@@ -122,8 +122,9 @@ class GCIdleTimeHandler {
// Number of scavenges that will trigger start of new idle round. // Number of scavenges that will trigger start of new idle round.
static const int kIdleScavengeThreshold; static const int kIdleScavengeThreshold;
// That is the maximum idle time we will have during frame rendering. // This is the maximum scheduled idle time. Note that it can be more than
static const size_t kMaxFrameRenderingIdleTime = 16; // 16 ms when there is currently no rendering going on.
static const size_t kMaxScheduledIdleTime = 50;
// If we haven't recorded any scavenger events yet, we use a conservative // If we haven't recorded any scavenger events yet, we use a conservative
// lower bound for the scavenger speed. // lower bound for the scavenger speed.
......
...@@ -4678,7 +4678,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) { ...@@ -4678,7 +4678,7 @@ bool Heap::IdleNotification(double deadline_in_seconds) {
bool Heap::RecentIdleNotificationHappened() { bool Heap::RecentIdleNotificationHappened() {
return (last_idle_notification_time_ + return (last_idle_notification_time_ +
GCIdleTimeHandler::kMaxFrameRenderingIdleTime) > GCIdleTimeHandler::kMaxScheduledIdleTime) >
MonotonicallyIncreasingTimeInMs(); MonotonicallyIncreasingTimeInMs();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment