[heap] Remove obsolete Heap::sweep_generation field.
authormstarzinger <mstarzinger@chromium.org>
Wed, 19 Aug 2015 16:09:40 +0000 (09:09 -0700)
committerCommit bot <commit-bot@chromium.org>
Wed, 19 Aug 2015 16:09:55 +0000 (16:09 +0000)
R=mlippautz@chromium.org

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

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

src/heap/heap.cc
src/heap/heap.h
src/heap/mark-compact.cc

index 6e6da98..0da371e 100644 (file)
@@ -71,7 +71,6 @@ Heap::Heap()
       maximum_committed_(0),
       survived_since_last_expansion_(0),
       survived_last_scavenge_(0),
-      sweep_generation_(0),
       always_allocate_scope_depth_(0),
       contexts_disposed_(0),
       global_ic_age_(0),
@@ -1208,7 +1207,6 @@ bool Heap::PerformGarbageCollection(
     UpdateOldGenerationAllocationCounter();
     // Perform mark-sweep with optional compaction.
     MarkCompact();
-    sweep_generation_++;
     old_gen_exhausted_ = false;
     old_generation_size_configured_ = true;
     // This should be updated before PostGarbageCollectionProcessing, which can
index 4b26b6c..a4e3256 100644 (file)
@@ -949,7 +949,7 @@ class Heap {
   Object* encountered_weak_cells() const { return encountered_weak_cells_; }
 
   // Number of mark-sweeps.
-  unsigned int ms_count() { return ms_count_; }
+  int ms_count() const { return ms_count_; }
 
   // Iterates over all roots in the heap.
   void IterateRoots(ObjectVisitor* v, VisitMode mode);
@@ -1419,9 +1419,6 @@ class Heap {
     return &external_string_table_;
   }
 
-  // Returns the current sweep generation.
-  int sweep_generation() { return sweep_generation_; }
-
   bool concurrent_sweeping_enabled() { return concurrent_sweeping_enabled_; }
 
   inline Isolate* isolate();
@@ -1702,9 +1699,6 @@ class Heap {
   // ... and since the last scavenge.
   int survived_last_scavenge_;
 
-  // For keeping track on when to flush RegExp code.
-  int sweep_generation_;
-
   int always_allocate_scope_depth_;
 
   // For keeping track of context disposals.
index 49bf104..6a0c9d5 100644 (file)
@@ -1337,7 +1337,7 @@ class MarkCompactMarkingVisitor
 
       // Set a number in the 0-255 range to guarantee no smi overflow.
       re->SetDataAt(JSRegExp::code_index(is_one_byte),
-                    Smi::FromInt(heap->sweep_generation() & 0xff));
+                    Smi::FromInt(heap->ms_count() & 0xff));
     } else if (code->IsSmi()) {
       int value = Smi::cast(code)->value();
       // The regexp has not been compiled yet or there was a compilation error.
@@ -1347,7 +1347,7 @@ class MarkCompactMarkingVisitor
       }
 
       // Check if we should flush now.
-      if (value == ((heap->sweep_generation() - kRegExpCodeThreshold) & 0xff)) {
+      if (value == ((heap->ms_count() - kRegExpCodeThreshold) & 0xff)) {
         re->SetDataAt(JSRegExp::code_index(is_one_byte),
                       Smi::FromInt(JSRegExp::kUninitializedValue));
         re->SetDataAt(JSRegExp::saved_code_index(is_one_byte),