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

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

Issue 422593003: Initial GetSample implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added test to verify the pc values in obtained sample. Created 6 years, 3 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 | Annotate | Revision Log
« include/v8.h ('K') | « src/log.cc ('k') | src/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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/profile-generator-inl.h" 7 #include "src/profile-generator-inl.h"
8 8
9 #include "src/compiler.h" 9 #include "src/compiler.h"
10 #include "src/debug.h" 10 #include "src/debug.h"
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 // frame. In the latter case we know the caller for sure but in the 621 // frame. In the latter case we know the caller for sure but in the
622 // former case we don't so we simply replace the frame with 622 // former case we don't so we simply replace the frame with
623 // 'unresolved' entry. 623 // 'unresolved' entry.
624 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) { 624 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) {
625 *entry++ = unresolved_entry_; 625 *entry++ = unresolved_entry_;
626 } 626 }
627 } 627 }
628 } 628 }
629 } 629 }
630 630
631 for (const Address* stack_pos = sample.stack, 631 for (unsigned i = 0; i < sample.frames_count; ++i) {
632 *stack_end = stack_pos + sample.frames_count; 632 *entry++ = code_map_.FindEntry(static_cast<Address>(sample.stack[i]));
633 stack_pos != stack_end;
634 ++stack_pos) {
635 *entry++ = code_map_.FindEntry(*stack_pos);
636 } 633 }
637 } 634 }
638 635
639 if (FLAG_prof_browser_mode) { 636 if (FLAG_prof_browser_mode) {
640 bool no_symbolized_entries = true; 637 bool no_symbolized_entries = true;
641 for (CodeEntry** e = entries.start(); e != entry; ++e) { 638 for (CodeEntry** e = entries.start(); e != entry; ++e) {
642 if (*e != NULL) { 639 if (*e != NULL) {
643 no_symbolized_entries = false; 640 no_symbolized_entries = false;
644 break; 641 break;
645 } 642 }
(...skipping 20 matching lines...) Expand all
666 case OTHER: 663 case OTHER:
667 case EXTERNAL: 664 case EXTERNAL:
668 return program_entry_; 665 return program_entry_;
669 case IDLE: 666 case IDLE:
670 return idle_entry_; 667 return idle_entry_;
671 default: return NULL; 668 default: return NULL;
672 } 669 }
673 } 670 }
674 671
675 } } // namespace v8::internal 672 } } // namespace v8::internal
OLDNEW
« include/v8.h ('K') | « src/log.cc ('k') | src/sampler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698