bootstrapper_->Initialize(create_heap_objects);
builtins_.SetUp(this, create_heap_objects);
+ if (FLAG_log_internal_timer_events) {
+ set_event_logger(Logger::DefaultEventLoggerSentinel);
+ }
+
// Set default value if not yet set.
// TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults
// once ResourceConstraints becomes an argument to the Isolate constructor.
void Logger::CallEventLogger(Isolate* isolate, const char* name, StartEnd se,
bool expose_to_api) {
- if (isolate->event_logger() == NULL) {
- if (FLAG_log_internal_timer_events) LOG(isolate, TimerEvent(se, name));
- } else if (expose_to_api) {
- isolate->event_logger()(name, se);
+ if (isolate->event_logger() != NULL) {
+ if (isolate->event_logger() == DefaultEventLoggerSentinel) {
+ LOG(isolate, TimerEvent(se, name));
+ } else if (expose_to_api) {
+ isolate->event_logger()(name, se);
+ }
}
}
} } // namespace v8::internal
static void EnterExternal(Isolate* isolate);
static void LeaveExternal(Isolate* isolate);
- static inline void CallEventLogger(Isolate* isolate, const char* name,
- StartEnd se, bool expose_to_api);
+ static void DefaultEventLoggerSentinel(const char* name, int event) {}
+
+ INLINE(static void CallEventLogger(Isolate* isolate, const char* name,
+ StartEnd se, bool expose_to_api));
// ==== Events logged by --log-regexp ====
// Regexp compilation and execution events.