Revision: 11835
Author:   [email protected]
Date:     Fri Jun 15 06:48:54 2012
Log:      Unify promotion and allocation limit computation.

BUG=129628
[email protected]

Review URL: https://chromiumcodereview.appspot.com/10552002
http://code.google.com/p/v8/source/detail?r=11835

Modified:
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/heap.h
 /branches/bleeding_edge/src/mark-compact.cc

=======================================
--- /branches/bleeding_edge/src/heap.cc Thu Jun 14 08:33:15 2012
+++ /branches/bleeding_edge/src/heap.cc Fri Jun 15 06:48:54 2012
@@ -118,8 +118,8 @@
       debug_utils_(NULL),
 #endif  // DEBUG
       new_space_high_promotion_mode_active_(false),
-      old_gen_promotion_limit_(kMinimumPromotionLimit),
-      old_gen_allocation_limit_(kMinimumAllocationLimit),
+      old_gen_promotion_limit_(kMinPromotionLimit),
+      old_gen_allocation_limit_(kMinAllocationLimit),
       old_gen_limit_factor_(1),
       size_of_old_gen_at_last_old_space_gc_(0),
       external_allocation_limit_(0),
@@ -829,9 +829,9 @@
     }

     old_gen_promotion_limit_ =
-        OldGenPromotionLimit(size_of_old_gen_at_last_old_space_gc_);
+ OldGenLimit(size_of_old_gen_at_last_old_space_gc_, kMinPromotionLimit);
     old_gen_allocation_limit_ =
-        OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_);
+ OldGenLimit(size_of_old_gen_at_last_old_space_gc_, kMinAllocationLimit);

     old_gen_exhausted_ = false;
   } else {
=======================================
--- /branches/bleeding_edge/src/heap.h  Mon Jun 11 09:57:27 2012
+++ /branches/bleeding_edge/src/heap.h  Fri Jun 15 06:48:54 2012
@@ -1359,24 +1359,13 @@
     return max_old_generation_size_ - PromotedTotalSize();
   }

-  static const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize;
-  static const intptr_t kMinimumAllocationLimit =
+  static const intptr_t kMinPromotionLimit = 5 * Page::kPageSize;
+  static const intptr_t kMinAllocationLimit =
       8 * (Page::kPageSize > MB ? Page::kPageSize : MB);

-  intptr_t OldGenPromotionLimit(intptr_t old_gen_size) {
-    const int divisor = FLAG_stress_compaction ? 10 : 3;
-    intptr_t limit =
-        Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit);
-    limit += new_space_.Capacity();
-    limit *= old_gen_limit_factor_;
- intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
-    return Min(limit, halfway_to_the_max);
-  }
-
-  intptr_t OldGenAllocationLimit(intptr_t old_gen_size) {
+  intptr_t OldGenLimit(intptr_t old_gen_size, intptr_t min_limit) {
     const int divisor = FLAG_stress_compaction ? 8 : 2;
-    intptr_t limit =
- Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit);
+    intptr_t limit = Max(old_gen_size + old_gen_size / divisor, min_limit);
     limit += new_space_.Capacity();
     limit *= old_gen_limit_factor_;
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Thu Jun 14 07:06:22 2012
+++ /branches/bleeding_edge/src/mark-compact.cc Fri Jun 15 06:48:54 2012
@@ -3817,8 +3817,9 @@

   intptr_t old_space_size = heap()->PromotedSpaceSizeOfObjects();
   intptr_t space_left =
-      Min(heap()->OldGenPromotionLimit(old_space_size),
-          heap()->OldGenAllocationLimit(old_space_size)) - old_space_size;
+      Min(heap()->OldGenLimit(old_space_size, Heap::kMinPromotionLimit),
+          heap()->OldGenLimit(old_space_size, Heap::kMinAllocationLimit)) -
+      old_space_size;

   while (it.has_next()) {
     Page* p = it.next();

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

Reply via email to