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

Unified Diff: src/heap/gc-idle-time-handler.h

Issue 1071503002: Version 4.3.61.2 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
Patch Set: Created 5 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-version.h ('k') | src/heap/gc-idle-time-handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/gc-idle-time-handler.h
diff --git a/src/heap/gc-idle-time-handler.h b/src/heap/gc-idle-time-handler.h
index 6a39b78aaa2fcc24fd5210236f177bf0f9fffc14..f43576f57c90af70a8fc24f77839dae462310fa2 100644
--- a/src/heap/gc-idle-time-handler.h
+++ b/src/heap/gc-idle-time-handler.h
@@ -138,6 +138,11 @@ class GCIdleTimeHandler {
static const size_t kMinTimeForOverApproximatingWeakClosureInMs;
+ // Number of times we will return a Nothing action per Idle round despite
+ // having idle time available before we returning a Done action to ensure we
+ // don't keep scheduling idle tasks and making no progress.
+ static const int kMaxNoProgressIdleTimesPerIdleRound = 10;
+
class HeapState {
public:
void Print();
@@ -159,7 +164,8 @@ class GCIdleTimeHandler {
GCIdleTimeHandler()
: mark_compacts_since_idle_round_started_(0),
- scavenges_since_last_idle_round_(0) {}
+ scavenges_since_last_idle_round_(0),
+ idle_times_which_made_no_progress_since_last_idle_round_(0) {}
GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state);
@@ -203,7 +209,12 @@ class GCIdleTimeHandler {
size_t new_space_allocation_throughput_in_bytes_per_ms);
private:
- void StartIdleRound() { mark_compacts_since_idle_round_started_ = 0; }
+ GCIdleTimeAction NothingOrDone();
+
+ void StartIdleRound() {
+ mark_compacts_since_idle_round_started_ = 0;
+ idle_times_which_made_no_progress_since_last_idle_round_ = 0;
+ }
bool IsMarkCompactIdleRoundFinished() {
return mark_compacts_since_idle_round_started_ ==
kMaxMarkCompactsInIdleRound;
@@ -214,6 +225,7 @@ class GCIdleTimeHandler {
int mark_compacts_since_idle_round_started_;
int scavenges_since_last_idle_round_;
+ int idle_times_which_made_no_progress_since_last_idle_round_;
DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler);
};
« no previous file with comments | « include/v8-version.h ('k') | src/heap/gc-idle-time-handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698