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

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

Issue 1376333003: Eliminate no_frame_range data (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/profile-generator.h ('k') | src/profiler/profile-generator-inl.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/compiler.h"
8 #include "src/debug/debug.h" 7 #include "src/debug/debug.h"
9 #include "src/deoptimizer.h" 8 #include "src/deoptimizer.h"
10 #include "src/global-handles.h" 9 #include "src/global-handles.h"
11 #include "src/profiler/profile-generator-inl.h" 10 #include "src/profiler/profile-generator-inl.h"
12 #include "src/profiler/sampler.h" 11 #include "src/profiler/sampler.h"
13 #include "src/scopeinfo.h" 12 #include "src/scopeinfo.h"
14 #include "src/splay-tree-inl.h" 13 #include "src/splay-tree-inl.h"
15 #include "src/unicode.h" 14 #include "src/unicode.h"
16 15
17 namespace v8 { 16 namespace v8 {
(...skipping 25 matching lines...) Expand all
43 } 42 }
44 43
45 44
46 const char* const CodeEntry::kEmptyNamePrefix = ""; 45 const char* const CodeEntry::kEmptyNamePrefix = "";
47 const char* const CodeEntry::kEmptyResourceName = ""; 46 const char* const CodeEntry::kEmptyResourceName = "";
48 const char* const CodeEntry::kEmptyBailoutReason = ""; 47 const char* const CodeEntry::kEmptyBailoutReason = "";
49 const char* const CodeEntry::kNoDeoptReason = ""; 48 const char* const CodeEntry::kNoDeoptReason = "";
50 49
51 50
52 CodeEntry::~CodeEntry() { 51 CodeEntry::~CodeEntry() {
53 delete no_frame_ranges_;
54 delete line_info_; 52 delete line_info_;
55 } 53 }
56 54
57 55
58 uint32_t CodeEntry::GetHash() const { 56 uint32_t CodeEntry::GetHash() const {
59 uint32_t hash = ComputeIntegerHash(tag(), v8::internal::kZeroHashSeed); 57 uint32_t hash = ComputeIntegerHash(tag(), v8::internal::kZeroHashSeed);
60 if (script_id_ != v8::UnboundScript::kNoScriptId) { 58 if (script_id_ != v8::UnboundScript::kNoScriptId) {
61 hash ^= ComputeIntegerHash(static_cast<uint32_t>(script_id_), 59 hash ^= ComputeIntegerHash(static_cast<uint32_t>(script_id_),
62 v8::internal::kZeroHashSeed); 60 v8::internal::kZeroHashSeed);
63 hash ^= ComputeIntegerHash(static_cast<uint32_t>(position_), 61 hash ^= ComputeIntegerHash(static_cast<uint32_t>(position_),
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 // meaning that we have encountered a frameless invocation. 602 // meaning that we have encountered a frameless invocation.
605 if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT || 603 if (!pc_entry && (sample.top_frame_type == StackFrame::JAVA_SCRIPT ||
606 sample.top_frame_type == StackFrame::OPTIMIZED)) { 604 sample.top_frame_type == StackFrame::OPTIMIZED)) {
607 pc_entry = code_map_.FindEntry(sample.tos); 605 pc_entry = code_map_.FindEntry(sample.tos);
608 } 606 }
609 // If pc is in the function code before it set up stack frame or after the 607 // If pc is in the function code before it set up stack frame or after the
610 // frame was destroyed SafeStackFrameIterator incorrectly thinks that 608 // frame was destroyed SafeStackFrameIterator incorrectly thinks that
611 // ebp contains return address of the current function and skips caller's 609 // ebp contains return address of the current function and skips caller's
612 // frame. Check for this case and just skip such samples. 610 // frame. Check for this case and just skip such samples.
613 if (pc_entry) { 611 if (pc_entry) {
614 List<OffsetRange>* ranges = pc_entry->no_frame_ranges();
615 int pc_offset = 612 int pc_offset =
616 static_cast<int>(sample.pc - pc_entry->instruction_start()); 613 static_cast<int>(sample.pc - pc_entry->instruction_start());
617 if (ranges) {
618 for (int i = 0; i < ranges->length(); i++) {
619 OffsetRange& range = ranges->at(i);
620 if (range.from <= pc_offset && pc_offset < range.to) {
621 return;
622 }
623 }
624 }
625 src_line = pc_entry->GetSourceLine(pc_offset); 614 src_line = pc_entry->GetSourceLine(pc_offset);
626 if (src_line == v8::CpuProfileNode::kNoLineNumberInfo) { 615 if (src_line == v8::CpuProfileNode::kNoLineNumberInfo) {
627 src_line = pc_entry->line_number(); 616 src_line = pc_entry->line_number();
628 } 617 }
629 src_line_not_found = false; 618 src_line_not_found = false;
630 *entry++ = pc_entry; 619 *entry++ = pc_entry;
631 620
632 if (pc_entry->builtin_id() == Builtins::kFunctionCall || 621 if (pc_entry->builtin_id() == Builtins::kFunctionCall ||
633 pc_entry->builtin_id() == Builtins::kFunctionApply) { 622 pc_entry->builtin_id() == Builtins::kFunctionApply) {
634 // When current function is FunctionCall or FunctionApply builtin the 623 // When current function is FunctionCall or FunctionApply builtin the
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 case EXTERNAL: 685 case EXTERNAL:
697 return program_entry_; 686 return program_entry_;
698 case IDLE: 687 case IDLE:
699 return idle_entry_; 688 return idle_entry_;
700 default: return NULL; 689 default: return NULL;
701 } 690 }
702 } 691 }
703 692
704 } // namespace internal 693 } // namespace internal
705 } // namespace v8 694 } // namespace v8
OLDNEW
« no previous file with comments | « src/profiler/profile-generator.h ('k') | src/profiler/profile-generator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698