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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 | 108 |
109 // See description in include/v8.h. | 109 // See description in include/v8.h. |
110 static int GetLogLines(int from_pos, char* dest_buf, int max_size); | 110 static int GetLogLines(int from_pos, char* dest_buf, int max_size); |
111 | 111 |
112 // Returns whether logging is enabled. | 112 // Returns whether logging is enabled. |
113 static bool IsEnabled() { | 113 static bool IsEnabled() { |
114 return !is_stopped_ && (output_handle_ != NULL || output_buffer_ != NULL); | 114 return !is_stopped_ && (output_handle_ != NULL || output_buffer_ != NULL); |
115 } | 115 } |
116 | 116 |
117 // Size of buffer used for formatting log messages. | 117 // Size of buffer used for formatting log messages. |
118 static const int kMessageBufferSize = 2048; | 118 static const int kMessageBufferSize = v8::V8::kMinimumSizeForLogLinesBuffer; |
119 | 119 |
120 private: | 120 private: |
121 typedef int (*WritePtr)(const char* msg, int length); | 121 typedef int (*WritePtr)(const char* msg, int length); |
122 | 122 |
123 // Initialization function called from Open... functions. | 123 // Initialization function called from Open... functions. |
124 static void Init(); | 124 static void Init(); |
125 | 125 |
126 // Write functions assume that mutex_ is acquired by the caller. | 126 // Write functions assume that mutex_ is acquired by the caller. |
127 static WritePtr Write; | 127 static WritePtr Write; |
128 | 128 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 ScopedLock sl; | 281 ScopedLock sl; |
282 int pos_; | 282 int pos_; |
283 }; | 283 }; |
284 | 284 |
285 #endif // ENABLE_LOGGING_AND_PROFILING | 285 #endif // ENABLE_LOGGING_AND_PROFILING |
286 | 286 |
287 } } // namespace v8::internal | 287 } } // namespace v8::internal |
288 | 288 |
289 #endif // V8_LOG_UTILS_H_ | 289 #endif // V8_LOG_UTILS_H_ |
OLD | NEW |