Chromium Code Reviews| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 84 } while (false) | 84 } while (false) |
| 85 #else | 85 #else |
| 86 #define LOG(Call) ((void) 0) | 86 #define LOG(Call) ((void) 0) |
| 87 #endif | 87 #endif |
| 88 | 88 |
| 89 #define LOG_EVENTS_AND_TAGS_LIST(V) \ | 89 #define LOG_EVENTS_AND_TAGS_LIST(V) \ |
| 90 V(CODE_CREATION_EVENT, "code-creation") \ | 90 V(CODE_CREATION_EVENT, "code-creation") \ |
| 91 V(CODE_MOVE_EVENT, "code-move") \ | 91 V(CODE_MOVE_EVENT, "code-move") \ |
| 92 V(CODE_DELETE_EVENT, "code-delete") \ | 92 V(CODE_DELETE_EVENT, "code-delete") \ |
| 93 V(CODE_MOVING_GC, "code-moving-gc") \ | 93 V(CODE_MOVING_GC, "code-moving-gc") \ |
| 94 V(FUNCTION_CREATION_EVENT, "function-creation") \ | 94 V(SFI_MOVE_EVENT, "sfi-move") \ |
| 95 V(FUNCTION_MOVE_EVENT, "function-move") \ | |
| 96 V(FUNCTION_DELETE_EVENT, "function-delete") \ | |
| 97 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ | 95 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ |
| 98 V(TICK_EVENT, "tick") \ | 96 V(TICK_EVENT, "tick") \ |
| 99 V(REPEAT_META_EVENT, "repeat") \ | 97 V(REPEAT_META_EVENT, "repeat") \ |
| 100 V(BUILTIN_TAG, "Builtin") \ | 98 V(BUILTIN_TAG, "Builtin") \ |
| 101 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \ | 99 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \ |
| 102 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \ | 100 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \ |
| 103 V(CALL_IC_TAG, "CallIC") \ | 101 V(CALL_IC_TAG, "CallIC") \ |
| 104 V(CALL_INITIALIZE_TAG, "CallInitialize") \ | 102 V(CALL_INITIALIZE_TAG, "CallInitialize") \ |
| 105 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \ | 103 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \ |
| 106 V(CALL_MISS_TAG, "CallMiss") \ | 104 V(CALL_MISS_TAG, "CallMiss") \ |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 198 | 196 |
| 199 | 197 |
| 200 // ==== Events logged by --log-code. ==== | 198 // ==== Events logged by --log-code. ==== |
| 201 // Emits a code event for a callback function. | 199 // Emits a code event for a callback function. |
| 202 static void CallbackEvent(String* name, Address entry_point); | 200 static void CallbackEvent(String* name, Address entry_point); |
| 203 static void GetterCallbackEvent(String* name, Address entry_point); | 201 static void GetterCallbackEvent(String* name, Address entry_point); |
| 204 static void SetterCallbackEvent(String* name, Address entry_point); | 202 static void SetterCallbackEvent(String* name, Address entry_point); |
| 205 // Emits a code create event. | 203 // Emits a code create event. |
| 206 static void CodeCreateEvent(LogEventsAndTags tag, | 204 static void CodeCreateEvent(LogEventsAndTags tag, |
| 207 Code* code, const char* source); | 205 Code* code, const char* source); |
| 208 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name); | 206 static void CodeCreateEvent(LogEventsAndTags tag, |
| 209 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name, | 207 Code* code, String* name); |
| 208 static void CodeCreateEvent(LogEventsAndTags tag, | |
| 209 Code* code, | |
| 210 SharedFunctionInfo *shared, | |
|
Vitaly Repeshko
2011/02/22 15:11:19
nit: Move *.
mnaganov (inactive)
2011/02/22 16:18:22
Done.
| |
| 211 String* name); | |
| 212 static void CodeCreateEvent(LogEventsAndTags tag, | |
| 213 Code* code, | |
| 214 SharedFunctionInfo *shared, | |
|
Vitaly Repeshko
2011/02/22 15:11:19
Same nit.
mnaganov (inactive)
2011/02/22 16:18:22
Done.
| |
| 210 String* source, int line); | 215 String* source, int line); |
| 211 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count); | 216 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count); |
| 212 static void CodeMovingGCEvent(); | 217 static void CodeMovingGCEvent(); |
| 213 // Emits a code create event for a RegExp. | 218 // Emits a code create event for a RegExp. |
| 214 static void RegExpCodeCreateEvent(Code* code, String* source); | 219 static void RegExpCodeCreateEvent(Code* code, String* source); |
| 215 // Emits a code move event. | 220 // Emits a code move event. |
| 216 static void CodeMoveEvent(Address from, Address to); | 221 static void CodeMoveEvent(Address from, Address to); |
| 217 // Emits a code delete event. | 222 // Emits a code delete event. |
| 218 static void CodeDeleteEvent(Address from); | 223 static void CodeDeleteEvent(Address from); |
| 219 // Emits a function object create event. | 224 |
| 220 static void FunctionCreateEvent(JSFunction* function); | 225 static void SFIMoveEvent(Address from, Address to); |
| 221 static void FunctionCreateEventFromMove(JSFunction* function); | |
| 222 // Emits a function move event. | |
| 223 static void FunctionMoveEvent(Address from, Address to); | |
| 224 // Emits a function delete event. | |
| 225 static void FunctionDeleteEvent(Address from); | |
| 226 | 226 |
| 227 static void SnapshotPositionEvent(Address addr, int pos); | 227 static void SnapshotPositionEvent(Address addr, int pos); |
| 228 | 228 |
| 229 // ==== Events logged by --log-gc. ==== | 229 // ==== Events logged by --log-gc. ==== |
| 230 // Heap sampling events: start, end, and individual types. | 230 // Heap sampling events: start, end, and individual types. |
| 231 static void HeapSampleBeginEvent(const char* space, const char* kind); | 231 static void HeapSampleBeginEvent(const char* space, const char* kind); |
| 232 static void HeapSampleEndEvent(const char* space, const char* kind); | 232 static void HeapSampleEndEvent(const char* space, const char* kind); |
| 233 static void HeapSampleItemEvent(const char* type, int number, int bytes); | 233 static void HeapSampleItemEvent(const char* type, int number, int bytes); |
| 234 static void HeapSampleJSConstructorEvent(const char* constructor, | 234 static void HeapSampleJSConstructorEvent(const char* constructor, |
| 235 int number, int bytes); | 235 int number, int bytes); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 266 static void PauseProfiler(int flags, int tag); | 266 static void PauseProfiler(int flags, int tag); |
| 267 static void ResumeProfiler(int flags, int tag); | 267 static void ResumeProfiler(int flags, int tag); |
| 268 static int GetActiveProfilerModules(); | 268 static int GetActiveProfilerModules(); |
| 269 | 269 |
| 270 // If logging is performed into a memory buffer, allows to | 270 // If logging is performed into a memory buffer, allows to |
| 271 // retrieve previously written messages. See v8.h. | 271 // retrieve previously written messages. See v8.h. |
| 272 static int GetLogLines(int from_pos, char* dest_buf, int max_size); | 272 static int GetLogLines(int from_pos, char* dest_buf, int max_size); |
| 273 | 273 |
| 274 // Logs all compiled functions found in the heap. | 274 // Logs all compiled functions found in the heap. |
| 275 static void LogCompiledFunctions(); | 275 static void LogCompiledFunctions(); |
| 276 // Logs all compiled JSFunction objects found in the heap. | |
| 277 static void LogFunctionObjects(); | |
| 278 // Logs all accessor callbacks found in the heap. | 276 // Logs all accessor callbacks found in the heap. |
| 279 static void LogAccessorCallbacks(); | 277 static void LogAccessorCallbacks(); |
| 280 // Used for logging stubs found in the snapshot. | 278 // Used for logging stubs found in the snapshot. |
| 281 static void LogCodeObjects(); | 279 static void LogCodeObjects(); |
| 282 | 280 |
| 283 // Converts tag to a corresponding NATIVE_... if the script is native. | 281 // Converts tag to a corresponding NATIVE_... if the script is native. |
| 284 INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script*)); | 282 INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script*)); |
| 285 | 283 |
| 286 // Profiler's sampling interval (in milliseconds). | 284 // Profiler's sampling interval (in milliseconds). |
| 287 static const int kSamplingIntervalMs = 1; | 285 static const int kSamplingIntervalMs = 1; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 372 // Class that extracts stack trace, used for profiling. | 370 // Class that extracts stack trace, used for profiling. |
| 373 class StackTracer : public AllStatic { | 371 class StackTracer : public AllStatic { |
| 374 public: | 372 public: |
| 375 static void Trace(TickSample* sample); | 373 static void Trace(TickSample* sample); |
| 376 }; | 374 }; |
| 377 | 375 |
| 378 } } // namespace v8::internal | 376 } } // namespace v8::internal |
| 379 | 377 |
| 380 | 378 |
| 381 #endif // V8_LOG_H_ | 379 #endif // V8_LOG_H_ |
| OLD | NEW |