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

Unified Diff: src/heap.h

Issue 6542047: Basic implementation of incremental marking. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Created 9 years, 10 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
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 240ed79d91586d260de7a777283ee211802fc0ee..484929ae303d0f3c6db0f4d2e7ffabc5c2e84ea4 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1119,6 +1119,24 @@ class Heap : public AllStatic {
survived_since_last_expansion_ += survived;
}
+ static inline bool NextGCIsLikelyToBeFull() {
+ intptr_t total_promoted =
+ PromotedSpaceSize() + PromotedExternalMemorySize();
+
+ intptr_t adjusted_promotion_limit =
+ old_gen_promotion_limit_ - new_space_.Capacity();
+
+ if (total_promoted >= adjusted_promotion_limit) return true;
+
+ intptr_t adjusted_allocation_limit =
+ old_gen_allocation_limit_ - new_space_.Capacity() / 5;
+
+ if (PromotedSpaceSize() >= adjusted_allocation_limit) return true;
+
+ return false;
+ }
+
+
static void UpdateNewSpaceReferencesInExternalStringTable(
ExternalStringTableUpdaterCallback updater_func);

Powered by Google App Engine
This is Rietveld 408576698