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

Unified Diff: src/profile-generator.cc

Issue 18269003: Correctly report stack trace when current function is FunctionApply builtin (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix test Created 7 years, 6 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/frames.cc ('k') | src/sampler.h » ('j') | 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 aeb80a3bc625f6b42db8e35797163572c855a274..10bd94e7a374cf889312728b7b39c1101ebba9a4 100644
--- a/src/profile-generator.cc
+++ b/src/profile-generator.cc
@@ -906,11 +906,16 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) {
}
*entry++ = pc_entry;
- if (pc_entry->builtin_id() == Builtins::kFunctionCall) {
- // When current function is FunctionCall builtin tos is sometimes
- // address of the function that invoked it but sometimes it's one
- // of the arguments. We simply replace the frame with 'unknown' entry.
- *entry++ = unresolved_entry_;
+ if (pc_entry->builtin_id() == Builtins::kFunctionCall ||
+ pc_entry->builtin_id() == Builtins::kFunctionApply) {
+ // When current function is FunctionCall or FunctionApply builtin the
+ // top frame is either frame of the calling JS function or internal
+ // frame. In the latter case we know the caller for sure but in the
+ // former case we don't so we simply replace the frame with
+ // 'unresolved' entry.
+ if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) {
+ *entry++ = unresolved_entry_;
+ }
}
}
}
« no previous file with comments | « src/frames.cc ('k') | src/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698