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

Unified Diff: src/profiler/profile-generator.cc

Issue 2049903002: Revert of Move stack trace extraction code out of TickSample::Init (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « include/v8.h ('k') | src/profiler/tick-sample.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/profiler/profile-generator.cc
diff --git a/src/profiler/profile-generator.cc b/src/profiler/profile-generator.cc
index b09dc5a4306235224347a7461b900fada8045aa7..01b31088ad674c8c72e717757a243126e1cf5969 100644
--- a/src/profiler/profile-generator.cc
+++ b/src/profiler/profile-generator.cc
@@ -608,8 +608,9 @@
int src_line = v8::CpuProfileNode::kNoLineNumberInfo;
bool src_line_not_found = true;
- if (sample.pc != nullptr) {
- if (sample.has_external_callback && sample.state == EXTERNAL) {
+ if (sample.pc != NULL) {
+ if (sample.has_external_callback && sample.state == EXTERNAL &&
+ sample.top_frame_type == StackFrame::EXIT) {
// Don't use PC when in external callback code, as it can point
// inside callback's code, and we will erroneously report
// that a callback calls itself.
@@ -619,7 +620,9 @@
// 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.has_external_callback) {
+ if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT ||
+ sample.top_frame_type == StackFrame::INTERPRETED ||
+ 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
@@ -644,7 +647,7 @@
// 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.has_external_callback) {
+ if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) {
entries.push_back(unresolved_entry_);
}
}
« no previous file with comments | « include/v8.h ('k') | src/profiler/tick-sample.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698