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

Unified Diff: src/heap.h

Issue 2809032: Take survival rates of young objects into account when choosing old generation limits. (Closed)
Patch Set: throttle down Created 10 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.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index a8f8c343950239688ac801d237255ba0834abf8c..e4c59aa5078223580ac939089cdc75c6aa7c1979 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1005,6 +1005,7 @@ class Heap : public AllStatic {
static void CheckNewSpaceExpansionCriteria();
static inline void IncrementYoungSurvivorsCounter(int survived) {
+ young_survivors_after_last_gc_ = survived;
survived_since_last_expansion_ += survived;
}
@@ -1272,6 +1273,56 @@ class Heap : public AllStatic {
// be replaced with a lazy compilable version.
static void FlushCode();
+ static void UpdateSurvivalRateTrend(int start_new_space_size);
+
+ enum SurvivalRateTrend { INCREASING, STABLE, DECREASING, FLUCTUATING };
+
+ static const int kYoungSurvivalRateThreshold = 90;
+ static const int kYoungSurvivalRateAllowedDeviation = 15;
+
+ static int young_survivors_after_last_gc_;
+ static int high_survival_rate_period_length_;
+ static int survival_rate_;
+ static SurvivalRateTrend previous_survival_rate_trend_;
+ static SurvivalRateTrend survival_rate_trend_;
+ static bool bumped_old_gen_limits_;
+
+ static void set_survival_rate_trend(SurvivalRateTrend survival_rate_trend) {
+ ASSERT(survival_rate_trend != FLUCTUATING);
+ previous_survival_rate_trend_ = survival_rate_trend_;
+ survival_rate_trend_ = survival_rate_trend;
+ }
+
+ static 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_;
+ }
+ }
+
+ static bool IsStableOrIncreasingSurvivalTrend() {
+ switch (survival_rate_trend()) {
+ case STABLE:
+ case INCREASING:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ static bool IsIncreasingSurvivalTrend() {
+ return survival_rate_trend() == INCREASING;
+ }
+
+ static bool IsHighSurvivalRate() {
+ return high_survival_rate_period_length_ > 0;
+ }
+
static const int kInitialSymbolTableSize = 2048;
static const int kInitialEvalCacheSize = 64;
« no previous file with comments | « no previous file | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698