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

Unified Diff: src/heap.h

Issue 9813019: Start incremental marking only if there are enough promoted objects since the last GC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 9 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 672b490ff479ea8e09e0293aef56694d9a3c34c2..b1c805e167676d75f8bde1d2faa8db7e98f57195 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1337,6 +1337,10 @@ class Heap {
return PromotedSpaceSize() + PromotedExternalMemorySize();
}
+ inline intptr_t PromotedTotalSizeOfObjects() {
+ return PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize();
+ }
+
// True if we have reached the allocation limit in the old generation that
// should force the next GC (caused normally) to be a full one.
inline bool OldGenerationPromotionLimitReached() {
@@ -1440,8 +1444,15 @@ class Heap {
}
inline bool NextGCIsLikelyToBeFull() {
+ const int kPromotionFraction = 8;
+
if (FLAG_gc_global) return true;
+ intptr_t promoted_at_gc = total_promoted_at_last_old_space_gc_;
+ intptr_t promoted_since_gc = PromotedTotalSizeOfObjects() - promoted_at_gc;
+
+ if (promoted_since_gc < promoted_at_gc / kPromotionFraction) return false;
+
intptr_t total_promoted = PromotedTotalSize();
intptr_t adjusted_promotion_limit =
@@ -1690,6 +1701,8 @@ class Heap {
// Used to adjust the limits that control the timing of the next GC.
intptr_t size_of_old_gen_at_last_old_space_gc_;
+ intptr_t total_promoted_at_last_old_space_gc_;
+
// Limit on the amount of externally allocated memory allowed
// between global GCs. If reached a global GC is forced.
intptr_t external_allocation_limit_;
« 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