| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_LOG_H_ | 5 #ifndef V8_LOG_H_ |
| 6 #define V8_LOG_H_ | 6 #define V8_LOG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 static const char* v8_compile_full_code; | 318 static const char* v8_compile_full_code; |
| 319 static const char* v8_execute; | 319 static const char* v8_execute; |
| 320 static const char* v8_external; | 320 static const char* v8_external; |
| 321 static const char* v8_ic_miss; | 321 static const char* v8_ic_miss; |
| 322 | 322 |
| 323 private: | 323 private: |
| 324 Isolate* isolate_; | 324 Isolate* isolate_; |
| 325 const char* name_; | 325 const char* name_; |
| 326 }; | 326 }; |
| 327 | 327 |
| 328 class ExternalTimerEventScope { |
| 329 public: |
| 330 ExternalTimerEventScope(Isolate* isolate, const char* name) |
| 331 : isolate_(isolate), name_(name) { |
| 332 LogTimerEvent(START); |
| 333 } |
| 334 |
| 335 ~ExternalTimerEventScope() { |
| 336 LogTimerEvent(END); |
| 337 } |
| 338 |
| 339 void LogTimerEvent(StartEnd se); |
| 340 |
| 341 private: |
| 342 Isolate* isolate_; |
| 343 const char* name_; |
| 344 }; |
| 345 |
| 328 // ==== Events logged by --log-regexp ==== | 346 // ==== Events logged by --log-regexp ==== |
| 329 // Regexp compilation and execution events. | 347 // Regexp compilation and execution events. |
| 330 | 348 |
| 331 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); | 349 void RegExpCompileEvent(Handle<JSRegExp> regexp, bool in_cache); |
| 332 | 350 |
| 333 bool is_logging() { | 351 bool is_logging() { |
| 334 return is_logging_; | 352 return is_logging_; |
| 335 } | 353 } |
| 336 | 354 |
| 337 bool is_logging_code_events() { | 355 bool is_logging_code_events() { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 int length) = 0; | 538 int length) = 0; |
| 521 | 539 |
| 522 NameBuffer* name_buffer_; | 540 NameBuffer* name_buffer_; |
| 523 }; | 541 }; |
| 524 | 542 |
| 525 | 543 |
| 526 } } // namespace v8::internal | 544 } } // namespace v8::internal |
| 527 | 545 |
| 528 | 546 |
| 529 #endif // V8_LOG_H_ | 547 #endif // V8_LOG_H_ |
| OLD | NEW |