Index: src/profiler/profile-generator.cc |
diff --git a/src/profiler/profile-generator.cc b/src/profiler/profile-generator.cc |
index 01b31088ad674c8c72e717757a243126e1cf5969..b09dc5a4306235224347a7461b900fada8045aa7 100644 |
--- a/src/profiler/profile-generator.cc |
+++ b/src/profiler/profile-generator.cc |
@@ -608,9 +608,8 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { |
int src_line = v8::CpuProfileNode::kNoLineNumberInfo; |
bool src_line_not_found = true; |
- if (sample.pc != NULL) { |
- if (sample.has_external_callback && sample.state == EXTERNAL && |
- sample.top_frame_type == StackFrame::EXIT) { |
+ if (sample.pc != nullptr) { |
+ if (sample.has_external_callback && sample.state == EXTERNAL) { |
// 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. |
@@ -620,9 +619,7 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { |
// 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::INTERPRETED || |
- sample.top_frame_type == StackFrame::OPTIMIZED)) { |
+ if (!pc_entry && !sample.has_external_callback) { |
pc_entry = code_map_.FindEntry(sample.tos); |
} |
// If pc is in the function code before it set up stack frame or after the |
@@ -647,7 +644,7 @@ void ProfileGenerator::RecordTickSample(const TickSample& sample) { |
// 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) { |
+ if (!sample.has_external_callback) { |
entries.push_back(unresolved_entry_); |
} |
} |