| 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" |
| 11 #include "src/base/platform/elapsed-timer.h" |
| 12 #include "src/base/platform/platform.h" |
| 11 #include "src/objects.h" | 13 #include "src/objects.h" |
| 12 #include "src/platform.h" | |
| 13 #include "src/platform/elapsed-timer.h" | |
| 14 | 14 |
| 15 namespace v8 { | 15 namespace v8 { |
| 16 |
| 17 namespace base { |
| 18 class Semaphore; |
| 19 } |
| 20 |
| 16 namespace internal { | 21 namespace internal { |
| 17 | 22 |
| 18 // Logger is used for collecting logging information from V8 during | 23 // Logger is used for collecting logging information from V8 during |
| 19 // execution. The result is dumped to a file. | 24 // execution. The result is dumped to a file. |
| 20 // | 25 // |
| 21 // Available command line flags: | 26 // Available command line flags: |
| 22 // | 27 // |
| 23 // --log | 28 // --log |
| 24 // Minimal logging (no API, code, or GC sample events), default is off. | 29 // Minimal logging (no API, code, or GC sample events), default is off. |
| 25 // | 30 // |
| (...skipping 24 matching lines...) Expand all Loading... |
| 50 // tick profiler requires code events, so --prof implies --log-code. | 55 // tick profiler requires code events, so --prof implies --log-code. |
| 51 | 56 |
| 52 // Forward declarations. | 57 // Forward declarations. |
| 53 class CodeEventListener; | 58 class CodeEventListener; |
| 54 class CompilationInfo; | 59 class CompilationInfo; |
| 55 class CpuProfiler; | 60 class CpuProfiler; |
| 56 class Isolate; | 61 class Isolate; |
| 57 class Log; | 62 class Log; |
| 58 class PositionsRecorder; | 63 class PositionsRecorder; |
| 59 class Profiler; | 64 class Profiler; |
| 60 class Semaphore; | |
| 61 class Ticker; | 65 class Ticker; |
| 62 struct TickSample; | 66 struct TickSample; |
| 63 | 67 |
| 64 #undef LOG | 68 #undef LOG |
| 65 #define LOG(isolate, Call) \ | 69 #define LOG(isolate, Call) \ |
| 66 do { \ | 70 do { \ |
| 67 v8::internal::Logger* logger = \ | 71 v8::internal::Logger* logger = \ |
| 68 (isolate)->logger(); \ | 72 (isolate)->logger(); \ |
| 69 if (logger->is_logging()) \ | 73 if (logger->is_logging()) \ |
| 70 logger->Call; \ | 74 logger->Call; \ |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 PerfBasicLogger* perf_basic_logger_; | 433 PerfBasicLogger* perf_basic_logger_; |
| 430 PerfJitLogger* perf_jit_logger_; | 434 PerfJitLogger* perf_jit_logger_; |
| 431 LowLevelLogger* ll_logger_; | 435 LowLevelLogger* ll_logger_; |
| 432 JitLogger* jit_logger_; | 436 JitLogger* jit_logger_; |
| 433 List<CodeEventListener*> listeners_; | 437 List<CodeEventListener*> listeners_; |
| 434 | 438 |
| 435 // Guards against multiple calls to TearDown() that can happen in some tests. | 439 // Guards against multiple calls to TearDown() that can happen in some tests. |
| 436 // 'true' between SetUp() and TearDown(). | 440 // 'true' between SetUp() and TearDown(). |
| 437 bool is_initialized_; | 441 bool is_initialized_; |
| 438 | 442 |
| 439 ElapsedTimer timer_; | 443 base::ElapsedTimer timer_; |
| 440 | 444 |
| 441 friend class CpuProfiler; | 445 friend class CpuProfiler; |
| 442 }; | 446 }; |
| 443 | 447 |
| 444 | 448 |
| 445 class CodeEventListener { | 449 class CodeEventListener { |
| 446 public: | 450 public: |
| 447 virtual ~CodeEventListener() {} | 451 virtual ~CodeEventListener() {} |
| 448 | 452 |
| 449 virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, | 453 virtual void CodeCreateEvent(Logger::LogEventsAndTags tag, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 int length) = 0; | 524 int length) = 0; |
| 521 | 525 |
| 522 NameBuffer* name_buffer_; | 526 NameBuffer* name_buffer_; |
| 523 }; | 527 }; |
| 524 | 528 |
| 525 | 529 |
| 526 } } // namespace v8::internal | 530 } } // namespace v8::internal |
| 527 | 531 |
| 528 | 532 |
| 529 #endif // V8_LOG_H_ | 533 #endif // V8_LOG_H_ |
| OLD | NEW |