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

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

Issue 1728593002: [Interpreter] Add support for cpu profiler logging. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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/profiler/cpu-profiler.cc ('k') | src/profiler/sampler.cc » ('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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 // Don't use PC when in external callback code, as it can point 597 // Don't use PC when in external callback code, as it can point
598 // inside callback's code, and we will erroneously report 598 // inside callback's code, and we will erroneously report
599 // that a callback calls itself. 599 // that a callback calls itself.
600 *entry++ = code_map_.FindEntry(sample.external_callback); 600 *entry++ = code_map_.FindEntry(sample.external_callback);
601 } else { 601 } else {
602 CodeEntry* pc_entry = code_map_.FindEntry(sample.pc); 602 CodeEntry* pc_entry = code_map_.FindEntry(sample.pc);
603 // If there is no pc_entry we're likely in native code. 603 // If there is no pc_entry we're likely in native code.
604 // Find out, if top of stack was pointing inside a JS function 604 // Find out, if top of stack was pointing inside a JS function
605 // meaning that we have encountered a frameless invocation. 605 // meaning that we have encountered a frameless invocation.
606 if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT || 606 if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT ||
607 sample.top_frame_type == StackFrame::INTERPRETED ||
607 sample.top_frame_type == StackFrame::OPTIMIZED)) { 608 sample.top_frame_type == StackFrame::OPTIMIZED)) {
608 pc_entry = code_map_.FindEntry(sample.tos); 609 pc_entry = code_map_.FindEntry(sample.tos);
609 } 610 }
610 // If pc is in the function code before it set up stack frame or after the 611 // If pc is in the function code before it set up stack frame or after the
611 // frame was destroyed SafeStackFrameIterator incorrectly thinks that 612 // frame was destroyed SafeStackFrameIterator incorrectly thinks that
612 // ebp contains return address of the current function and skips caller's 613 // ebp contains return address of the current function and skips caller's
613 // frame. Check for this case and just skip such samples. 614 // frame. Check for this case and just skip such samples.
614 if (pc_entry) { 615 if (pc_entry) {
615 int pc_offset = 616 int pc_offset =
616 static_cast<int>(sample.pc - pc_entry->instruction_start()); 617 static_cast<int>(sample.pc - pc_entry->instruction_start());
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 case EXTERNAL: 690 case EXTERNAL:
690 return program_entry_; 691 return program_entry_;
691 case IDLE: 692 case IDLE:
692 return idle_entry_; 693 return idle_entry_;
693 default: return NULL; 694 default: return NULL;
694 } 695 }
695 } 696 }
696 697
697 } // namespace internal 698 } // namespace internal
698 } // namespace v8 699 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/cpu-profiler.cc ('k') | src/profiler/sampler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698