Revision: 17605
Author:   [email protected]
Date:     Fri Nov  8 17:23:25 2013 UTC
Log:      Move new-space allocation tracking into Heap::AllocateRaw.

[email protected]

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

Modified:
 /branches/bleeding_edge/src/heap-inl.h
 /branches/bleeding_edge/src/spaces-inl.h

=======================================
--- /branches/bleeding_edge/src/heap-inl.h      Fri Nov  8 17:09:14 2013 UTC
+++ /branches/bleeding_edge/src/heap-inl.h      Fri Nov  8 17:23:25 2013 UTC
@@ -217,6 +217,7 @@
   ASSERT(AllowHandleAllocation::IsAllowed());
   ASSERT(AllowHeapAllocation::IsAllowed());
   ASSERT(gc_state_ == NOT_IN_GC);
+  HeapProfiler* profiler = isolate_->heap_profiler();
 #ifdef DEBUG
   if (FLAG_gc_interval >= 0 &&
       !disallow_allocation_failure_ &&
@@ -226,12 +227,17 @@
   isolate_->counters()->objs_since_last_full()->Increment();
   isolate_->counters()->objs_since_last_young()->Increment();
 #endif
+
+  HeapObject* object;
   MaybeObject* result;
   if (NEW_SPACE == space) {
     result = new_space_.AllocateRaw(size_in_bytes);
if (always_allocate() && result->IsFailure() && retry_space != NEW_SPACE) {
       space = retry_space;
     } else {
+      if (profiler->is_tracking_allocations() && result->To(&object)) {
+        profiler->NewObjectEvent(object->address(), size_in_bytes);
+      }
       return result;
     }
   }
=======================================
--- /branches/bleeding_edge/src/spaces-inl.h    Fri Oct 25 09:58:21 2013 UTC
+++ /branches/bleeding_edge/src/spaces-inl.h    Fri Nov  8 17:23:25 2013 UTC
@@ -348,11 +348,6 @@
   HeapObject* obj = HeapObject::FromAddress(old_top);
   allocation_info_.set_top(allocation_info_.top() + size_in_bytes);
   ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_);
-
-  HeapProfiler* profiler = heap()->isolate()->heap_profiler();
-  if (profiler != NULL && profiler->is_tracking_allocations()) {
-    profiler->NewObjectEvent(obj->address(), size_in_bytes);
-  }

   return obj;
 }

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