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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 virtual void* memory() = 0; | 212 virtual void* memory() = 0; |
213 }; | 213 }; |
214 | 214 |
215 // Safe formatting print. Ensures that str is always null-terminated. | 215 // Safe formatting print. Ensures that str is always null-terminated. |
216 // Returns the number of chars written, or -1 if output was truncated. | 216 // Returns the number of chars written, or -1 if output was truncated. |
217 static int SNPrintF(Vector<char> str, const char* format, ...); | 217 static int SNPrintF(Vector<char> str, const char* format, ...); |
218 static int VSNPrintF(Vector<char> str, | 218 static int VSNPrintF(Vector<char> str, |
219 const char* format, | 219 const char* format, |
220 va_list args); | 220 va_list args); |
221 | 221 |
| 222 static char* StrChr(char* str, int c); |
222 static void StrNCpy(Vector<char> dest, const char* src, size_t n); | 223 static void StrNCpy(Vector<char> dest, const char* src, size_t n); |
223 static char* StrDup(const char* str); | 224 static char* StrDup(const char* str); |
224 static char* StrNDup(const char* str, size_t n); | 225 static char* StrNDup(const char* str, size_t n); |
225 | 226 |
226 // Support for profiler. Can do nothing, in which case ticks | 227 // Support for profiler. Can do nothing, in which case ticks |
227 // occuring in shared libraries will not be properly accounted | 228 // occuring in shared libraries will not be properly accounted |
228 // for. | 229 // for. |
229 static void LogSharedLibraryAddresses(); | 230 static void LogSharedLibraryAddresses(); |
230 | 231 |
231 // Returns the double constant NAN | 232 // Returns the double constant NAN |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 bool active_; | 475 bool active_; |
475 PlatformData* data_; // Platform specific data. | 476 PlatformData* data_; // Platform specific data. |
476 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 477 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
477 }; | 478 }; |
478 | 479 |
479 #endif // ENABLE_LOGGING_AND_PROFILING | 480 #endif // ENABLE_LOGGING_AND_PROFILING |
480 | 481 |
481 } } // namespace v8::internal | 482 } } // namespace v8::internal |
482 | 483 |
483 #endif // V8_PLATFORM_H_ | 484 #endif // V8_PLATFORM_H_ |
OLD | NEW |