| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 intptr_t capacity, intptr_t used); | 266 intptr_t capacity, intptr_t used); |
| 267 | 267 |
| 268 void SharedLibraryEvent(const char* library_path, | 268 void SharedLibraryEvent(const char* library_path, |
| 269 uintptr_t start, | 269 uintptr_t start, |
| 270 uintptr_t end); | 270 uintptr_t end); |
| 271 void SharedLibraryEvent(const wchar_t* library_path, | 271 void SharedLibraryEvent(const wchar_t* library_path, |
| 272 uintptr_t start, | 272 uintptr_t start, |
| 273 uintptr_t end); | 273 uintptr_t end); |
| 274 | 274 |
| 275 // ==== Events logged by --log-timer-events. ==== | 275 // ==== Events logged by --log-timer-events. ==== |
| 276 void TimerEvent(const char* name, int64_t start, int64_t end); | 276 enum StartEnd { START, END }; |
| 277 void ExternalSwitch(StateTag old_tag, StateTag new_tag); | 277 |
| 278 void TimerEvent(StartEnd se, const char* name); |
| 278 | 279 |
| 279 static void EnterExternal(); | 280 static void EnterExternal(); |
| 280 static void LeaveExternal(); | 281 static void LeaveExternal(); |
| 281 | 282 |
| 282 class TimerEventScope { | 283 class TimerEventScope { |
| 283 public: | 284 public: |
| 284 TimerEventScope(Isolate* isolate, const char* name) | 285 TimerEventScope(Isolate* isolate, const char* name) |
| 285 : isolate_(isolate), name_(name), start_(0) { | 286 : isolate_(isolate), name_(name) { |
| 286 if (FLAG_log_internal_timer_events) start_ = OS::Ticks(); | 287 if (FLAG_log_internal_timer_events) LogTimerEvent(START); |
| 287 } | 288 } |
| 288 | 289 |
| 289 ~TimerEventScope() { | 290 ~TimerEventScope() { |
| 290 if (FLAG_log_internal_timer_events) LogTimerEvent(); | 291 if (FLAG_log_internal_timer_events) LogTimerEvent(END); |
| 291 } | 292 } |
| 292 | 293 |
| 293 void LogTimerEvent(); | 294 void LogTimerEvent(StartEnd se); |
| 294 | 295 |
| 295 static const char* v8_recompile_synchronous; | 296 static const char* v8_recompile_synchronous; |
| 296 static const char* v8_recompile_parallel; | 297 static const char* v8_recompile_parallel; |
| 297 static const char* v8_compile_full_code; | 298 static const char* v8_compile_full_code; |
| 298 static const char* v8_execute; | 299 static const char* v8_execute; |
| 300 static const char* v8_external; |
| 299 | 301 |
| 300 private: | 302 private: |
| 301 Isolate* isolate_; | 303 Isolate* isolate_; |
| 302 const char* name_; | 304 const char* name_; |
| 303 int64_t start_; | |
| 304 }; | 305 }; |
| 305 | 306 |
| 306 // ==== Events logged by --log-regexp ==== | 307 // ==== Events logged by --log-regexp ==== |
| 307 // Regexp compilation and execution events. | 308 // Regexp compilation and execution events. |
| 308 | 309 |
| 309 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); | 310 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); |
| 310 | 311 |
| 311 // Log an event reported from generated code | 312 // Log an event reported from generated code |
| 312 void LogRuntime(Vector<const char> format, JSArray* args); | 313 void LogRuntime(Vector<const char> format, JSArray* args); |
| 313 | 314 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 Address last_address_; | 467 Address last_address_; |
| 467 // Logger::TickEvent(...) | 468 // Logger::TickEvent(...) |
| 468 Address prev_sp_; | 469 Address prev_sp_; |
| 469 Address prev_function_; | 470 Address prev_function_; |
| 470 // Logger::MoveEventInternal(...) | 471 // Logger::MoveEventInternal(...) |
| 471 Address prev_to_; | 472 Address prev_to_; |
| 472 // Logger::FunctionCreateEvent(...) | 473 // Logger::FunctionCreateEvent(...) |
| 473 Address prev_code_; | 474 Address prev_code_; |
| 474 | 475 |
| 475 int64_t epoch_; | 476 int64_t epoch_; |
| 476 static int64_t enter_external_; | |
| 477 | 477 |
| 478 friend class CpuProfiler; | 478 friend class CpuProfiler; |
| 479 }; | 479 }; |
| 480 | 480 |
| 481 | 481 |
| 482 // Process wide registry of samplers. | 482 // Process wide registry of samplers. |
| 483 class SamplerRegistry : public AllStatic { | 483 class SamplerRegistry : public AllStatic { |
| 484 public: | 484 public: |
| 485 enum State { | 485 enum State { |
| 486 HAS_NO_SAMPLERS, | 486 HAS_NO_SAMPLERS, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 516 // Class that extracts stack trace, used for profiling. | 516 // Class that extracts stack trace, used for profiling. |
| 517 class StackTracer : public AllStatic { | 517 class StackTracer : public AllStatic { |
| 518 public: | 518 public: |
| 519 static void Trace(Isolate* isolate, TickSample* sample); | 519 static void Trace(Isolate* isolate, TickSample* sample); |
| 520 }; | 520 }; |
| 521 | 521 |
| 522 } } // namespace v8::internal | 522 } } // namespace v8::internal |
| 523 | 523 |
| 524 | 524 |
| 525 #endif // V8_LOG_H_ | 525 #endif // V8_LOG_H_ |
| OLD | NEW |