• Peter Marshall's avatar
    [cpu-profiler] Add source positions for inlined function calls · af0428ac
    Peter Marshall authored
    Currently in both kCallerLineNumbers and kLeafNodeLineNumbers modes, we
    correctly capture inline stacks. In leaf number mode, this is simple as
    we simply add the path onto the existing tree. For caller line numbers
    mode this is more complex, because each path through various inlined
    function should be represented in the tree, even when there are
    multiple callsites to the same function inlined.
    
    Currently we don't correctly show line numbers for inlined functions.
    We do actually have this information though, which is generated by
    turbofan and stored in the source_position_table data structure on the
    code object.
    
    This also changes the behavior of the SourcePositionTable class. A
    problem we uncovered is that the PC that the sampler provides for every
    frame except the leaf is the return address of the calling frame. This
    address is *after* the call has already happened. It can be attributed
    to the next line of the function, rather than the calling line, which
    is wrong. We fix that here by using lower_bound in GetSourceLineNumber.
    
    The same problem happens in GetInlineStack - the PC of the caller is
    actually the instruction after the call. The information turbofan
    generates assumes that the instruction after the call is not part of
    the call (fair enough). To fix this we do the same thing as above - use
    lower_bound and then iterate back by one.
    
    TBR=alph@chromium.org
    
    Bug: v8:8575, v8:8606
    Change-Id: Idc4bd4bdc8fb70b70ecc1a77a1e3744a86f83483
    Reviewed-on: https://chromium-review.googlesource.com/c/1374290
    Commit-Queue: Peter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#58545}
    af0428ac
Name
Last commit
Last update
..
OWNERS Loading commit data...
allocation-tracker.cc Loading commit data...
allocation-tracker.h Loading commit data...
circular-queue-inl.h Loading commit data...
circular-queue.h Loading commit data...
cpu-profiler-inl.h Loading commit data...
cpu-profiler.cc Loading commit data...
cpu-profiler.h Loading commit data...
heap-profiler.cc Loading commit data...
heap-profiler.h Loading commit data...
heap-snapshot-generator-inl.h Loading commit data...
heap-snapshot-generator.cc Loading commit data...
heap-snapshot-generator.h Loading commit data...
profile-generator-inl.h Loading commit data...
profile-generator.cc Loading commit data...
profile-generator.h Loading commit data...
profiler-listener.cc Loading commit data...
profiler-listener.h Loading commit data...
sampling-heap-profiler.cc Loading commit data...
sampling-heap-profiler.h Loading commit data...
strings-storage.cc Loading commit data...
strings-storage.h Loading commit data...
tick-sample.cc Loading commit data...
tick-sample.h Loading commit data...
tracing-cpu-profiler.cc Loading commit data...
tracing-cpu-profiler.h Loading commit data...
unbound-queue-inl.h Loading commit data...
unbound-queue.h Loading commit data...