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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 Isolate* isolate_; | 756 Isolate* isolate_; |
757 const int interval_; | 757 const int interval_; |
758 Atomic32 profiling_; | 758 Atomic32 profiling_; |
759 Atomic32 active_; | 759 Atomic32 active_; |
760 PlatformData* data_; // Platform specific data. | 760 PlatformData* data_; // Platform specific data. |
761 int samples_taken_; // Counts stack samples taken. | 761 int samples_taken_; // Counts stack samples taken. |
762 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 762 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
763 }; | 763 }; |
764 | 764 |
765 | 765 |
| 766 // ---------------------------------------------------------------------------- |
| 767 // CpuProfilerThread |
| 768 // |
| 769 |
| 770 class CpuProfilerThread : public Thread { |
| 771 public: |
| 772 static const int kCpuProfilerThreadStackSize = 64 * KB; |
| 773 |
| 774 explicit CpuProfilerThread(Sampler* sampler); |
| 775 virtual ~CpuProfilerThread(); |
| 776 |
| 777 virtual void Run() = 0; |
| 778 |
| 779 void DoSample(); |
| 780 |
| 781 class PlatformData; |
| 782 PlatformData* data() { return data_; } |
| 783 |
| 784 PlatformData* platform_data() { return data_; } |
| 785 |
| 786 private: |
| 787 PlatformData* data_; // Platform specific data. |
| 788 Sampler* sampler_; |
| 789 }; |
| 790 |
| 791 |
766 } } // namespace v8::internal | 792 } } // namespace v8::internal |
767 | 793 |
768 #endif // V8_PLATFORM_H_ | 794 #endif // V8_PLATFORM_H_ |
OLD | NEW |