Revision: 24624
Author:   [email protected]
Date:     Wed Oct 15 11:16:42 2014 UTC
Log:      Make event logger slightly more light-weight.

[email protected]
BUG=chromium:423668
LOG=N

Review URL: https://codereview.chromium.org/651413002
https://code.google.com/p/v8/source/detail?r=24624

Modified:
 /branches/bleeding_edge/src/isolate.cc
 /branches/bleeding_edge/src/log-inl.h
 /branches/bleeding_edge/src/log.h

=======================================
--- /branches/bleeding_edge/src/isolate.cc      Tue Oct 14 14:45:03 2014 UTC
+++ /branches/bleeding_edge/src/isolate.cc      Wed Oct 15 11:16:42 2014 UTC
@@ -1911,6 +1911,10 @@
   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.
=======================================
--- /branches/bleeding_edge/src/log-inl.h       Tue Oct 14 14:45:03 2014 UTC
+++ /branches/bleeding_edge/src/log-inl.h       Wed Oct 15 11:16:42 2014 UTC
@@ -29,10 +29,12 @@

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
=======================================
--- /branches/bleeding_edge/src/log.h   Tue Oct 14 14:45:03 2014 UTC
+++ /branches/bleeding_edge/src/log.h   Wed Oct 15 11:16:42 2014 UTC
@@ -300,8 +300,10 @@
   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.

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to