Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1057)

Unified Diff: src/heap-inl.h

Issue 66683004: Move new-space allocation tracking into Heap::AllocateRaw. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/spaces-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-inl.h
diff --git a/src/heap-inl.h b/src/heap-inl.h
index 9bd764e47e2ad9dd11f7b91aaa22f1d42e30c2c4..b8321a34cb6ef3299d135830e4f491e8a3df0d79 100644
--- a/src/heap-inl.h
+++ b/src/heap-inl.h
@@ -221,6 +221,7 @@ MaybeObject* Heap::AllocateRaw(int size_in_bytes,
retry_space == OLD_POINTER_SPACE ||
retry_space == OLD_DATA_SPACE ||
retry_space == LO_SPACE);
+ HeapProfiler* profiler = isolate_->heap_profiler();
#ifdef DEBUG
if (FLAG_gc_interval >= 0 &&
!disallow_allocation_failure_ &&
@@ -230,12 +231,17 @@ MaybeObject* Heap::AllocateRaw(int size_in_bytes,
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()) {
space = retry_space;
} else {
+ if (profiler->is_tracking_allocations() && result->To(&object)) {
+ profiler->NewObjectEvent(object->address(), size_in_bytes);
+ }
return result;
}
}
« no previous file with comments | « no previous file | src/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698