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

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: Rebased on bleeding_edge 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
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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 // frame. In the latter case we know the caller for sure but in the 615 // frame. In the latter case we know the caller for sure but in the
616 // former case we don't so we simply replace the frame with 616 // former case we don't so we simply replace the frame with
617 // 'unresolved' entry. 617 // 'unresolved' entry.
618 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) { 618 if (sample.top_frame_type == StackFrame::JAVA_SCRIPT) {
619 *entry++ = unresolved_entry_; 619 *entry++ = unresolved_entry_;
620 } 620 }
621 } 621 }
622 } 622 }
623 } 623 }
624 624
625 for (const Address* stack_pos = sample.stack, 625 for (unsigned i = 0; i < sample.frames_count; ++i) {
626 *stack_end = stack_pos + sample.frames_count; 626 *entry++ = code_map_.FindEntry(static_cast<Address>(sample.stack[i]));
627 stack_pos != stack_end;
628 ++stack_pos) {
629 *entry++ = code_map_.FindEntry(*stack_pos);
630 } 627 }
631 } 628 }
632 629
633 if (FLAG_prof_browser_mode) { 630 if (FLAG_prof_browser_mode) {
634 bool no_symbolized_entries = true; 631 bool no_symbolized_entries = true;
635 for (CodeEntry** e = entries.start(); e != entry; ++e) { 632 for (CodeEntry** e = entries.start(); e != entry; ++e) {
636 if (*e != NULL) { 633 if (*e != NULL) {
637 no_symbolized_entries = false; 634 no_symbolized_entries = false;
638 break; 635 break;
639 } 636 }
(...skipping 20 matching lines...) Expand all
660 case OTHER: 657 case OTHER:
661 case EXTERNAL: 658 case EXTERNAL:
662 return program_entry_; 659 return program_entry_;
663 case IDLE: 660 case IDLE:
664 return idle_entry_; 661 return idle_entry_;
665 default: return NULL; 662 default: return NULL;
666 } 663 }
667 } 664 }
668 665
669 } } // namespace v8::internal 666 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698