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 <memory> | 8 #include <memory> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 isolate->set_current_vm_state(EXTERNAL); | 888 isolate->set_current_vm_state(EXTERNAL); |
889 } | 889 } |
890 | 890 |
891 | 891 |
892 void Logger::LeaveExternal(Isolate* isolate) { | 892 void Logger::LeaveExternal(Isolate* isolate) { |
893 LOG(isolate, TimerEvent(END, TimerEventExternal::name())); | 893 LOG(isolate, TimerEvent(END, TimerEventExternal::name())); |
894 DCHECK(isolate->current_vm_state() == EXTERNAL); | 894 DCHECK(isolate->current_vm_state() == EXTERNAL); |
895 isolate->set_current_vm_state(JS); | 895 isolate->set_current_vm_state(JS); |
896 } | 896 } |
897 | 897 |
898 | |
899 template <class TimerEvent> | |
900 void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) { | |
901 Logger::CallEventLogger(isolate_, TimerEvent::name(), se, | |
902 TimerEvent::expose_to_api()); | |
903 } | |
904 | |
905 | |
906 // Instantiate template methods. | 898 // Instantiate template methods. |
907 #define V(TimerName, expose) \ | 899 #define V(TimerName, expose) \ |
908 template void TimerEventScope<TimerEvent##TimerName>::LogTimerEvent( \ | 900 template void TimerEventScope<TimerEvent##TimerName>::LogTimerEvent( \ |
909 Logger::StartEnd se); | 901 Logger::StartEnd se); |
910 TIMER_EVENTS_LIST(V) | 902 TIMER_EVENTS_LIST(V) |
911 #undef V | 903 #undef V |
912 | 904 |
913 | 905 |
914 namespace { | 906 namespace { |
915 // Emits the source code of a regexp. Used by regexp events. | 907 // Emits the source code of a regexp. Used by regexp events. |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 | 1862 |
1871 if (profiler_listener_.get() != nullptr) { | 1863 if (profiler_listener_.get() != nullptr) { |
1872 removeCodeEventListener(profiler_listener_.get()); | 1864 removeCodeEventListener(profiler_listener_.get()); |
1873 } | 1865 } |
1874 | 1866 |
1875 return log_->Close(); | 1867 return log_->Close(); |
1876 } | 1868 } |
1877 | 1869 |
1878 } // namespace internal | 1870 } // namespace internal |
1879 } // namespace v8 | 1871 } // namespace v8 |
OLD | NEW |