| 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 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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_ |
| OLD | NEW |