OLD | NEW |
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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 virtual ~Sampler(); | 734 virtual ~Sampler(); |
735 | 735 |
736 int interval() const { return interval_; } | 736 int interval() const { return interval_; } |
737 | 737 |
738 // Performs stack sampling. | 738 // Performs stack sampling. |
739 void SampleStack(TickSample* sample) { | 739 void SampleStack(TickSample* sample) { |
740 DoSampleStack(sample); | 740 DoSampleStack(sample); |
741 IncSamplesTaken(); | 741 IncSamplesTaken(); |
742 } | 742 } |
743 | 743 |
744 // Performs platform-specific stack sampling. | |
745 void DoSample(); | |
746 | |
747 // This method is called for each sampling period with the current | 744 // This method is called for each sampling period with the current |
748 // program counter. | 745 // program counter. |
749 virtual void Tick(TickSample* sample) = 0; | 746 virtual void Tick(TickSample* sample) = 0; |
750 | 747 |
751 // Start and stop sampler. | 748 // Start and stop sampler. |
752 void Start(); | 749 void Start(); |
753 void Stop(); | 750 void Stop(); |
754 | 751 |
755 // Is the sampler used for profiling? | 752 // Is the sampler used for profiling? |
756 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } | 753 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } |
(...skipping 27 matching lines...) Expand all Loading... |
784 Atomic32 active_; | 781 Atomic32 active_; |
785 PlatformData* data_; // Platform specific data. | 782 PlatformData* data_; // Platform specific data. |
786 int samples_taken_; // Counts stack samples taken. | 783 int samples_taken_; // Counts stack samples taken. |
787 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 784 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
788 }; | 785 }; |
789 | 786 |
790 | 787 |
791 } } // namespace v8::internal | 788 } } // namespace v8::internal |
792 | 789 |
793 #endif // V8_PLATFORM_H_ | 790 #endif // V8_PLATFORM_H_ |
OLD | NEW |