Record allocation stack traces
authoryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Oct 2013 09:26:55 +0000 (09:26 +0000)
committeryurys@chromium.org <yurys@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 24 Oct 2013 09:26:55 +0000 (09:26 +0000)
commita083601e7382e18c965c2037175fed417f42d141
treec5bec307cf8f6cb1e73255a6e6de07dc92e86757
parent9b7a5f20a630ffcd42713de52ee0a9c050f01187
Record allocation stack traces

This is initial implementation of allocation profiler.

Whenever new object allocation is reported to the HeapProfiler and allocation tracking is on we will capture current stack trace, add it to the collection of the allocation traces (a tree) and attribute the allocated size to the top JS function on the stack.

Format of serialized heap snapshot is extended to include information about recorded allocation stack traces.

This patch is r17301 plus a fix for the test crash in debug mode. The test crashed because we were traversing stack trace when just allocated object wasn't completely configured, in particular the map pointer was incorrect. Invalid Map pointer broke heap iteration required to find Code object for a given pc during stack traversal. The solution is to insert free space filler in the newly allocated block just before collecting stack trace.

BUG=chromium:277984,v8:2949
R=hpayer@chromium.org, loislo@chromium.org

Review URL: https://codereview.chromium.org/34733004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@17365 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
src/allocation-tracker.cc [new file with mode: 0644]
src/allocation-tracker.h [new file with mode: 0644]
src/heap-snapshot-generator.cc
src/heap-snapshot-generator.h
test/cctest/test-heap-profiler.cc
tools/gyp/v8.gyp