| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 LogDynamicBuffer* output_buffer_; | 157 LogDynamicBuffer* output_buffer_; |
| 158 | 158 |
| 159 // Size of dynamic buffer block (and dynamic buffer initial size). | 159 // Size of dynamic buffer block (and dynamic buffer initial size). |
| 160 static const int kDynamicBufferBlockSize = 65536; | 160 static const int kDynamicBufferBlockSize = 65536; |
| 161 | 161 |
| 162 // Maximum size of dynamic buffer. | 162 // Maximum size of dynamic buffer. |
| 163 static const int kMaxDynamicBufferSize = 50 * 1024 * 1024; | 163 static const int kMaxDynamicBufferSize = 50 * 1024 * 1024; |
| 164 | 164 |
| 165 // Message to "seal" dynamic buffer with. | 165 // Message to "seal" dynamic buffer with. |
| 166 static const char* kDynamicBufferSeal; | 166 static const char* const kDynamicBufferSeal; |
| 167 | 167 |
| 168 // mutex_ is a Mutex used for enforcing exclusive | 168 // mutex_ is a Mutex used for enforcing exclusive |
| 169 // access to the formatting buffer and the log file or log memory buffer. | 169 // access to the formatting buffer and the log file or log memory buffer. |
| 170 Mutex* mutex_; | 170 Mutex* mutex_; |
| 171 | 171 |
| 172 // Buffer used for formatting log messages. This is a singleton buffer and | 172 // Buffer used for formatting log messages. This is a singleton buffer and |
| 173 // mutex_ should be acquired before using it. | 173 // mutex_ should be acquired before using it. |
| 174 char* message_buffer_; | 174 char* message_buffer_; |
| 175 | 175 |
| 176 Logger* logger_; | 176 Logger* logger_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 203 // Returns true, if the record has been stored. | 203 // Returns true, if the record has been stored. |
| 204 bool Store(const Vector<const char>& record); | 204 bool Store(const Vector<const char>& record); |
| 205 | 205 |
| 206 private: | 206 private: |
| 207 // The minimum size of a buffer: a place needed for the current and | 207 // The minimum size of a buffer: a place needed for the current and |
| 208 // the previous record. Since there is no place for precedessors of a previous | 208 // the previous record. Since there is no place for precedessors of a previous |
| 209 // record, it can't be compressed at all. | 209 // record, it can't be compressed at all. |
| 210 static const int kNoCompressionWindowSize = 2; | 210 static const int kNoCompressionWindowSize = 2; |
| 211 | 211 |
| 212 // Formatting strings for back references. | 212 // Formatting strings for back references. |
| 213 static const char* kLineBackwardReferenceFormat; | 213 static const char* const kLineBackwardReferenceFormat; |
| 214 static const char* kBackwardReferenceFormat; | 214 static const char* const kBackwardReferenceFormat; |
| 215 | 215 |
| 216 static int GetBackwardReferenceSize(int distance, int pos); | 216 static int GetBackwardReferenceSize(int distance, int pos); |
| 217 | 217 |
| 218 static void PrintBackwardReference(Vector<char> dest, int distance, int pos); | 218 static void PrintBackwardReference(Vector<char> dest, int distance, int pos); |
| 219 | 219 |
| 220 ScopedVector< Vector<const char> > buffer_; | 220 ScopedVector< Vector<const char> > buffer_; |
| 221 const int kMaxBackwardReferenceSize; | 221 const int kMaxBackwardReferenceSize; |
| 222 int curr_; | 222 int curr_; |
| 223 int prev_; | 223 int prev_; |
| 224 }; | 224 }; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 Log* log_; | 279 Log* log_; |
| 280 ScopedLock sl; | 280 ScopedLock sl; |
| 281 int pos_; | 281 int pos_; |
| 282 }; | 282 }; |
| 283 | 283 |
| 284 #endif // ENABLE_LOGGING_AND_PROFILING | 284 #endif // ENABLE_LOGGING_AND_PROFILING |
| 285 | 285 |
| 286 } } // namespace v8::internal | 286 } } // namespace v8::internal |
| 287 | 287 |
| 288 #endif // V8_LOG_UTILS_H_ | 288 #endif // V8_LOG_UTILS_H_ |
| OLD | NEW |