| 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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); | 875 int since_epoch = static_cast<int>(timer_.Elapsed().InMicroseconds()); |
| 876 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld" | 876 const char* format = (se == START) ? "timer-event-start,\"%s\",%ld" |
| 877 : "timer-event-end,\"%s\",%ld"; | 877 : "timer-event-end,\"%s\",%ld"; |
| 878 msg.Append(format, name, since_epoch); | 878 msg.Append(format, name, since_epoch); |
| 879 msg.WriteToLogFile(); | 879 msg.WriteToLogFile(); |
| 880 } | 880 } |
| 881 | 881 |
| 882 | 882 |
| 883 void Logger::EnterExternal(Isolate* isolate) { | 883 void Logger::EnterExternal(Isolate* isolate) { |
| 884 LOG(isolate, TimerEvent(START, TimerEventExternal::name())); | 884 LOG(isolate, TimerEvent(START, TimerEventExternal::name())); |
| 885 TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.External"); | |
| 886 DCHECK(isolate->current_vm_state() == JS); | 885 DCHECK(isolate->current_vm_state() == JS); |
| 887 isolate->set_current_vm_state(EXTERNAL); | 886 isolate->set_current_vm_state(EXTERNAL); |
| 888 } | 887 } |
| 889 | 888 |
| 890 | 889 |
| 891 void Logger::LeaveExternal(Isolate* isolate) { | 890 void Logger::LeaveExternal(Isolate* isolate) { |
| 892 LOG(isolate, TimerEvent(END, TimerEventExternal::name())); | 891 LOG(isolate, TimerEvent(END, TimerEventExternal::name())); |
| 893 TRACE_EVENT_END0(TRACE_DISABLED_BY_DEFAULT("v8"), "V8.External"); | |
| 894 DCHECK(isolate->current_vm_state() == EXTERNAL); | 892 DCHECK(isolate->current_vm_state() == EXTERNAL); |
| 895 isolate->set_current_vm_state(JS); | 893 isolate->set_current_vm_state(JS); |
| 896 } | 894 } |
| 897 | 895 |
| 898 | 896 |
| 899 template <class TimerEvent> | 897 template <class TimerEvent> |
| 900 void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) { | 898 void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) { |
| 901 Logger::CallEventLogger(isolate_, TimerEvent::name(), se, | 899 Logger::CallEventLogger(isolate_, TimerEvent::name(), se, |
| 902 TimerEvent::expose_to_api()); | 900 TimerEvent::expose_to_api()); |
| 903 } | 901 } |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1835 removeCodeEventListener(jit_logger_); | 1833 removeCodeEventListener(jit_logger_); |
| 1836 delete jit_logger_; | 1834 delete jit_logger_; |
| 1837 jit_logger_ = NULL; | 1835 jit_logger_ = NULL; |
| 1838 } | 1836 } |
| 1839 | 1837 |
| 1840 return log_->Close(); | 1838 return log_->Close(); |
| 1841 } | 1839 } |
| 1842 | 1840 |
| 1843 } // namespace internal | 1841 } // namespace internal |
| 1844 } // namespace v8 | 1842 } // namespace v8 |
| OLD | NEW |