Reviewers: mvstanton,

Message:
Committed patchset #2 manually as r21635 (tree was closed).

Description:
Deopt maybe tenure allocation sites when semi-space is maximum size.

BUG=
R=mvstan...@chromium.org

Committed: https://code.google.com/p/v8/source/detail?r=21635

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

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

Affected files (+16, -3 lines):
  M src/heap.h
  M src/heap.cc
  M src/objects.h


Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index ec058828e664cec507581ffe40db26b9edcbe2a7..2b8bc562b0c3881148a2459abc5cbd622f694674 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -497,10 +497,10 @@ void Heap::ProcessPretenuringFeedback() {
     // we grew to the maximum semi-space size to deopt maybe tenured
     // allocation sites. We could hold the maybe tenured allocation sites
     // in a seperate data structure if this is a performance problem.
+    bool deopt_maybe_tenured = DeoptMaybeTenuredAllocationSites();
     bool use_scratchpad =
- allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize &&
-        new_space_.IsAtMaximumCapacity() &&
-        maximum_size_scavenges_ == 0;
+ allocation_sites_scratchpad_length_ < kAllocationSiteScratchpadSize &&
+         !deopt_maybe_tenured;

     int i = 0;
     Object* list_element = allocation_sites_list();
@@ -526,6 +526,11 @@ void Heap::ProcessPretenuringFeedback() {
         allocation_sites++;
       }

+      if (deopt_maybe_tenured && site->IsMaybeTenure()) {
+        site->set_deopt_dependent_code(true);
+        trigger_deoptimization = true;
+      }
+
       if (use_scratchpad) {
         i++;
       } else {
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index b465ca47c485bb7223cd3f6713dc230258b000fe..bdc7fe11ef1ceda345d21057f0e21bdab2c3e6ca 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1363,6 +1363,10 @@ class Heap {
     return maximum_size_scavenges_ > 0;
   }

+  bool DeoptMaybeTenuredAllocationSites() {
+ return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0;
+  }
+
// ObjectStats are kept in two arrays, counts and sizes. Related stats are // stored in a contiguous linear buffer. Stats groups are stored one after
   // another.
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 787e7ea87123b25fbf7fa74337c1ac4109eda209..ca8038f8938481046aaa4f2f0cb9eeaf9ac6c561 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -8503,6 +8503,10 @@ class AllocationSite: public Struct {
     return pretenure_decision() == kZombie;
   }

+  bool IsMaybeTenure() {
+    return pretenure_decision() == kMaybeTenure;
+  }
+
   inline void MarkZombie();

   inline bool MakePretenureDecision(PretenureDecision current_decision,


--
--
v8-dev mailing list
v8-dev@googlegroups.com
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 v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to