Revision: 21635
Author:   hpa...@chromium.org
Date:     Tue Jun  3 11:59:47 2014 UTC
Log: Deopt maybe tenure allocation sites when semi-space is maximum size.

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

Review URL: https://codereview.chromium.org/307363002
http://code.google.com/p/v8/source/detail?r=21635

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

=======================================
--- /branches/bleeding_edge/src/heap.cc Tue Jun  3 08:28:38 2014 UTC
+++ /branches/bleeding_edge/src/heap.cc Tue Jun  3 11:59:47 2014 UTC
@@ -497,10 +497,10 @@
     // 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();
@@ -525,6 +525,11 @@
         }
         allocation_sites++;
       }
+
+      if (deopt_maybe_tenured && site->IsMaybeTenure()) {
+        site->set_deopt_dependent_code(true);
+        trigger_deoptimization = true;
+      }

       if (use_scratchpad) {
         i++;
=======================================
--- /branches/bleeding_edge/src/heap.h  Tue Jun  3 08:28:38 2014 UTC
+++ /branches/bleeding_edge/src/heap.h  Tue Jun  3 11:59:47 2014 UTC
@@ -1362,6 +1362,10 @@
   bool MaximumSizeScavenge() {
     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
=======================================
--- /branches/bleeding_edge/src/objects.h       Tue Jun  3 08:12:43 2014 UTC
+++ /branches/bleeding_edge/src/objects.h       Tue Jun  3 11:59:47 2014 UTC
@@ -8502,6 +8502,10 @@
   bool IsZombie() {
     return pretenure_decision() == kZombie;
   }
+
+  bool IsMaybeTenure() {
+    return pretenure_decision() == kMaybeTenure;
+  }

   inline void MarkZombie();

--
--
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