Revision: 3969
Author: [email protected]
Date: Fri Feb 26 03:48:18 2010
Log: - Moved the computation of old space limits to after the mandatory scavenge.
  This reduces the number of mark sweep operations.

Review URL: http://codereview.chromium.org/661175
http://code.google.com/p/v8/source/detail?r=3969

Modified:
 /branches/bleeding_edge/src/heap.cc

=======================================
--- /branches/bleeding_edge/src/heap.cc Fri Feb 26 00:27:20 2010
+++ /branches/bleeding_edge/src/heap.cc Fri Feb 26 03:48:18 2010
@@ -562,9 +562,18 @@
     global_gc_prologue_callback_();
   }
   EnsureFromSpaceIsCommitted();
+
+  // Perform mark-sweep with optional compaction.
   if (collector == MARK_COMPACTOR) {
     MarkCompact(tracer);
-
+  }
+
+  // Always perform a scavenge to make room in new space.
+  Scavenge();
+
+  // Update the old space promotion limits after the scavenge due to
+  // promotions during scavenge.
+  if (collector == MARK_COMPACTOR) {
     int old_gen_size = PromotedSpaceSize();
     old_gen_promotion_limit_ =
         old_gen_size + Max(kMinimumPromotionLimit, old_gen_size / 3);
@@ -572,7 +581,6 @@
         old_gen_size + Max(kMinimumAllocationLimit, old_gen_size / 2);
     old_gen_exhausted_ = false;
   }
-  Scavenge();

   Counters::objs_since_last_young.Set(0);

@@ -1673,7 +1681,7 @@
   // max_semispace_size_ ==   8 MB => number_string_cache_size = 16KB.
   int number_string_cache_size = max_semispace_size_ / 512;
   number_string_cache_size = Max(32, Min(16*KB, number_string_cache_size));
-  Object* obj = AllocateFixedArray(number_string_cache_size * 2);
+  Object* obj = AllocateFixedArray(number_string_cache_size * 2, TENURED);
   if (!obj->IsFailure()) set_number_string_cache(FixedArray::cast(obj));
   return obj;
 }

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to