| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 #define LOG(Call) \ | 76 #define LOG(Call) \ |
| 77 do { \ | 77 do { \ |
| 78 if (v8::internal::Logger::is_enabled()) \ | 78 if (v8::internal::Logger::is_enabled()) \ |
| 79 v8::internal::Logger::Call; \ | 79 v8::internal::Logger::Call; \ |
| 80 } while (false) | 80 } while (false) |
| 81 #else | 81 #else |
| 82 #define LOG(Call) ((void) 0) | 82 #define LOG(Call) ((void) 0) |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 | 85 |
| 86 class VMState { | 86 class VMState BASE_EMBEDDED { |
| 87 #ifdef ENABLE_LOGGING_AND_PROFILING | 87 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 88 public: | 88 public: |
| 89 explicit VMState(StateTag state); | 89 explicit VMState(StateTag state); |
| 90 ~VMState(); | 90 ~VMState(); |
| 91 | 91 |
| 92 StateTag state() { return state_; } | 92 StateTag state() { return state_; } |
| 93 | 93 |
| 94 private: | 94 private: |
| 95 StateTag state_; | 95 StateTag state_; |
| 96 VMState* previous_; | 96 VMState* previous_; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // of samples. | 245 // of samples. |
| 246 static Profiler* profiler_; | 246 static Profiler* profiler_; |
| 247 | 247 |
| 248 // mutex_ is a Mutex used for enforcing exclusive | 248 // mutex_ is a Mutex used for enforcing exclusive |
| 249 // access to the formatting buffer and the log file. | 249 // access to the formatting buffer and the log file. |
| 250 static Mutex* mutex_; | 250 static Mutex* mutex_; |
| 251 | 251 |
| 252 // A stack of VM states. | 252 // A stack of VM states. |
| 253 static VMState* current_state_; | 253 static VMState* current_state_; |
| 254 | 254 |
| 255 // Singleton bottom or default vm state. |
| 256 static VMState bottom_state_; |
| 257 |
| 255 // SlidingStateWindow instance keeping a sliding window of the most | 258 // SlidingStateWindow instance keeping a sliding window of the most |
| 256 // recent VM states. | 259 // recent VM states. |
| 257 static SlidingStateWindow* sliding_state_window_; | 260 static SlidingStateWindow* sliding_state_window_; |
| 258 | 261 |
| 259 // Internal implementation classes with access to | 262 // Internal implementation classes with access to |
| 260 // private members. | 263 // private members. |
| 261 friend class LogMessageBuilder; | 264 friend class LogMessageBuilder; |
| 262 friend class EventLog; | 265 friend class EventLog; |
| 263 friend class TimeLog; | 266 friend class TimeLog; |
| 264 friend class Profiler; | 267 friend class Profiler; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 278 void Trace(TickSample* sample); | 281 void Trace(TickSample* sample); |
| 279 private: | 282 private: |
| 280 | 283 |
| 281 unsigned int low_stack_bound_; | 284 unsigned int low_stack_bound_; |
| 282 }; | 285 }; |
| 283 | 286 |
| 284 | 287 |
| 285 } } // namespace v8::internal | 288 } } // namespace v8::internal |
| 286 | 289 |
| 287 #endif // V8_LOG_H_ | 290 #endif // V8_LOG_H_ |
| OLD | NEW |