| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 } while (false) | 197 } while (false) |
| 198 | 198 |
| 199 | 199 |
| 200 namespace v8 { | 200 namespace v8 { |
| 201 namespace internal { | 201 namespace internal { |
| 202 | 202 |
| 203 | 203 |
| 204 // TODO(isolates): isolatify this class. | 204 // TODO(isolates): isolatify this class. |
| 205 class CpuProfiler { | 205 class CpuProfiler { |
| 206 public: | 206 public: |
| 207 static void Setup(); | 207 static void SetUp(); |
| 208 static void TearDown(); | 208 static void TearDown(); |
| 209 | 209 |
| 210 static void StartProfiling(const char* title); | 210 static void StartProfiling(const char* title); |
| 211 static void StartProfiling(String* title); | 211 static void StartProfiling(String* title); |
| 212 static CpuProfile* StopProfiling(const char* title); | 212 static CpuProfile* StopProfiling(const char* title); |
| 213 static CpuProfile* StopProfiling(Object* security_token, String* title); | 213 static CpuProfile* StopProfiling(Object* security_token, String* title); |
| 214 static int GetProfilesCount(); | 214 static int GetProfilesCount(); |
| 215 static CpuProfile* GetProfile(Object* security_token, int index); | 215 static CpuProfile* GetProfile(Object* security_token, int index); |
| 216 static CpuProfile* FindProfile(Object* security_token, unsigned uid); | 216 static CpuProfile* FindProfile(Object* security_token, unsigned uid); |
| 217 static void DeleteAllProfiles(); | 217 static void DeleteAllProfiles(); |
| 218 static void DeleteProfile(CpuProfile* profile); | 218 static void DeleteProfile(CpuProfile* profile); |
| 219 static bool HasDetachedProfiles(); | 219 static bool HasDetachedProfiles(); |
| 220 | 220 |
| 221 // Invoked from stack sampler (thread or signal handler.) | 221 // Invoked from stack sampler (thread or signal handler.) |
| 222 static TickSample* TickSampleEvent(Isolate* isolate); | 222 static TickSample* TickSampleEvent(Isolate* isolate); |
| 223 | 223 |
| 224 // Must be called via PROFILE macro, otherwise will crash when | 224 // Must be called via PROFILE macro, otherwise will crash when |
| 225 // profiling is not enabled. | 225 // profiling is not enabled. |
| 226 static void CallbackEvent(String* name, Address entry_point); | 226 static void CallbackEvent(String* name, Address entry_point); |
| 227 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 227 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 228 Code* code, const char* comment); | 228 Code* code, const char* comment); |
| 229 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 229 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 230 Code* code, String* name); | 230 Code* code, String* name); |
| 231 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 231 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 232 Code* code, | 232 Code* code, |
| 233 SharedFunctionInfo *shared, | 233 SharedFunctionInfo* shared, |
| 234 String* name); | 234 String* name); |
| 235 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 235 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 236 Code* code, | 236 Code* code, |
| 237 SharedFunctionInfo *shared, | 237 SharedFunctionInfo* shared, |
| 238 String* source, int line); | 238 String* source, int line); |
| 239 static void CodeCreateEvent(Logger::LogEventsAndTags tag, | 239 static void CodeCreateEvent(Logger::LogEventsAndTags tag, |
| 240 Code* code, int args_count); | 240 Code* code, int args_count); |
| 241 static void CodeMovingGCEvent() {} | 241 static void CodeMovingGCEvent() {} |
| 242 static void CodeMoveEvent(Address from, Address to); | 242 static void CodeMoveEvent(Address from, Address to); |
| 243 static void CodeDeleteEvent(Address from); | 243 static void CodeDeleteEvent(Address from); |
| 244 static void GetterCallbackEvent(String* name, Address entry_point); | 244 static void GetterCallbackEvent(String* name, Address entry_point); |
| 245 static void RegExpCodeCreateEvent(Code* code, String* source); | 245 static void RegExpCodeCreateEvent(Code* code, String* source); |
| 246 static void SetterCallbackEvent(String* name, Address entry_point); | 246 static void SetterCallbackEvent(String* name, Address entry_point); |
| 247 static void SharedFunctionInfoMoveEvent(Address from, Address to); | 247 static void SharedFunctionInfoMoveEvent(Address from, Address to); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 275 Atomic32 is_profiling_; | 275 Atomic32 is_profiling_; |
| 276 | 276 |
| 277 private: | 277 private: |
| 278 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); | 278 DISALLOW_COPY_AND_ASSIGN(CpuProfiler); |
| 279 }; | 279 }; |
| 280 | 280 |
| 281 } } // namespace v8::internal | 281 } } // namespace v8::internal |
| 282 | 282 |
| 283 | 283 |
| 284 #endif // V8_CPU_PROFILER_H_ | 284 #endif // V8_CPU_PROFILER_H_ |
| OLD | NEW |