OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } while (false) | 92 } while (false) |
93 | 93 |
94 #define LOG_CODE_EVENT(isolate, Call) \ | 94 #define LOG_CODE_EVENT(isolate, Call) \ |
95 do { \ | 95 do { \ |
96 v8::internal::Logger* logger = \ | 96 v8::internal::Logger* logger = \ |
97 (isolate)->logger(); \ | 97 (isolate)->logger(); \ |
98 if (logger->is_logging_code_events()) \ | 98 if (logger->is_logging_code_events()) \ |
99 logger->Call; \ | 99 logger->Call; \ |
100 } while (false) | 100 } while (false) |
101 | 101 |
102 | |
103 #define LOG_EVENTS_AND_TAGS_LIST(V) \ | 102 #define LOG_EVENTS_AND_TAGS_LIST(V) \ |
104 V(CODE_CREATION_EVENT, "code-creation") \ | 103 V(CODE_CREATION_EVENT, "code-creation") \ |
105 V(CODE_MOVE_EVENT, "code-move") \ | 104 V(CODE_MOVE_EVENT, "code-move") \ |
106 V(CODE_DELETE_EVENT, "code-delete") \ | 105 V(CODE_DELETE_EVENT, "code-delete") \ |
107 V(CODE_MOVING_GC, "code-moving-gc") \ | 106 V(CODE_MOVING_GC, "code-moving-gc") \ |
108 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ | 107 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ |
109 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ | 108 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ |
110 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \ | 109 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \ |
111 V(TICK_EVENT, "tick") \ | 110 V(TICK_EVENT, "tick") \ |
112 V(REPEAT_META_EVENT, "repeat") \ | 111 V(REPEAT_META_EVENT, "repeat") \ |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 // ==== Events logged by --log-timer-events. ==== | 308 // ==== Events logged by --log-timer-events. ==== |
310 enum StartEnd { START, END }; | 309 enum StartEnd { START, END }; |
311 | 310 |
312 void CodeDeoptEvent(Code* code); | 311 void CodeDeoptEvent(Code* code); |
313 | 312 |
314 void TimerEvent(StartEnd se, const char* name); | 313 void TimerEvent(StartEnd se, const char* name); |
315 | 314 |
316 static void EnterExternal(Isolate* isolate); | 315 static void EnterExternal(Isolate* isolate); |
317 static void LeaveExternal(Isolate* isolate); | 316 static void LeaveExternal(Isolate* isolate); |
318 | 317 |
| 318 static void EmptyLogInternalEvents(const char* name, int se) { } |
| 319 static void LogInternalEvents(const char* name, int se); |
| 320 |
319 class TimerEventScope { | 321 class TimerEventScope { |
320 public: | 322 public: |
321 TimerEventScope(Isolate* isolate, const char* name) | 323 TimerEventScope(Isolate* isolate, const char* name) |
322 : isolate_(isolate), name_(name) { | 324 : isolate_(isolate), name_(name) { |
323 if (FLAG_log_internal_timer_events) LogTimerEvent(START); | 325 LogTimerEvent(START); |
324 } | 326 } |
325 | 327 |
326 ~TimerEventScope() { | 328 ~TimerEventScope() { |
327 if (FLAG_log_internal_timer_events) LogTimerEvent(END); | 329 LogTimerEvent(END); |
328 } | 330 } |
329 | 331 |
330 void LogTimerEvent(StartEnd se); | 332 void LogTimerEvent(StartEnd se); |
331 | 333 |
332 static const char* v8_recompile_synchronous; | 334 static const char* v8_recompile_synchronous; |
333 static const char* v8_recompile_concurrent; | 335 static const char* v8_recompile_concurrent; |
334 static const char* v8_compile_full_code; | 336 static const char* v8_compile_full_code; |
335 static const char* v8_execute; | 337 static const char* v8_execute; |
336 static const char* v8_external; | 338 static const char* v8_external; |
337 | 339 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 int length) = 0; | 539 int length) = 0; |
538 | 540 |
539 NameBuffer* name_buffer_; | 541 NameBuffer* name_buffer_; |
540 }; | 542 }; |
541 | 543 |
542 | 544 |
543 } } // namespace v8::internal | 545 } } // namespace v8::internal |
544 | 546 |
545 | 547 |
546 #endif // V8_LOG_H_ | 548 #endif // V8_LOG_H_ |
OLD | NEW |