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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 V(REPEAT_META_EVENT, "repeat", "r") \ | 115 V(REPEAT_META_EVENT, "repeat", "r") \ |
116 V(BUILTIN_TAG, "Builtin", "bi") \ | 116 V(BUILTIN_TAG, "Builtin", "bi") \ |
117 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak", "cdb") \ | 117 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak", "cdb") \ |
118 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn", "cdbsi") \ | 118 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn", "cdbsi") \ |
119 V(CALL_IC_TAG, "CallIC", "cic") \ | 119 V(CALL_IC_TAG, "CallIC", "cic") \ |
120 V(CALL_INITIALIZE_TAG, "CallInitialize", "ci") \ | 120 V(CALL_INITIALIZE_TAG, "CallInitialize", "ci") \ |
121 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic", "cmm") \ | 121 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic", "cmm") \ |
122 V(CALL_MISS_TAG, "CallMiss", "cm") \ | 122 V(CALL_MISS_TAG, "CallMiss", "cm") \ |
123 V(CALL_NORMAL_TAG, "CallNormal", "cn") \ | 123 V(CALL_NORMAL_TAG, "CallNormal", "cn") \ |
124 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic", "cpm") \ | 124 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic", "cpm") \ |
| 125 V(CALLBACK_TAG, "Callback", "cb") \ |
125 V(EVAL_TAG, "Eval", "e") \ | 126 V(EVAL_TAG, "Eval", "e") \ |
126 V(FUNCTION_TAG, "Function", "f") \ | 127 V(FUNCTION_TAG, "Function", "f") \ |
127 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC", "klic") \ | 128 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC", "klic") \ |
128 V(KEYED_STORE_IC_TAG, "KeyedStoreIC", "ksic") \ | 129 V(KEYED_STORE_IC_TAG, "KeyedStoreIC", "ksic") \ |
129 V(LAZY_COMPILE_TAG, "LazyCompile", "lc") \ | 130 V(LAZY_COMPILE_TAG, "LazyCompile", "lc") \ |
130 V(LOAD_IC_TAG, "LoadIC", "lic") \ | 131 V(LOAD_IC_TAG, "LoadIC", "lic") \ |
131 V(REG_EXP_TAG, "RegExp", "re") \ | 132 V(REG_EXP_TAG, "RegExp", "re") \ |
132 V(SCRIPT_TAG, "Script", "sc") \ | 133 V(SCRIPT_TAG, "Script", "sc") \ |
133 V(STORE_IC_TAG, "StoreIC", "sic") \ | 134 V(STORE_IC_TAG, "StoreIC", "sic") \ |
134 V(STUB_TAG, "Stub", "s") | 135 V(STUB_TAG, "Stub", "s") |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 JSObject* holder, | 194 JSObject* holder, |
194 Object* name); | 195 Object* name); |
195 static void ApiIndexedPropertyAccess(const char* tag, | 196 static void ApiIndexedPropertyAccess(const char* tag, |
196 JSObject* holder, | 197 JSObject* holder, |
197 uint32_t index); | 198 uint32_t index); |
198 static void ApiObjectAccess(const char* tag, JSObject* obj); | 199 static void ApiObjectAccess(const char* tag, JSObject* obj); |
199 static void ApiEntryCall(const char* name); | 200 static void ApiEntryCall(const char* name); |
200 | 201 |
201 | 202 |
202 // ==== Events logged by --log-code. ==== | 203 // ==== Events logged by --log-code. ==== |
| 204 // Emits a code event for a callback function. |
| 205 static void CallbackEvent(const char* class_name, const char* method_name, |
| 206 Address entry_point); |
203 // Emits a code create event. | 207 // Emits a code create event. |
204 static void CodeCreateEvent(LogEventsAndTags tag, | 208 static void CodeCreateEvent(LogEventsAndTags tag, |
205 Code* code, const char* source); | 209 Code* code, const char* source); |
206 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name); | 210 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name); |
207 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name, | 211 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, String* name, |
208 String* source, int line); | 212 String* source, int line); |
209 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count); | 213 static void CodeCreateEvent(LogEventsAndTags tag, Code* code, int args_count); |
210 // Emits a code create event for a RegExp. | 214 // Emits a code create event for a RegExp. |
211 static void RegExpCodeCreateEvent(Code* code, String* source); | 215 static void RegExpCodeCreateEvent(Code* code, String* source); |
212 // Emits a code move event. | 216 // Emits a code move event. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 static int GetActiveProfilerModules(); | 264 static int GetActiveProfilerModules(); |
261 | 265 |
262 // If logging is performed into a memory buffer, allows to | 266 // If logging is performed into a memory buffer, allows to |
263 // retrieve previously written messages. See v8.h. | 267 // retrieve previously written messages. See v8.h. |
264 static int GetLogLines(int from_pos, char* dest_buf, int max_size); | 268 static int GetLogLines(int from_pos, char* dest_buf, int max_size); |
265 | 269 |
266 // Logs all compiled functions found in the heap. | 270 // Logs all compiled functions found in the heap. |
267 static void LogCompiledFunctions(); | 271 static void LogCompiledFunctions(); |
268 // Used for logging stubs found in the snapshot. | 272 // Used for logging stubs found in the snapshot. |
269 static void LogCodeObject(Object* code_object); | 273 static void LogCodeObject(Object* code_object); |
| 274 // Used for logging callback entry points to be able to reveal their |
| 275 // names in call stacks when information about native code exports is |
| 276 // inaccessible. |
| 277 static void LogCallbacks(); |
270 | 278 |
271 private: | 279 private: |
272 | 280 |
273 // Profiler's sampling interval (in milliseconds). | 281 // Profiler's sampling interval (in milliseconds). |
274 static const int kSamplingIntervalMs = 1; | 282 static const int kSamplingIntervalMs = 1; |
275 | 283 |
276 // Size of window used for log records compression. | 284 // Size of window used for log records compression. |
277 static const int kCompressionWindowSize = 4; | 285 static const int kCompressionWindowSize = 4; |
278 | 286 |
279 // Emits the profiler's first message. | 287 // Emits the profiler's first message. |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // Class that extracts stack trace, used for profiling. | 352 // Class that extracts stack trace, used for profiling. |
345 class StackTracer : public AllStatic { | 353 class StackTracer : public AllStatic { |
346 public: | 354 public: |
347 static void Trace(TickSample* sample); | 355 static void Trace(TickSample* sample); |
348 }; | 356 }; |
349 | 357 |
350 | 358 |
351 } } // namespace v8::internal | 359 } } // namespace v8::internal |
352 | 360 |
353 #endif // V8_LOG_H_ | 361 #endif // V8_LOG_H_ |
OLD | NEW |