Index: src/log.cc |
diff --git a/src/log.cc b/src/log.cc |
index 623e08d8fae6b776c0c8dad24d294f6b18132f1f..5c88cb492c95a8adcbd44419ebfc73eb36a18c92 100644 |
--- a/src/log.cc |
+++ b/src/log.cc |
@@ -230,6 +230,7 @@ class PerfBasicLogger : public CodeEventLogger { |
virtual ~PerfBasicLogger(); |
virtual void CodeMoveEvent(Address from, Address to) { } |
+ virtual void CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) { } |
virtual void CodeDeleteEvent(Address from) { } |
private: |
@@ -295,6 +296,7 @@ class PerfJitLogger : public CodeEventLogger { |
virtual ~PerfJitLogger(); |
virtual void CodeMoveEvent(Address from, Address to) { } |
+ virtual void CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) { } |
virtual void CodeDeleteEvent(Address from) { } |
private: |
@@ -457,6 +459,7 @@ class LowLevelLogger : public CodeEventLogger { |
virtual ~LowLevelLogger(); |
virtual void CodeMoveEvent(Address from, Address to); |
+ virtual void CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) { } |
virtual void CodeDeleteEvent(Address from); |
virtual void SnapshotPositionEvent(Address addr, int pos); |
virtual void CodeMovingGCEvent(); |
@@ -623,6 +626,7 @@ class JitLogger : public CodeEventLogger { |
explicit JitLogger(JitCodeEventHandler code_event_handler); |
virtual void CodeMoveEvent(Address from, Address to); |
+ virtual void CodeDisableOptEvent(Code* code, SharedFunctionInfo* shared) { } |
virtual void CodeDeleteEvent(Address from); |
virtual void AddCodeLinePosInfoEvent( |
void* jit_handler_data, |
@@ -1446,6 +1450,24 @@ void Logger::CodeCreateEvent(LogEventsAndTags tag, |
} |
+void Logger::CodeDisableOptEvent(Code* code, |
+ SharedFunctionInfo* shared) { |
+ PROFILER_LOG(CodeDisableOptEvent(code, shared)); |
+ |
+ if (!is_logging_code_events()) return; |
+ CALL_LISTENERS(CodeDisableOptEvent(code, shared)); |
+ |
+ if (!FLAG_log_code || !log_->IsEnabled()) return; |
+ Log::MessageBuilder msg(log_); |
+ msg.Append("%s,", kLogEventsNames[CODE_DISABLE_OPT_EVENT]); |
+ SmartArrayPointer<char> name = |
+ shared->DebugName()->ToCString(DISALLOW_NULLS, ROBUST_STRING_TRAVERSAL); |
+ msg.Append("\"%s\",", name.get()); |
+ msg.Append("\"%s\"\n", GetBailoutReason(shared->DisableOptimizationReason())); |
+ msg.WriteToLogFile(); |
+} |
+ |
+ |
void Logger::CodeMovingGCEvent() { |
PROFILER_LOG(CodeMovingGCEvent()); |