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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 CODE_EVENTS_TYPE_LIST(DECLARE_CLASS) | 134 CODE_EVENTS_TYPE_LIST(DECLARE_CLASS) |
135 #undef DECLARE_TYPE | 135 #undef DECLARE_TYPE |
136 }; | 136 }; |
137 }; | 137 }; |
138 | 138 |
139 | 139 |
140 // This class implements both the profile events processor thread and | 140 // This class implements both the profile events processor thread and |
141 // methods called by event producers: VM and stack sampler threads. | 141 // methods called by event producers: VM and stack sampler threads. |
142 class ProfilerEventsProcessor : public Thread { | 142 class ProfilerEventsProcessor : public Thread { |
143 public: | 143 public: |
144 ProfilerEventsProcessor(ProfileGenerator* generator, | 144 explicit ProfilerEventsProcessor(ProfileGenerator* generator); |
145 CpuProfilesCollection* profiles); | |
146 virtual ~ProfilerEventsProcessor() {} | 145 virtual ~ProfilerEventsProcessor() {} |
147 | 146 |
148 // Thread control. | 147 // Thread control. |
149 virtual void Run(); | 148 virtual void Run(); |
150 inline void Stop() { running_ = false; } | 149 inline void Stop() { running_ = false; } |
151 INLINE(bool running()) { return running_; } | 150 INLINE(bool running()) { return running_; } |
152 void Enqueue(const CodeEventsContainer& event); | 151 void Enqueue(const CodeEventsContainer& event); |
153 | 152 |
154 // Puts current stack into tick sample events buffer. | 153 // Puts current stack into tick sample events buffer. |
155 void AddCurrentStack(); | 154 void AddCurrentStack(); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 bool is_profiling_; | 258 bool is_profiling_; |
260 | 259 |
261 private: | 260 private: |
262 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 261 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
263 }; | 262 }; |
264 | 263 |
265 } } // namespace v8::internal | 264 } } // namespace v8::internal |
266 | 265 |
267 | 266 |
268 #endif // V8_CPU_PROFILER_H_ | 267 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |