diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2010-10-21 15:22:38 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-10-21 15:22:38 -0700 |
commit | 3b861db31d1ecc92149cf6b2497b6539276e0f70 (patch) | |
tree | 67c84f64183536213383373804520f84b931d865 /deps/v8/src/log-utils.cc | |
parent | 2629296c257b6d74e86e9f9139b04ba5e27b68d8 (diff) | |
download | node-new-3b861db31d1ecc92149cf6b2497b6539276e0f70.tar.gz |
Upgrade V8 to 2.5.1
Diffstat (limited to 'deps/v8/src/log-utils.cc')
-rw-r--r-- | deps/v8/src/log-utils.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/deps/v8/src/log-utils.cc b/deps/v8/src/log-utils.cc index 62f0ca62f4..d6d8754b23 100644 --- a/deps/v8/src/log-utils.cc +++ b/deps/v8/src/log-utils.cc @@ -122,6 +122,7 @@ int LogDynamicBuffer::WriteInternal(const char* data, int data_size) { bool Log::is_stopped_ = false; Log::WritePtr Log::Write = NULL; FILE* Log::output_handle_ = NULL; +FILE* Log::output_code_handle_ = NULL; LogDynamicBuffer* Log::output_buffer_ = NULL; // Must be the same message as in Logger::PauseProfiler. const char* Log::kDynamicBufferSeal = "profiler,\"pause\"\n"; @@ -143,9 +144,22 @@ void Log::OpenStdout() { } +static const char kCodeLogExt[] = ".code"; + + void Log::OpenFile(const char* name) { ASSERT(!IsEnabled()); output_handle_ = OS::FOpen(name, OS::LogFileOpenMode); + if (FLAG_ll_prof) { + // Open a file for logging the contents of code objects so that + // they can be disassembled later. + size_t name_len = strlen(name); + ScopedVector<char> code_name( + static_cast<int>(name_len + sizeof(kCodeLogExt))); + memcpy(code_name.start(), name, name_len); + memcpy(code_name.start() + name_len, kCodeLogExt, sizeof(kCodeLogExt)); + output_code_handle_ = OS::FOpen(code_name.start(), OS::LogFileOpenMode); + } Write = WriteToFile; Init(); } @@ -165,6 +179,8 @@ void Log::Close() { if (Write == WriteToFile) { if (output_handle_ != NULL) fclose(output_handle_); output_handle_ = NULL; + if (output_code_handle_ != NULL) fclose(output_code_handle_); + output_code_handle_ = NULL; } else if (Write == WriteToMemory) { delete output_buffer_; output_buffer_ = NULL; |