| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 Isolate* isolate_; | 303 Isolate* isolate_; |
| 304 const char* name_; | 304 const char* name_; |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 // ==== Events logged by --log-regexp ==== | 307 // ==== Events logged by --log-regexp ==== |
| 308 // Regexp compilation and execution events. | 308 // Regexp compilation and execution events. |
| 309 | 309 |
| 310 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); | 310 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); |
| 311 | 311 |
| 312 // Log an event reported from generated code | 312 // Log an event reported from generated code |
| 313 void LogRuntime(Vector<const char> format, JSArray* args); | 313 void LogRuntime(Isolate* isolate, Vector<const char> format, JSArray* args); |
| 314 | 314 |
| 315 bool is_logging() { | 315 bool is_logging() { |
| 316 return logging_nesting_ > 0; | 316 return logging_nesting_ > 0; |
| 317 } | 317 } |
| 318 | 318 |
| 319 bool is_logging_code_events() { | 319 bool is_logging_code_events() { |
| 320 return is_logging() || code_event_handler_ != NULL; | 320 return is_logging() || code_event_handler_ != NULL; |
| 321 } | 321 } |
| 322 | 322 |
| 323 // Pause/Resume collection of profiling data. | 323 // Pause/Resume collection of profiling data. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 348 static const int kSamplingIntervalMs = 1; | 348 static const int kSamplingIntervalMs = 1; |
| 349 #endif | 349 #endif |
| 350 | 350 |
| 351 // Callback from Log, stops profiling in case of insufficient resources. | 351 // Callback from Log, stops profiling in case of insufficient resources. |
| 352 void LogFailure(); | 352 void LogFailure(); |
| 353 | 353 |
| 354 private: | 354 private: |
| 355 class NameBuffer; | 355 class NameBuffer; |
| 356 class NameMap; | 356 class NameMap; |
| 357 | 357 |
| 358 Logger(); | 358 explicit Logger(Isolate* isolate); |
| 359 ~Logger(); | 359 ~Logger(); |
| 360 | 360 |
| 361 // Issue code notifications. | 361 // Issue code notifications. |
| 362 void IssueCodeAddedEvent(Code* code, const char* name, size_t name_len); | 362 void IssueCodeAddedEvent(Code* code, const char* name, size_t name_len); |
| 363 void IssueCodeMovedEvent(Address from, Address to); | 363 void IssueCodeMovedEvent(Address from, Address to); |
| 364 void IssueCodeRemovedEvent(Address from); | 364 void IssueCodeRemovedEvent(Address from); |
| 365 | 365 |
| 366 // Emits the profiler's first message. | 366 // Emits the profiler's first message. |
| 367 void ProfilerBeginEvent(); | 367 void ProfilerBeginEvent(); |
| 368 | 368 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 // Logs a StringEvent regardless of whether FLAG_log is true. | 415 // Logs a StringEvent regardless of whether FLAG_log is true. |
| 416 void UncheckedStringEvent(const char* name, const char* value); | 416 void UncheckedStringEvent(const char* name, const char* value); |
| 417 | 417 |
| 418 // Logs an IntEvent regardless of whether FLAG_log is true. | 418 // Logs an IntEvent regardless of whether FLAG_log is true. |
| 419 void UncheckedIntEvent(const char* name, int value); | 419 void UncheckedIntEvent(const char* name, int value); |
| 420 void UncheckedIntPtrTEvent(const char* name, intptr_t value); | 420 void UncheckedIntPtrTEvent(const char* name, intptr_t value); |
| 421 | 421 |
| 422 // Returns whether profiler's sampler is active. | 422 // Returns whether profiler's sampler is active. |
| 423 bool IsProfilerSamplerActive(); | 423 bool IsProfilerSamplerActive(); |
| 424 | 424 |
| 425 Isolate* isolate_; |
| 426 |
| 425 // The sampler used by the profiler and the sliding state window. | 427 // The sampler used by the profiler and the sliding state window. |
| 426 Ticker* ticker_; | 428 Ticker* ticker_; |
| 427 | 429 |
| 428 // When the statistical profile is active, profiler_ | 430 // When the statistical profile is active, profiler_ |
| 429 // points to a Profiler, that handles collection | 431 // points to a Profiler, that handles collection |
| 430 // of samples. | 432 // of samples. |
| 431 Profiler* profiler_; | 433 Profiler* profiler_; |
| 432 | 434 |
| 433 // An array of log events names. | 435 // An array of log events names. |
| 434 const char* const* log_events_; | 436 const char* const* log_events_; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 // Class that extracts stack trace, used for profiling. | 518 // Class that extracts stack trace, used for profiling. |
| 517 class StackTracer : public AllStatic { | 519 class StackTracer : public AllStatic { |
| 518 public: | 520 public: |
| 519 static void Trace(Isolate* isolate, TickSample* sample); | 521 static void Trace(Isolate* isolate, TickSample* sample); |
| 520 }; | 522 }; |
| 521 | 523 |
| 522 } } // namespace v8::internal | 524 } } // namespace v8::internal |
| 523 | 525 |
| 524 | 526 |
| 525 #endif // V8_LOG_H_ | 527 #endif // V8_LOG_H_ |
| OLD | NEW |