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

Side by Side Diff: src/platform.h

Issue 10857035: Moving cpu profiling into its own thread. (Closed) Base URL: http://git.chromium.org/external/v8.git@master
Patch Set: added { } Created 8 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
« no previous file with comments | « src/flag-definitions.h ('k') | src/platform-cygwin.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 // 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 virtual ~Sampler(); 730 virtual ~Sampler();
731 731
732 int interval() const { return interval_; } 732 int interval() const { return interval_; }
733 733
734 // Performs stack sampling. 734 // Performs stack sampling.
735 void SampleStack(TickSample* sample) { 735 void SampleStack(TickSample* sample) {
736 DoSampleStack(sample); 736 DoSampleStack(sample);
737 IncSamplesTaken(); 737 IncSamplesTaken();
738 } 738 }
739 739
740 // Performs platform-specific stack sampling.
741 void DoSample();
742
740 // This method is called for each sampling period with the current 743 // This method is called for each sampling period with the current
741 // program counter. 744 // program counter.
742 virtual void Tick(TickSample* sample) = 0; 745 virtual void Tick(TickSample* sample) = 0;
743 746
744 // Start and stop sampler. 747 // Start and stop sampler.
745 void Start(); 748 void Start();
746 void Stop(); 749 void Stop();
747 750
748 // Is the sampler used for profiling? 751 // Is the sampler used for profiling?
749 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } 752 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; }
(...skipping 27 matching lines...) Expand all
777 Atomic32 active_; 780 Atomic32 active_;
778 PlatformData* data_; // Platform specific data. 781 PlatformData* data_; // Platform specific data.
779 int samples_taken_; // Counts stack samples taken. 782 int samples_taken_; // Counts stack samples taken.
780 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 783 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
781 }; 784 };
782 785
783 786
784 } } // namespace v8::internal 787 } } // namespace v8::internal
785 788
786 #endif // V8_PLATFORM_H_ 789 #endif // V8_PLATFORM_H_
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/platform-cygwin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698