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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 V(SCRIPT_TAG, "Script", "sc") \ | 141 V(SCRIPT_TAG, "Script", "sc") \ |
142 V(STORE_IC_TAG, "StoreIC", "sic") \ | 142 V(STORE_IC_TAG, "StoreIC", "sic") \ |
143 V(STUB_TAG, "Stub", "s") | 143 V(STUB_TAG, "Stub", "s") |
144 | 144 |
145 class Logger { | 145 class Logger { |
146 public: | 146 public: |
147 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item, | 147 #define DECLARE_ENUM(enum_item, ignore1, ignore2) enum_item, |
148 enum LogEventsAndTags { | 148 enum LogEventsAndTags { |
149 LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM) | 149 LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM) |
150 NUMBER_OF_LOG_EVENTS | 150 NUMBER_OF_LOG_EVENTS |
| 151 #ifdef ENABLE_CPP_PROFILES_PROCESSOR |
| 152 , NATIVE_FUNCTION_TAG |
| 153 , NATIVE_LAZY_COMPILE_TAG |
| 154 , NATIVE_SCRIPT_TAG |
| 155 #endif |
151 }; | 156 }; |
152 #undef DECLARE_ENUM | 157 #undef DECLARE_ENUM |
153 | 158 |
154 // Acquires resources for logging if the right flags are set. | 159 // Acquires resources for logging if the right flags are set. |
155 static bool Setup(); | 160 static bool Setup(); |
156 | 161 |
157 // Frees resources acquired in Setup. | 162 // Frees resources acquired in Setup. |
158 static void TearDown(); | 163 static void TearDown(); |
159 | 164 |
160 // Enable the computation of a sliding window of states. | 165 // Enable the computation of a sliding window of states. |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 285 |
281 // Logs all compiled functions found in the heap. | 286 // Logs all compiled functions found in the heap. |
282 static void LogCompiledFunctions(); | 287 static void LogCompiledFunctions(); |
283 // Logs all compiled JSFunction objects found in the heap. | 288 // Logs all compiled JSFunction objects found in the heap. |
284 static void LogFunctionObjects(); | 289 static void LogFunctionObjects(); |
285 // Logs all accessor callbacks found in the heap. | 290 // Logs all accessor callbacks found in the heap. |
286 static void LogAccessorCallbacks(); | 291 static void LogAccessorCallbacks(); |
287 // Used for logging stubs found in the snapshot. | 292 // Used for logging stubs found in the snapshot. |
288 static void LogCodeObjects(); | 293 static void LogCodeObjects(); |
289 | 294 |
| 295 // Converts tag to a corresponding NATIVE_... if the script is native. |
| 296 INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script*)); |
| 297 |
290 private: | 298 private: |
291 | 299 |
292 // Profiler's sampling interval (in milliseconds). | 300 // Profiler's sampling interval (in milliseconds). |
293 static const int kSamplingIntervalMs = 1; | 301 static const int kSamplingIntervalMs = 1; |
294 | 302 |
295 // Size of window used for log records compression. | 303 // Size of window used for log records compression. |
296 static const int kCompressionWindowSize = 4; | 304 static const int kCompressionWindowSize = 4; |
297 | 305 |
298 // Emits the profiler's first message. | 306 // Emits the profiler's first message. |
299 static void ProfilerBeginEvent(); | 307 static void ProfilerBeginEvent(); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 void SetProfiler(Profiler* profiler) { } | 416 void SetProfiler(Profiler* profiler) { } |
409 void ClearProfiler() { } | 417 void ClearProfiler() { } |
410 }; | 418 }; |
411 | 419 |
412 #endif // ENABLE_CPP_PROFILES_PROCESSOR | 420 #endif // ENABLE_CPP_PROFILES_PROCESSOR |
413 | 421 |
414 } } // namespace v8::internal | 422 } } // namespace v8::internal |
415 | 423 |
416 | 424 |
417 #endif // V8_LOG_H_ | 425 #endif // V8_LOG_H_ |
OLD | NEW |