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

Side by Side Diff: src/sampler.cc

Issue 17579005: Merge SafeStackTraceFrameIterator into SafeStackFrameIterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 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
« no previous file with comments | « src/profile-generator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after
629 if (callback != NULL) { 629 if (callback != NULL) {
630 external_callback = callback; 630 external_callback = callback;
631 has_external_callback = true; 631 has_external_callback = true;
632 } else { 632 } else {
633 // Sample potential return address value for frameless invocation of 633 // Sample potential return address value for frameless invocation of
634 // stubs (we'll figure out later, if this value makes sense). 634 // stubs (we'll figure out later, if this value makes sense).
635 tos = Memory::Address_at(sp); 635 tos = Memory::Address_at(sp);
636 has_external_callback = false; 636 has_external_callback = false;
637 } 637 }
638 638
639 SafeStackTraceFrameIterator it(isolate, fp, sp, sp, js_entry_sp); 639 SafeStackFrameIterator it(isolate, fp, sp, sp, js_entry_sp);
640 int i = 0; 640 int i = 0;
641 while (!it.done() && i < TickSample::kMaxFramesCount) { 641 while (!it.done() && i < TickSample::kMaxFramesCount) {
642 stack[i++] = it.frame()->pc(); 642 stack[i++] = it.frame()->pc();
643 it.Advance(); 643 it.Advance();
644 } 644 }
645 frames_count = i; 645 frames_count = i;
646 } 646 }
647 647
648 648
649 void Sampler::SetUp() { 649 void Sampler::SetUp() {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 SamplerThread::RemoveActiveSampler(this); 683 SamplerThread::RemoveActiveSampler(this);
684 SetActive(false); 684 SetActive(false);
685 } 685 }
686 686
687 void Sampler::SampleStack(TickSample* sample) { 687 void Sampler::SampleStack(TickSample* sample) {
688 sample->Trace(isolate_); 688 sample->Trace(isolate_);
689 if (++samples_taken_ < 0) samples_taken_ = 0; 689 if (++samples_taken_ < 0) samples_taken_ = 0;
690 } 690 }
691 691
692 } } // namespace v8::internal 692 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698