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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 explicit ProfilerEventsProcessor(ProfileGenerator* generator); | 127 explicit ProfilerEventsProcessor(ProfileGenerator* generator); |
128 virtual ~ProfilerEventsProcessor() {} | 128 virtual ~ProfilerEventsProcessor() {} |
129 | 129 |
130 // Thread control. | 130 // Thread control. |
131 virtual void Run(); | 131 virtual void Run(); |
132 inline void Stop() { running_ = false; } | 132 inline void Stop() { running_ = false; } |
133 INLINE(bool running()) { return running_; } | 133 INLINE(bool running()) { return running_; } |
134 | 134 |
135 // Events adding methods. Called by VM threads. | 135 // Events adding methods. Called by VM threads. |
136 void CallbackCreateEvent(Logger::LogEventsAndTags tag, | 136 void CallbackCreateEvent(Logger::LogEventsAndTags tag, |
137 const char* prefix, String* name, | 137 const char* prefix, Name* name, |
138 Address start); | 138 Address start); |
139 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 139 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
140 String* name, | 140 Name* name, |
141 String* resource_name, int line_number, | 141 String* resource_name, int line_number, |
142 Address start, unsigned size, | 142 Address start, unsigned size, |
143 Address shared); | 143 Address shared); |
144 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 144 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
145 const char* name, | 145 const char* name, |
146 Address start, unsigned size); | 146 Address start, unsigned size); |
147 void CodeCreateEvent(Logger::LogEventsAndTags tag, | 147 void CodeCreateEvent(Logger::LogEventsAndTags tag, |
148 int args_count, | 148 int args_count, |
149 Address start, unsigned size); | 149 Address start, unsigned size); |
150 void CodeMoveEvent(Address from, Address to); | 150 void CodeMoveEvent(Address from, Address to); |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 static CpuProfile* FindProfile(Object* security_token, unsigned uid); | 215 static CpuProfile* FindProfile(Object* security_token, unsigned uid); |
216 static void DeleteAllProfiles(); | 216 static void DeleteAllProfiles(); |
217 static void DeleteProfile(CpuProfile* profile); | 217 static void DeleteProfile(CpuProfile* profile); |
218 static bool HasDetachedProfiles(); | 218 static bool HasDetachedProfiles(); |
219 | 219 |
220 // Invoked from stack sampler (thread or signal handler.) | 220 // Invoked from stack sampler (thread or signal handler.) |
221 static TickSample* TickSampleEvent(Isolate* isolate); | 221 static TickSample* TickSampleEvent(Isolate* isolate); |
222 | 222 |
223 // Must be called via PROFILE macro, otherwise will crash when | 223 // Must be called via PROFILE macro, otherwise will crash when |
224 // profiling is not enabled. | 224 // profiling is not enabled. |
225 static void CallbackEvent(String* name, Address entry_point); | 225 static void CallbackEvent(Name* name, Address entry_point); |
226 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 226 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
227 Code* code, const char* comment); | 227 Code* code, const char* comment); |
228 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 228 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
229 Code* code, String* name); | 229 Code* code, Name* name); |
230 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 230 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
231 Code* code, | 231 Code* code, |
232 SharedFunctionInfo* shared, | 232 SharedFunctionInfo* shared, |
233 String* name); | 233 Name* name); |
234 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 234 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
235 Code* code, | 235 Code* code, |
236 SharedFunctionInfo* shared, | 236 SharedFunctionInfo* shared, |
237 String* source, int line); | 237 String* source, int line); |
238 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 238 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
239 Code* code, int args_count); | 239 Code* code, int args_count); |
240 static void CodeMovingGCEvent() {} | 240 static void CodeMovingGCEvent() {} |
241 static void CodeMoveEvent(Address from, Address to); | 241 static void CodeMoveEvent(Address from, Address to); |
242 static void CodeDeleteEvent(Address from); | 242 static void CodeDeleteEvent(Address from); |
243 static void GetterCallbackEvent(String* name, Address entry_point); | 243 static void GetterCallbackEvent(Name* name, Address entry_point); |
244 static void RegExpCodeCreateEvent(Code* code, String* source); | 244 static void RegExpCodeCreateEvent(Code* code, String* source); |
245 static void SetterCallbackEvent(String* name, Address entry_point); | 245 static void SetterCallbackEvent(Name* name, Address entry_point); |
246 static void SharedFunctionInfoMoveEvent(Address from, Address to); | 246 static void SharedFunctionInfoMoveEvent(Address from, Address to); |
247 | 247 |
248 // TODO(isolates): this doesn't have to use atomics anymore. | 248 // TODO(isolates): this doesn't have to use atomics anymore. |
249 | 249 |
250 static INLINE(bool is_profiling(Isolate* isolate)) { | 250 static INLINE(bool is_profiling(Isolate* isolate)) { |
251 CpuProfiler* profiler = isolate->cpu_profiler(); | 251 CpuProfiler* profiler = isolate->cpu_profiler(); |
252 return profiler != NULL && NoBarrier_Load(&profiler->is_profiling_); | 252 return profiler != NULL && NoBarrier_Load(&profiler->is_profiling_); |
253 } | 253 } |
254 | 254 |
255 private: | 255 private: |
(...skipping 18 matching lines...) Expand all Loading... |
274 Atomic32 is_profiling_; | 274 Atomic32 is_profiling_; |
275 | 275 |
276 private: | 276 private: |
277 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 277 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
278 }; | 278 }; |
279 | 279 |
280 } } // namespace v8::internal | 280 } } // namespace v8::internal |
281 | 281 |
282 | 282 |
283 #endif // V8_CPU_PROFILER_H_ | 283 #endif // V8_CPU_PROFILER_H_ |
OLD | NEW |