Reset old generation limit on main frame context disposal.
authorhpayer <hpayer@chromium.org>
Mon, 22 Dec 2014 15:40:30 +0000 (07:40 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 22 Dec 2014 15:40:36 +0000 (15:40 +0000)
BUG=

Review URL: https://codereview.chromium.org/815933005

Cr-Commit-Position: refs/heads/master@{#25930}

src/heap/gc-tracer.cc
src/heap/gc-tracer.h
src/heap/heap.cc

index 0bd12cd..a35872d 100644 (file)
@@ -587,5 +587,8 @@ double GCTracer::AverageSurvivalRate() const {
 bool GCTracer::SurvivalEventsRecorded() const {
   return survival_events_.size() > 0;
 }
+
+
+void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); }
 }
 }  // namespace v8::internal
index a2e4bc2..528eb52 100644 (file)
@@ -71,6 +71,11 @@ class RingBuffer {
     elements_[begin_] = element;
   }
 
+  void reset() {
+    begin_ = 0;
+    end_ = 0;
+  }
+
  private:
   T elements_[MAX_SIZE + 1];
   size_t begin_;
@@ -390,6 +395,9 @@ class GCTracer {
   // Returns true if at least one survival event was recorded.
   bool SurvivalEventsRecorded() const;
 
+  // Discard all recorded survival events.
+  void ResetSurvivalEvents();
+
  private:
   // Print one detailed trace line in name=value format.
   // TODO(ernstm): Move to Heap.
index 86d48a2..cf67dab 100644 (file)
@@ -864,7 +864,10 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
 
 
 int Heap::NotifyContextDisposed(bool dependant_context) {
-  // TODO(hpayer): Reset heap shrinking if dependant_context is false.
+  if (!dependant_context) {
+    tracer()->ResetSurvivalEvents();
+    old_generation_size_configured_ = false;
+  }
   if (isolate()->concurrent_recompilation_enabled()) {
     // Flush the queued recompilation tasks.
     isolate()->optimizing_compiler_thread()->Flush();