OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 FILE* Logger::logfile_ = NULL; | 252 FILE* Logger::logfile_ = NULL; |
253 Profiler* Logger::profiler_ = NULL; | 253 Profiler* Logger::profiler_ = NULL; |
254 Mutex* Logger::mutex_ = NULL; | 254 Mutex* Logger::mutex_ = NULL; |
255 VMState* Logger::current_state_ = NULL; | 255 VMState* Logger::current_state_ = NULL; |
256 SlidingStateWindow* Logger::sliding_state_window_ = NULL; | 256 SlidingStateWindow* Logger::sliding_state_window_ = NULL; |
257 | 257 |
258 #endif // ENABLE_LOGGING_AND_PROFILING | 258 #endif // ENABLE_LOGGING_AND_PROFILING |
259 | 259 |
260 void Logger::Preamble(const char* content) { | 260 void Logger::Preamble(const char* content) { |
261 #ifdef ENABLE_LOGGING_AND_PROFILING | 261 #ifdef ENABLE_LOGGING_AND_PROFILING |
262 if (logfile_ == NULL || !FLAG_log) return; | 262 if (logfile_ == NULL || !FLAG_log_code) return; |
263 ScopedLock sl(mutex_); | 263 ScopedLock sl(mutex_); |
264 fprintf(logfile_, "%s", content); | 264 fprintf(logfile_, "%s", content); |
265 #endif | 265 #endif |
266 } | 266 } |
267 | 267 |
268 | 268 |
269 void Logger::StringEvent(const char* name, const char* value) { | 269 void Logger::StringEvent(const char* name, const char* value) { |
270 #ifdef ENABLE_LOGGING_AND_PROFILING | 270 #ifdef ENABLE_LOGGING_AND_PROFILING |
271 if (logfile_ == NULL || !FLAG_log) return; | 271 if (logfile_ == NULL || !FLAG_log) return; |
272 ScopedLock sl(mutex_); | 272 ScopedLock sl(mutex_); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 if (FLAG_log_state_changes) { | 840 if (FLAG_log_state_changes) { |
841 LOG(StringEvent("Leaving", StateToString(state_))); | 841 LOG(StringEvent("Leaving", StateToString(state_))); |
842 if (previous_) { | 842 if (previous_) { |
843 LOG(StringEvent("To", StateToString(previous_->state_))); | 843 LOG(StringEvent("To", StateToString(previous_->state_))); |
844 } | 844 } |
845 } | 845 } |
846 } | 846 } |
847 #endif | 847 #endif |
848 | 848 |
849 } } // namespace v8::internal | 849 } } // namespace v8::internal |
OLD | NEW |