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 23 matching lines...) Expand all Loading... |
34 LOG_EVENTS_AND_TAGS_LIST(DECLARE_EVENT) | 34 LOG_EVENTS_AND_TAGS_LIST(DECLARE_EVENT) |
35 }; | 35 }; |
36 #undef DECLARE_EVENT | 36 #undef DECLARE_EVENT |
37 | 37 |
38 | 38 |
39 #define CALL_LISTENERS(Call) \ | 39 #define CALL_LISTENERS(Call) \ |
40 for (int i = 0; i < listeners_.length(); ++i) { \ | 40 for (int i = 0; i < listeners_.length(); ++i) { \ |
41 listeners_[i]->Call; \ | 41 listeners_[i]->Call; \ |
42 } | 42 } |
43 | 43 |
44 #define PROFILER_LOG(Call) \ | 44 #define PROFILER_LOG(Call) \ |
45 do { \ | 45 if (isolate_->is_profiling()) { \ |
46 CpuProfiler* cpu_profiler = isolate_->cpu_profiler(); \ | 46 isolate_->cpu_profiler()->Call; \ |
47 if (cpu_profiler->is_profiling()) { \ | 47 } else { \ |
48 cpu_profiler->Call; \ | 48 } |
49 } \ | |
50 } while (false); | |
51 | 49 |
52 static const char* ComputeMarker(SharedFunctionInfo* shared, | 50 static const char* ComputeMarker(SharedFunctionInfo* shared, |
53 AbstractCode* code) { | 51 AbstractCode* code) { |
54 switch (code->kind()) { | 52 switch (code->kind()) { |
55 case AbstractCode::FUNCTION: | 53 case AbstractCode::FUNCTION: |
56 case AbstractCode::INTERPRETED_FUNCTION: | 54 case AbstractCode::INTERPRETED_FUNCTION: |
57 return shared->optimization_disabled() ? "" : "~"; | 55 return shared->optimization_disabled() ? "" : "~"; |
58 case AbstractCode::OPTIMIZED_FUNCTION: | 56 case AbstractCode::OPTIMIZED_FUNCTION: |
59 return "*"; | 57 return "*"; |
60 default: | 58 default: |
(...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1895 removeCodeEventListener(jit_logger_); | 1893 removeCodeEventListener(jit_logger_); |
1896 delete jit_logger_; | 1894 delete jit_logger_; |
1897 jit_logger_ = NULL; | 1895 jit_logger_ = NULL; |
1898 } | 1896 } |
1899 | 1897 |
1900 return log_->Close(); | 1898 return log_->Close(); |
1901 } | 1899 } |
1902 | 1900 |
1903 } // namespace internal | 1901 } // namespace internal |
1904 } // namespace v8 | 1902 } // namespace v8 |
OLD | NEW |