Reviewers: mvstanton, Benedikt Meurer,

Description:
Make eager allocation site pretenuring decisions.

BUG=

Please review this at https://codereview.chromium.org/149393005/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+4, -15 lines):
  M src/heap-inl.h
  M src/heap.h
  M src/heap.cc
  M src/objects.cc


Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index d878daa3b00d32351fd5d446237ee0b32c5537e8..f55073ce9ec6079144e56baee21a67e3c3bb8e0c 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -491,7 +491,6 @@ void Heap::UpdateAllocationSiteFeedback(HeapObject* object) {
   ASSERT(heap->InNewSpace(object));

   if (!FLAG_allocation_site_pretenuring ||
-      !heap->new_space_high_promotion_mode_active_ ||
       !AllocationSite::CanTrack(object->map()->instance_type())) return;

// Either object is the last object in the from space, or there is another
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 862e2eaa24b205bb3051458a5a50d1c06c30c18d..a8d16aefa1c0870bc1974b37b6bd94d11b54fd0f 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -506,8 +506,7 @@ void Heap::RepairFreeListsAfterBoot() {


 void Heap::ProcessPretenuringFeedback() {
-  if (FLAG_allocation_site_pretenuring &&
-      new_space_high_promotion_mode_active_) {
+  if (FLAG_allocation_site_pretenuring) {
     int tenure_decisions = 0;
     int dont_tenure_decisions = 0;
     int allocation_mementos_found = 0;
@@ -1113,9 +1112,7 @@ bool Heap::PerformGarbageCollection(
     // to deoptimize all optimized code in global pretenuring mode and all
     // code which should be tenured in local pretenuring mode.
     if (FLAG_pretenuring) {
-      if (FLAG_allocation_site_pretenuring) {
-        ResetAllAllocationSitesDependentCode(NOT_TENURED);
-      } else {
+      if (!FLAG_allocation_site_pretenuring) {
         isolate_->stack_guard()->FullDeopt();
       }
     }
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index c9101bea9f71687ff9c73f559f081fddc2f137c0..9655d383324f43e5410e2454297c0c0ea3f75fb9 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1512,17 +1512,11 @@ class Heap {
       8 * (Page::kPageSize > MB ? Page::kPageSize : MB);

   intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) {
-    const int divisor = FLAG_stress_compaction ? 10 :
-        new_space_high_promotion_mode_active_ ? 1 : 3;
+    const int divisor = FLAG_stress_compaction ? 10 : 1;
     intptr_t limit =
         Max(old_gen_size + old_gen_size / divisor,
             kMinimumOldGenerationAllocationLimit);
     limit += new_space_.Capacity();
- // TODO(hpayer): Can be removed when when pretenuring is supported for all
-    // allocation sites.
-    if (IsHighSurvivalRate() && IsStableOrIncreasingSurvivalTrend()) {
-      limit *= 2;
-    }
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
     return Min(limit, halfway_to_the_max);
   }
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 392c158e1526cb3211497ba1d2c143137db6d60d..5b8149eb8e81ef925fc61bfdb5594855c9ada647 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12733,8 +12733,7 @@ void AllocationSite::ResetPretenureDecision() {
 PretenureFlag AllocationSite::GetPretenureMode() {
   PretenureDecision mode = pretenure_decision();
   // Zombie objects "decide" to be untenured.
-  return (mode == kTenure && GetHeap()->GetPretenureMode() == TENURED)
-      ? TENURED : NOT_TENURED;
+  return mode == kTenure ? TENURED : NOT_TENURED;
 }




--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to