OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/log.h" | 5 #include "src/log.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 uintptr_t start, | 904 uintptr_t start, |
905 uintptr_t end) { | 905 uintptr_t end) { |
906 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; | 906 if (!log_->IsEnabled() || !FLAG_prof_cpp) return; |
907 Log::MessageBuilder msg(log_); | 907 Log::MessageBuilder msg(log_); |
908 msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR, | 908 msg.Append("shared-library,\"%s\",0x%08" V8PRIxPTR ",0x%08" V8PRIxPTR, |
909 library_path.c_str(), start, end); | 909 library_path.c_str(), start, end); |
910 msg.WriteToLogFile(); | 910 msg.WriteToLogFile(); |
911 } | 911 } |
912 | 912 |
913 | 913 |
914 void Logger::CodeDeoptEvent(Code* code) { | 914 void Logger::CodeDeoptEvent(Code* code, int bailout_id, Address from, |
915 if (!log_->IsEnabled()) return; | 915 int fp_to_sp_delta) { |
916 DCHECK(FLAG_log_internal_timer_events); | 916 PROFILER_LOG(CodeDeoptEvent(code, bailout_id, from, fp_to_sp_delta)); |
| 917 if (!log_->IsEnabled() || !FLAG_log_internal_timer_events) return; |
917 Log::MessageBuilder msg(log_); | 918 Log::MessageBuilder msg(log_); |
918 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 919 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
919 msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize()); | 920 msg.Append("code-deopt,%ld,%d", since_epoch, code->CodeSize()); |
920 msg.WriteToLogFile(); | 921 msg.WriteToLogFile(); |
921 } | 922 } |
922 | 923 |
923 | 924 |
924 void Logger::CurrentTimeEvent() { | 925 void Logger::CurrentTimeEvent() { |
925 if (!log_->IsEnabled()) return; | 926 if (!log_->IsEnabled()) return; |
926 DCHECK(FLAG_log_internal_timer_events); | 927 DCHECK(FLAG_log_internal_timer_events); |
(...skipping 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1933 if (jit_logger_) { | 1934 if (jit_logger_) { |
1934 removeCodeEventListener(jit_logger_); | 1935 removeCodeEventListener(jit_logger_); |
1935 delete jit_logger_; | 1936 delete jit_logger_; |
1936 jit_logger_ = NULL; | 1937 jit_logger_ = NULL; |
1937 } | 1938 } |
1938 | 1939 |
1939 return log_->Close(); | 1940 return log_->Close(); |
1940 } | 1941 } |
1941 | 1942 |
1942 } } // namespace v8::internal | 1943 } } // namespace v8::internal |
OLD | NEW |