Revision: 17027
Author:   [email protected]
Date:     Tue Oct  1 08:14:38 2013 UTC
Log: Print out how many AllocationMementos were found on a scavenge of new
space. This is useful because the unrooted mementos affect heap
decisions like pretenuring mode, and helps to gauge the effectiveness
of allocation-site feedback.

[email protected]

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

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

=======================================
--- /branches/bleeding_edge/src/heap-inl.h      Tue Sep 24 11:19:37 2013 UTC
+++ /branches/bleeding_edge/src/heap-inl.h      Tue Oct  1 08:14:38 2013 UTC
@@ -524,6 +524,14 @@
     *p = dest;
     return;
   }
+
+  if (FLAG_trace_track_allocation_sites &&
+      AllocationSite::CanTrack(object->map()->instance_type()) &&
+      object->IsJSObject()) {
+ if (AllocationMemento::FindForJSObject(JSObject::cast(object)) != NULL) { + object->GetIsolate()->heap()->allocation_mementos_found_on_scavenge_++;
+    }
+  }

   // AllocationMementos are unrooted and shouldn't survive a scavenge
   ASSERT(object->map() != object->GetHeap()->allocation_memento_map());
=======================================
--- /branches/bleeding_edge/src/heap.cc Fri Sep 27 10:53:07 2013 UTC
+++ /branches/bleeding_edge/src/heap.cc Tue Oct  1 08:14:38 2013 UTC
@@ -86,6 +86,7 @@
       contexts_disposed_(0),
       global_ic_age_(0),
       flush_monomorphic_ics_(false),
+      allocation_mementos_found_on_scavenge_(0),
       scan_on_scavenge_pages_(0),
       new_space_(this),
       old_pointer_space_(NULL),
@@ -1328,6 +1329,8 @@
 void Heap::Scavenge() {
   RelocationLock relocation_lock(this);

+  allocation_mementos_found_on_scavenge_ = 0;
+
 #ifdef VERIFY_HEAP
   if (FLAG_verify_heap) VerifyNonPointerSpacePointers(this);
 #endif
@@ -1475,6 +1478,12 @@
   gc_state_ = NOT_IN_GC;

   scavenges_since_last_idle_round_++;
+
+  if (FLAG_trace_track_allocation_sites &&
+      allocation_mementos_found_on_scavenge_ > 0) {
+    PrintF("AllocationMementos found during scavenge = %d\n",
+           allocation_mementos_found_on_scavenge_);
+  }
 }


=======================================
--- /branches/bleeding_edge/src/heap.h  Thu Sep 26 09:37:25 2013 UTC
+++ /branches/bleeding_edge/src/heap.h  Tue Oct  1 08:14:38 2013 UTC
@@ -1886,6 +1886,9 @@

   bool flush_monomorphic_ics_;

+  // AllocationMementos found on scavenge.
+  int allocation_mementos_found_on_scavenge_;
+
   int scan_on_scavenge_pages_;

   NewSpace new_space_;
=======================================
--- /branches/bleeding_edge/src/objects.cc      Mon Sep 30 16:34:37 2013 UTC
+++ /branches/bleeding_edge/src/objects.cc      Tue Oct  1 08:14:38 2013 UTC
@@ -9057,7 +9057,6 @@
   // involves carefully checking the object immediately after the JSArray
   // (if there is one) to see if it's an AllocationMemento.
if (FLAG_track_allocation_sites && object->GetHeap()->InNewSpace(object)) {
-    ASSERT(object->GetHeap()->InToSpace(object));
Address ptr_end = (reinterpret_cast<Address>(object) - kHeapObjectTag) +
         object->Size();
     if ((ptr_end + AllocationMemento::kSize) <=

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