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

Unified Diff: src/heap.cc

Issue 315553002: Remove non-incremental idle notification handler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 ec058828e664cec507581ffe40db26b9edcbe2a7..dd00f9e8ab0be9561379371bde27120f2a138588 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -114,9 +114,6 @@ Heap::Heap()
store_buffer_(this),
marking_(this),
incremental_marking_(this),
- number_idle_notifications_(0),
- last_idle_notification_gc_count_(0),
- last_idle_notification_gc_count_init_(false),
mark_sweeps_since_idle_round_started_(0),
gc_count_at_last_idle_gc_(0),
scavenges_since_last_idle_round_(kIdleScavengeThreshold),
@@ -4337,7 +4334,7 @@ bool Heap::IdleNotification(int hint) {
}
if (!FLAG_incremental_marking || isolate_->serializer_enabled()) {
- return IdleGlobalGC();
+ return true;
}
// By doing small chunks of GC work in each IdleNotification,
@@ -4394,66 +4391,6 @@ bool Heap::IdleNotification(int hint) {
}
-bool Heap::IdleGlobalGC() {
- static const int kIdlesBeforeScavenge = 4;
- static const int kIdlesBeforeMarkSweep = 7;
- static const int kIdlesBeforeMarkCompact = 8;
- static const int kMaxIdleCount = kIdlesBeforeMarkCompact + 1;
- static const unsigned int kGCsBetweenCleanup = 4;
-
- if (!last_idle_notification_gc_count_init_) {
- last_idle_notification_gc_count_ = gc_count_;
- last_idle_notification_gc_count_init_ = true;
- }
-
- bool uncommit = true;
- bool finished = false;
-
- // Reset the number of idle notifications received when a number of
- // GCs have taken place. This allows another round of cleanup based
- // on idle notifications if enough work has been carried out to
- // provoke a number of garbage collections.
- if (gc_count_ - last_idle_notification_gc_count_ < kGCsBetweenCleanup) {
- number_idle_notifications_ =
- Min(number_idle_notifications_ + 1, kMaxIdleCount);
- } else {
- number_idle_notifications_ = 0;
- last_idle_notification_gc_count_ = gc_count_;
- }
-
- if (number_idle_notifications_ == kIdlesBeforeScavenge) {
- CollectGarbage(NEW_SPACE, "idle notification");
- new_space_.Shrink();
- last_idle_notification_gc_count_ = gc_count_;
- } else if (number_idle_notifications_ == kIdlesBeforeMarkSweep) {
- // Before doing the mark-sweep collections we clear the
- // compilation cache to avoid hanging on to source code and
- // generated code for cached functions.
- isolate_->compilation_cache()->Clear();
-
- CollectAllGarbage(kReduceMemoryFootprintMask, "idle notification");
- new_space_.Shrink();
- last_idle_notification_gc_count_ = gc_count_;
-
- } else if (number_idle_notifications_ == kIdlesBeforeMarkCompact) {
- CollectAllGarbage(kReduceMemoryFootprintMask, "idle notification");
- new_space_.Shrink();
- last_idle_notification_gc_count_ = gc_count_;
- number_idle_notifications_ = 0;
- finished = true;
- } else if (number_idle_notifications_ > kIdlesBeforeMarkCompact) {
- // If we have received more than kIdlesBeforeMarkCompact idle
- // notifications we do not perform any cleanup because we don't
- // expect to gain much by doing so.
- finished = true;
- }
-
- if (uncommit) UncommitFromSpace();
-
- return finished;
-}
-
-
#ifdef DEBUG
void Heap::Print() {
« 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