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

Unified Diff: src/profile-generator.cc

Issue 1315683007: Profiler: resolve top of stack address to a function (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: moved tos analysis before line number resolution Created 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profile-generator.cc
diff --git a/src/profile-generator.cc b/src/profile-generator.cc
index 09468cad75d4860059ef1edc8dd0e96b948c7873..3cb3fa40b6b6e0757afda1aa69ff3c6c8d3c02f1 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698