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

Side by Side Diff: src/profiler/profile-generator.cc

Issue 1752173003: Additional fixes for external callback logging in profiler. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test-log-stack-tracer.cc Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/log.cc ('k') | src/profiler/sampler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/profiler/profile-generator.h" 5 #include "src/profiler/profile-generator.h"
6 6
7 #include "src/ast/scopeinfo.h" 7 #include "src/ast/scopeinfo.h"
8 #include "src/debug/debug.h" 8 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 9 #include "src/deoptimizer.h"
10 #include "src/global-handles.h" 10 #include "src/global-handles.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // ProfileNode to increase the tick count for this source line. 601 // ProfileNode to increase the tick count for this source line.
602 int src_line = v8::CpuProfileNode::kNoLineNumberInfo; 602 int src_line = v8::CpuProfileNode::kNoLineNumberInfo;
603 bool src_line_not_found = true; 603 bool src_line_not_found = true;
604 604
605 if (sample.pc != NULL) { 605 if (sample.pc != NULL) {
606 if (sample.has_external_callback && sample.state == EXTERNAL && 606 if (sample.has_external_callback && sample.state == EXTERNAL &&
607 sample.top_frame_type == StackFrame::EXIT) { 607 sample.top_frame_type == StackFrame::EXIT) {
608 // Don't use PC when in external callback code, as it can point 608 // Don't use PC when in external callback code, as it can point
609 // inside callback's code, and we will erroneously report 609 // inside callback's code, and we will erroneously report
610 // that a callback calls itself. 610 // that a callback calls itself.
611 entries.push_back(code_map_.FindEntry(sample.external_callback)); 611 entries.push_back(code_map_.FindEntry(sample.external_callback_entry));
612 } else { 612 } else {
613 CodeEntry* pc_entry = code_map_.FindEntry(sample.pc); 613 CodeEntry* pc_entry = code_map_.FindEntry(sample.pc);
614 // If there is no pc_entry we're likely in native code. 614 // If there is no pc_entry we're likely in native code.
615 // Find out, if top of stack was pointing inside a JS function 615 // Find out, if top of stack was pointing inside a JS function
616 // meaning that we have encountered a frameless invocation. 616 // meaning that we have encountered a frameless invocation.
617 if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT || 617 if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT ||
618 sample.top_frame_type == StackFrame::INTERPRETED || 618 sample.top_frame_type == StackFrame::INTERPRETED ||
619 sample.top_frame_type == StackFrame::OPTIMIZED)) { 619 sample.top_frame_type == StackFrame::OPTIMIZED)) {
620 pc_entry = code_map_.FindEntry(sample.tos); 620 pc_entry = code_map_.FindEntry(sample.tos);
621 } 621 }
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 case EXTERNAL: 709 case EXTERNAL:
710 return program_entry_; 710 return program_entry_;
711 case IDLE: 711 case IDLE:
712 return idle_entry_; 712 return idle_entry_;
713 default: return NULL; 713 default: return NULL;
714 } 714 }
715 } 715 }
716 716
717 } // namespace internal 717 } // namespace internal
718 } // namespace v8 718 } // namespace v8
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/profiler/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698