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

Unified Diff: src/heap.cc

Issue 15737007: Make more GCs in idle notification handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Correctly finish idle round. Created 7 years, 7 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 587e2f161a9b1bbbf0fd9ecfdcba84871968f335..50b5a34baa74ebd181dda5d26f5b909a08bae02f 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -152,7 +152,6 @@ Heap::Heap()
last_idle_notification_gc_count_(0),
last_idle_notification_gc_count_init_(false),
mark_sweeps_since_idle_round_started_(0),
- ms_count_at_last_idle_notification_(0),
gc_count_at_last_idle_gc_(0),
scavenges_since_last_idle_round_(kIdleScavengeThreshold),
gcs_since_last_deopt_(0),
@@ -5770,6 +5769,7 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) {
uncommit = true;
}
CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental");
+ mark_sweeps_since_idle_round_started_++;
gc_count_at_last_idle_gc_ = gc_count_;
if (uncommit) {
new_space_.Shrink();
@@ -5845,18 +5845,9 @@ bool Heap::IdleNotification(int hint) {
}
}
- int new_mark_sweeps = ms_count_ - ms_count_at_last_idle_notification_;
- mark_sweeps_since_idle_round_started_ += new_mark_sweeps;
- ms_count_at_last_idle_notification_ = ms_count_;
-
int remaining_mark_sweeps = kMaxMarkSweepsInIdleRound -
mark_sweeps_since_idle_round_started_;
- if (remaining_mark_sweeps <= 0) {
- FinishIdleRound();
- return true;
- }
-
if (incremental_marking()->IsStopped()) {
// If there are no more than two GCs left in this idle round and we are
// allowed to do a full GC, then make those GCs full in order to compact
@@ -5866,6 +5857,7 @@ bool Heap::IdleNotification(int hint) {
if (remaining_mark_sweeps <= 2 && hint >= kMinHintForFullGC) {
CollectAllGarbage(kReduceMemoryFootprintMask,
"idle notification: finalize idle round");
+ mark_sweeps_since_idle_round_started_++;
} else {
incremental_marking()->Start();
}
@@ -5873,6 +5865,12 @@ bool Heap::IdleNotification(int hint) {
if (!incremental_marking()->IsStopped()) {
AdvanceIdleIncrementalMarking(step_size);
}
+
+ if (mark_sweeps_since_idle_round_started_ >= kMaxMarkSweepsInIdleRound) {
+ FinishIdleRound();
+ return true;
+ }
+
return false;
}
« no previous file with comments | « src/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698