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

Unified Diff: src/heap/heap.cc

Issue 1217813012: GC. Delay/avoid entering high promotion mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rename some variables with long names 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 | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 6039bdb4c6ba64d3d47b7bd9f527c1e9e460bae2..1dba3fb3df5d51d0985be373026bb5ce7c472d6e 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -117,6 +117,7 @@ Heap::Heap()
total_regexp_code_generated_(0),
tracer_(this),
new_space_high_promotion_mode_active_(false),
+ gathering_lifetime_feedback_(0),
high_survival_rate_period_length_(0),
promoted_objects_size_(0),
low_survival_rate_period_length_(0),
@@ -1253,7 +1254,9 @@ bool Heap::PerformGarbageCollection(
// When pretenuring is collecting new feedback, we do not shrink the new space
// right away.
- if (!deopted) {
+ if (deopted) {
+ RecordDeoptForPretenuring();
+ } else {
ConfigureNewGenerationSize();
}
ConfigureInitialOldGenerationSize();
@@ -2635,6 +2638,8 @@ void Heap::ConfigureInitialOldGenerationSize() {
void Heap::ConfigureNewGenerationSize() {
+ bool still_gathering_lifetime_data = gathering_lifetime_feedback_ != 0;
+ if (gathering_lifetime_feedback_ != 0) gathering_lifetime_feedback_--;
if (!new_space_high_promotion_mode_active_ &&
new_space_.TotalCapacity() == new_space_.MaximumCapacity() &&
IsStableOrIncreasingSurvivalTrend() && IsHighSurvivalRate()) {
@@ -2642,10 +2647,18 @@ void Heap::ConfigureNewGenerationSize() {
// maximum capacity indicates that most objects will be promoted.
// To decrease scavenger pauses and final mark-sweep pauses, we
// have to limit maximal capacity of the young generation.
- new_space_high_promotion_mode_active_ = true;
- if (FLAG_trace_gc) {
- PrintPID("Limited new space size due to high promotion rate: %d MB\n",
- new_space_.InitialTotalCapacity() / MB);
+ if (still_gathering_lifetime_data) {
+ if (FLAG_trace_gc) {
+ PrintPID(
+ "Postpone entering high promotion mode as optimized pretenuring "
+ "code is still being generated\n");
+ }
+ } else {
+ new_space_high_promotion_mode_active_ = true;
+ if (FLAG_trace_gc) {
+ PrintPID("Limited new space size due to high promotion rate: %d MB\n",
+ new_space_.InitialTotalCapacity() / MB);
+ }
}
} else if (new_space_high_promotion_mode_active_ &&
IsStableOrDecreasingSurvivalTrend() && IsLowSurvivalRate()) {
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698