| 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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 virtual ~Sampler(); | 712 virtual ~Sampler(); |
| 713 | 713 |
| 714 int interval() const { return interval_; } | 714 int interval() const { return interval_; } |
| 715 | 715 |
| 716 // Performs stack sampling. | 716 // Performs stack sampling. |
| 717 void SampleStack(TickSample* sample) { | 717 void SampleStack(TickSample* sample) { |
| 718 DoSampleStack(sample); | 718 DoSampleStack(sample); |
| 719 IncSamplesTaken(); | 719 IncSamplesTaken(); |
| 720 } | 720 } |
| 721 | 721 |
| 722 // Performs platform-specific stack sampling. |
| 723 void DoSample(); |
| 724 |
| 722 // This method is called for each sampling period with the current | 725 // This method is called for each sampling period with the current |
| 723 // program counter. | 726 // program counter. |
| 724 virtual void Tick(TickSample* sample) = 0; | 727 virtual void Tick(TickSample* sample) = 0; |
| 725 | 728 |
| 726 // Start and stop sampler. | 729 // Start and stop sampler. |
| 727 void Start(); | 730 void Start(); |
| 728 void Stop(); | 731 void Stop(); |
| 729 | 732 |
| 730 // Is the sampler used for profiling? | 733 // Is the sampler used for profiling? |
| 731 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } | 734 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 759 Atomic32 active_; | 762 Atomic32 active_; |
| 760 PlatformData* data_; // Platform specific data. | 763 PlatformData* data_; // Platform specific data. |
| 761 int samples_taken_; // Counts stack samples taken. | 764 int samples_taken_; // Counts stack samples taken. |
| 762 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 765 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 763 }; | 766 }; |
| 764 | 767 |
| 765 | 768 |
| 766 } } // namespace v8::internal | 769 } } // namespace v8::internal |
| 767 | 770 |
| 768 #endif // V8_PLATFORM_H_ | 771 #endif // V8_PLATFORM_H_ |
| OLD | NEW |