| 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/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
| (...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 927 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
| 928 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld" | 928 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld" |
| 929 : "timer-event-end,\"%s\",%ld"; | 929 : "timer-event-end,\"%s\",%ld"; |
| 930 msg.Append(format, name, since_epoch); | 930 msg.Append(format, name, since_epoch); |
| 931 msg.WriteToLogFile(); | 931 msg.WriteToLogFile(); |
| 932 } | 932 } |
| 933 | 933 |
| 934 | 934 |
| 935 void Logger::EnterExternal(Isolate* isolate) { | 935 void Logger::EnterExternal(Isolate* isolate) { |
| 936 LOG(isolate, TimerEvent(START, TimerEventExternal::name())); | 936 LOG(isolate, TimerEvent(START, TimerEventExternal::name())); |
| 937 TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.External"); |
| 937 DCHECK(isolate->current_vm_state() == JS); | 938 DCHECK(isolate->current_vm_state() == JS); |
| 938 isolate->set_current_vm_state(EXTERNAL); | 939 isolate->set_current_vm_state(EXTERNAL); |
| 939 } | 940 } |
| 940 | 941 |
| 941 | 942 |
| 942 void Logger::LeaveExternal(Isolate* isolate) { | 943 void Logger::LeaveExternal(Isolate* isolate) { |
| 943 LOG(isolate, TimerEvent(END, TimerEventExternal::name())); | 944 LOG(isolate, TimerEvent(END, TimerEventExternal::name())); |
| 945 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.External"); |
| 944 DCHECK(isolate->current_vm_state() == EXTERNAL); | 946 DCHECK(isolate->current_vm_state() == EXTERNAL); |
| 945 isolate->set_current_vm_state(JS); | 947 isolate->set_current_vm_state(JS); |
| 946 } | 948 } |
| 947 | 949 |
| 948 | 950 |
| 949 template <class TimerEvent> | 951 template <class TimerEvent> |
| 950 void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) { | 952 void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) { |
| 951 Logger::CallEventLogger(isolate_, TimerEvent::name(), se, | 953 Logger::CallEventLogger(isolate_, TimerEvent::name(), se, |
| 952 TimerEvent::expose_to_api()); | 954 TimerEvent::expose_to_api()); |
| 953 } | 955 } |
| (...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1913 removeCodeEventListener(jit_logger_); | 1915 removeCodeEventListener(jit_logger_); |
| 1914 delete jit_logger_; | 1916 delete jit_logger_; |
| 1915 jit_logger_ = NULL; | 1917 jit_logger_ = NULL; |
| 1916 } | 1918 } |
| 1917 | 1919 |
| 1918 return log_->Close(); | 1920 return log_->Close(); |
| 1919 } | 1921 } |
| 1920 | 1922 |
| 1921 } // namespace internal | 1923 } // namespace internal |
| 1922 } // namespace v8 | 1924 } // namespace v8 |
| OLD | NEW |