Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 33cf8e271affd4dcb6bd2ae6d3e53ad1ff1e8005..0c1b76d7f42d6b3cc4e809517f89dba21f86586a 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -884,6 +884,21 @@ void Logger::HeapSampleItemEvent(const char* type, int number, int bytes) { |
} |
+void Logger::HeapSampleJSConstructorEvent(const char* constructor, |
+ int number, int bytes) { |
+#ifdef ENABLE_LOGGING_AND_PROFILING |
+ if (!Log::IsEnabled() || !FLAG_log_gc) return; |
+ LogMessageBuilder msg; |
+ msg.Append("heap-js-cons-item,%s,%d,%d\n", |
+ constructor != NULL ? |
+ (constructor[0] != '\0' ? constructor : "(anonymous)") : |
+ "(no_constructor)", |
+ number, bytes); |
+ msg.WriteToLogFile(); |
+#endif |
+} |
+ |
+ |
void Logger::DebugTag(const char* call_site_tag) { |
#ifdef ENABLE_LOGGING_AND_PROFILING |
if (!Log::IsEnabled() || !FLAG_log) return; |