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

Unified Diff: src/heap/heap.h

Issue 1175663002: Bring back high promotion mode to shrink young generation size when scavenging latency is high. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 2782ed85acad721a01ff1a57c427b253f5d88312..5a6119bbd3ba3a5e73856b8fa039564b473416fb 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -2112,13 +2112,19 @@ class Heap {
void UpdateSurvivalStatistics(int start_new_space_size);
+ enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
+
static const int kYoungSurvivalRateHighThreshold = 90;
+ static const int kYoungSurvivalRateLowThreshold = 10;
static const int kYoungSurvivalRateAllowedDeviation = 15;
static const int kOldSurvivalRateLowThreshold = 10;
+ bool new_space_high_promotion_mode_active_;
int high_survival_rate_period_length_;
intptr_t promoted_objects_size_;
+ int low_survival_rate_period_length_;
+ double survival_rate_;
double promotion_ratio_;
double promotion_rate_;
intptr_t semi_space_copied_object_size_;
@@ -2134,12 +2140,61 @@ class Heap {
// of the allocation site.
unsigned int maximum_size_scavenges_;
+ SurvivalRateTrend previous_survival_rate_trend_;
+ SurvivalRateTrend survival_rate_trend_;
+
+ void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) {
+ DCHECK(survival_rate_trend != FLUCTUATING);
+ previous_survival_rate_trend_ = survival_rate_trend_;
+ survival_rate_trend_ = survival_rate_trend;
+ }
+
+ SurvivalRateTrend survival_rate_trend() {
+ if (survival_rate_trend_ == STABLE) {
+ return STABLE;
+ } else if (previous_survival_rate_trend_ == STABLE) {
+ return survival_rate_trend_;
+ } else if (survival_rate_trend_ != previous_survival_rate_trend_) {
+ return FLUCTUATING;
+ } else {
+ return survival_rate_trend_;
+ }
+ }
+
+ bool IsStableOrIncreasingSurvivalTrend() {
+ switch (survival_rate_trend()) {
+ case STABLE:
+ case INCREASING:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool IsStableOrDecreasingSurvivalTrend() {
+ switch (survival_rate_trend()) {
+ case STABLE:
+ case DECREASING:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ bool IsIncreasingSurvivalTrend() {
+ return survival_rate_trend() == INCREASING;
+ }
+
+ bool IsLowSurvivalRate() { return low_survival_rate_period_length_ > 0; }
+
// TODO(hpayer): Allocation site pretenuring may make this method obsolete.
// Re-visit incremental marking heuristics.
bool IsHighSurvivalRate() { return high_survival_rate_period_length_ > 0; }
void ConfigureInitialOldGenerationSize();
+ void ConfigureNewGenerationSize();
+
void SelectScavengingVisitorsTable();
bool HasLowAllocationRate(size_t allocaion_rate);
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698