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

Unified Diff: src/heap.cc

Issue 22852024: Track JS allocations as they arrive with no affection on performance when tracking is switched off (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix tracking flag + encode allocation type instead of calling different methods Created 7 years, 3 months 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 | « src/builtins.cc ('k') | src/heap-profiler.h » ('j') | src/heap-profiler.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index e81a0e3b3b3e3dd7fc7ec8826f323949e6f093d3..d43bb7c2b09839c7b1861e36cdbe24fd14b605c6 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -2100,7 +2100,8 @@ class ScavengingVisitor : public StaticVisitorBase {
if (logging_and_profiling_mode == LOGGING_AND_PROFILING_ENABLED) {
// Update NewSpace stats if necessary.
RecordCopiedObject(heap, target);
- HEAP_PROFILE(heap, ObjectMoveEvent(source->address(), target->address()));
+ HEAP_PROFILE(heap,
+ ObjectMoveEvent(source->address(), target->address(), size));
Isolate* isolate = heap->isolate();
if (isolate->logger()->is_logging_code_events() ||
isolate->cpu_profiler()->is_profiling()) {
@@ -4975,6 +4976,13 @@ MaybeObject* Heap::CopyJSObject(JSObject* source, AllocationSite* site) {
alloc_memento->set_map_no_write_barrier(allocation_memento_map());
ASSERT(site->map() == allocation_site_map());
alloc_memento->set_allocation_site(site, SKIP_WRITE_BARRIER);
+ HeapProfiler* profiler = isolate()->heap_profiler();
+ if (profiler->is_tracking_allocations()) {
+ profiler->UpdateObjectSizeEvent(HeapObject::cast(clone)->address(),
+ object_size);
+ profiler->NewObjectEvent(alloc_memento->address(),
+ AllocationMemento::kSize);
+ }
}
}
« no previous file with comments | « src/builtins.cc ('k') | src/heap-profiler.h » ('j') | src/heap-profiler.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698