9 #include "src/isolate.h" 10 #include "src/objects-inl.h" 11 #include "src/tracing/trace-event.h" 16 CodeEventListener::LogEventsAndTags Logger::ToNativeByScript(
17 CodeEventListener::LogEventsAndTags tag, Script* script) {
18 if (script->type() != Script::TYPE_NATIVE)
return tag;
20 case CodeEventListener::FUNCTION_TAG:
21 return CodeEventListener::NATIVE_FUNCTION_TAG;
22 case CodeEventListener::LAZY_COMPILE_TAG:
23 return CodeEventListener::NATIVE_LAZY_COMPILE_TAG;
24 case CodeEventListener::SCRIPT_TAG:
25 return CodeEventListener::NATIVE_SCRIPT_TAG;
31 void Logger::CallEventLogger(Isolate* isolate,
const char* name, StartEnd se,
33 if (isolate->event_logger()) {
34 if (isolate->event_logger() == DefaultEventLoggerSentinel) {
35 LOG(isolate, TimerEvent(se, name));
36 }
else if (expose_to_api) {
37 isolate->event_logger()(name, se);
42 template <
class TimerEvent>
43 void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) {
44 Logger::CallEventLogger(isolate_, TimerEvent::name(), se,
45 TimerEvent::expose_to_api());
51 #endif // V8_LOG_INL_H_