Commit aee75623 authored by yurys's avatar yurys Committed by Commit bot

Profiler: resolve top of stack address to a function

When we cannot map top frame's pc to a code object and top frame is JS frame we now assume that it was a frameless invocation of a native function (e.g. __fmod) and try to resolve address on top of the stack into a JS function.

BUG=chromium:529931
LOG=Y

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

Cr-Commit-Position: refs/heads/master@{#30688}
parent 8df7b4f6
......@@ -603,6 +603,13 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
} else {
Address start;
CodeEntry* pc_entry = code_map_.FindEntry(sample.pc, &start);
// If there is no pc_entry we're likely in native code.
// Find out, if top of stack was pointing inside a JS function
// meaning that we have encountered a frameless invocation.
if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT ||
sample.top_frame_type == StackFrame::OPTIMIZED)) {
pc_entry = code_map_.FindEntry(sample.tos);
}
// If pc is in the function code before it set up stack frame or after the
// frame was destroyed SafeStackFrameIterator incorrectly thinks that
// ebp contains return address of the current function and skips caller's
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment