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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 ProfileGenerator* generator_; | 166 ProfileGenerator* generator_; |
167 bool running_; | 167 bool running_; |
168 UnboundQueue<CodeEventsContainer> events_buffer_; | 168 UnboundQueue<CodeEventsContainer> events_buffer_; |
169 SamplingCircularQueue ticks_buffer_; | 169 SamplingCircularQueue ticks_buffer_; |
170 UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_; | 170 UnboundQueue<TickSampleEventRecord> ticks_from_vm_buffer_; |
171 unsigned last_code_event_id_; | 171 unsigned last_code_event_id_; |
172 unsigned last_processed_code_event_id_; | 172 unsigned last_processed_code_event_id_; |
173 }; | 173 }; |
174 | 174 |
175 | 175 |
176 #define PROFILE(IsolateGetter, Call) \ | 176 #define PROFILE(IsolateGetter, Call) \ |
177 do { \ | 177 do { \ |
178 Isolate* cpu_profiler_isolate = (IsolateGetter); \ | 178 Isolate* cpu_profiler_isolate = (IsolateGetter); \ |
179 LOG_CODE_EVENT(cpu_profiler_isolate, Call); \ | 179 v8::internal::Logger* logger = cpu_profiler_isolate->logger(); \ |
180 CpuProfiler* cpu_profiler = cpu_profiler_isolate->cpu_profiler(); \ | 180 CpuProfiler* cpu_profiler = cpu_profiler_isolate->cpu_profiler(); \ |
181 if (cpu_profiler->is_profiling()) { \ | 181 if (logger->is_logging_code_events() || cpu_profiler->is_profiling()) { \ |
182 cpu_profiler->Call; \ | 182 logger->Call; \ |
183 } \ | 183 } \ |
184 } while (false) | 184 } while (false) |
185 | 185 |
186 | 186 |
187 class CpuProfiler { | 187 class CpuProfiler { |
188 public: | 188 public: |
189 explicit CpuProfiler(Isolate* isolate); | 189 explicit CpuProfiler(Isolate* isolate); |
190 | 190 |
191 CpuProfiler(Isolate* isolate, | 191 CpuProfiler(Isolate* isolate, |
192 CpuProfilesCollection* test_collection, | 192 CpuProfilesCollection* test_collection, |
193 ProfileGenerator* test_generator, | 193 ProfileGenerator* test_generator, |
(...skipping 22 matching lines...) Expand all Loading... |
216 Code* code, Name* name); | 216 Code* code, Name* name); |
217 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 217 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
218 Code* code, | 218 Code* code, |
219 SharedFunctionInfo* shared, | 219 SharedFunctionInfo* shared, |
220 CompilationInfo* info, | 220 CompilationInfo* info, |
221 Name* name); | 221 Name* name); |
222 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 222 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
223 Code* code, | 223 Code* code, |
224 SharedFunctionInfo* shared, | 224 SharedFunctionInfo* shared, |
225 CompilationInfo* info, | 225 CompilationInfo* info, |
226 String* source, int line); | 226 Name* source, int line); |
227 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 227 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
228 Code* code, int args_count); | 228 Code* code, int args_count); |
229 void CodeMovingGCEvent() {} | 229 void CodeMovingGCEvent() {} |
230 void CodeMoveEvent(Address from, Address to); | 230 void CodeMoveEvent(Address from, Address to); |
231 void CodeDeleteEvent(Address from); | 231 void CodeDeleteEvent(Address from); |
232 void GetterCallbackEvent(Name* name, Address entry_point); | 232 void GetterCallbackEvent(Name* name, Address entry_point); |
233 void RegExpCodeCreateEvent(Code* code, String* source); | 233 void RegExpCodeCreateEvent(Code* code, String* source); |
234 void SetterCallbackEvent(Name* name, Address entry_point); | 234 void SetterCallbackEvent(Name* name, Address entry_point); |
235 void SharedFunctionInfoMoveEvent(Address from, Address to); | 235 void SharedFunctionInfoMoveEvent(Address from, Address to); |
236 | 236 |
(...skipping 22 matching lines...) Expand all Loading... |
259 bool is_profiling_; | 259 bool is_profiling_; |
260 | 260 |
261 private: | 261 private: |
262 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 262 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
263 }; | 263 }; |
264 | 264 |
265 } } // namespace v8::internal | 265 } } // namespace v8::internal |
266 | 266 |
267 | 267 |
268 #endif // V8_CPU_PROFILER_H_ | 268 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |