OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_LOG_H_ | 5 #ifndef V8_LOG_H_ |
6 #define V8_LOG_H_ | 6 #define V8_LOG_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 #define LOG_CODE_EVENT(isolate, Call) \ | 77 #define LOG_CODE_EVENT(isolate, Call) \ |
78 do { \ | 78 do { \ |
79 v8::internal::Logger* logger = \ | 79 v8::internal::Logger* logger = \ |
80 (isolate)->logger(); \ | 80 (isolate)->logger(); \ |
81 if (logger->is_logging_code_events()) \ | 81 if (logger->is_logging_code_events()) \ |
82 logger->Call; \ | 82 logger->Call; \ |
83 } while (false) | 83 } while (false) |
84 | 84 |
85 | 85 |
86 #define LOG_EVENTS_AND_TAGS_LIST(V) \ | 86 #define LOG_EVENTS_AND_TAGS_LIST(V) \ |
87 V(CODE_CREATION_EVENT, "code-creation") \ | 87 V(CODE_CREATION_EVENT, "code-creation") \ |
88 V(CODE_DISABLE_OPT_EVENT, "code-disable-optimization") \ | 88 V(CODE_DISABLE_OPT_EVENT, "code-disable-optimization") \ |
89 V(CODE_MOVE_EVENT, "code-move") \ | 89 V(CODE_MOVE_EVENT, "code-move") \ |
90 V(CODE_DELETE_EVENT, "code-delete") \ | 90 V(CODE_DELETE_EVENT, "code-delete") \ |
91 V(CODE_MOVING_GC, "code-moving-gc") \ | 91 V(CODE_MOVING_GC, "code-moving-gc") \ |
92 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ | 92 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \ |
93 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ | 93 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \ |
94 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \ | 94 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \ |
95 V(TICK_EVENT, "tick") \ | 95 V(TICK_EVENT, "tick") \ |
96 V(REPEAT_META_EVENT, "repeat") \ | 96 V(REPEAT_META_EVENT, "repeat") \ |
97 V(BUILTIN_TAG, "Builtin") \ | 97 V(BUILTIN_TAG, "Builtin") \ |
98 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \ | 98 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \ |
99 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \ | 99 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \ |
100 V(CALL_INITIALIZE_TAG, "CallInitialize") \ | 100 V(CALL_INITIALIZE_TAG, "CallInitialize") \ |
101 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \ | 101 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \ |
102 V(CALL_MISS_TAG, "CallMiss") \ | 102 V(CALL_MISS_TAG, "CallMiss") \ |
103 V(CALL_NORMAL_TAG, "CallNormal") \ | 103 V(CALL_NORMAL_TAG, "CallNormal") \ |
104 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic") \ | 104 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic") \ |
105 V(LOAD_INITIALIZE_TAG, "LoadInitialize") \ | 105 V(LOAD_INITIALIZE_TAG, "LoadInitialize") \ |
106 V(LOAD_PREMONOMORPHIC_TAG, "LoadPreMonomorphic") \ | 106 V(LOAD_PREMONOMORPHIC_TAG, "LoadPreMonomorphic") \ |
107 V(LOAD_MEGAMORPHIC_TAG, "LoadMegamorphic") \ | 107 V(LOAD_MEGAMORPHIC_TAG, "LoadMegamorphic") \ |
108 V(STORE_INITIALIZE_TAG, "StoreInitialize") \ | 108 V(STORE_INITIALIZE_TAG, "StoreInitialize") \ |
109 V(STORE_PREMONOMORPHIC_TAG, "StorePreMonomorphic") \ | 109 V(STORE_PREMONOMORPHIC_TAG, "StorePreMonomorphic") \ |
110 V(STORE_GENERIC_TAG, "StoreGeneric") \ | 110 V(STORE_GENERIC_TAG, "StoreGeneric") \ |
111 V(STORE_MEGAMORPHIC_TAG, "StoreMegamorphic") \ | 111 V(STORE_MEGAMORPHIC_TAG, "StoreMegamorphic") \ |
112 V(KEYED_CALL_DEBUG_BREAK_TAG, "KeyedCallDebugBreak") \ | 112 V(KEYED_CALL_DEBUG_BREAK_TAG, "KeyedCallDebugBreak") \ |
113 V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG, "KeyedCallDebugPrepareStepIn") \ | 113 V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG, \ |
114 V(KEYED_CALL_INITIALIZE_TAG, "KeyedCallInitialize") \ | 114 "KeyedCallDebugPrepareStepIn") \ |
115 V(KEYED_CALL_MEGAMORPHIC_TAG, "KeyedCallMegamorphic") \ | 115 V(KEYED_CALL_INITIALIZE_TAG, "KeyedCallInitialize") \ |
116 V(KEYED_CALL_MISS_TAG, "KeyedCallMiss") \ | 116 V(KEYED_CALL_MEGAMORPHIC_TAG, "KeyedCallMegamorphic") \ |
117 V(KEYED_CALL_NORMAL_TAG, "KeyedCallNormal") \ | 117 V(KEYED_CALL_MISS_TAG, "KeyedCallMiss") \ |
118 V(KEYED_CALL_PRE_MONOMORPHIC_TAG, "KeyedCallPreMonomorphic") \ | 118 V(KEYED_CALL_NORMAL_TAG, "KeyedCallNormal") \ |
119 V(CALLBACK_TAG, "Callback") \ | 119 V(KEYED_CALL_PRE_MONOMORPHIC_TAG, "KeyedCallPreMonomorphic") \ |
120 V(EVAL_TAG, "Eval") \ | 120 V(CALLBACK_TAG, "Callback") \ |
121 V(FUNCTION_TAG, "Function") \ | 121 V(EVAL_TAG, "Eval") \ |
122 V(HANDLER_TAG, "Handler") \ | 122 V(FUNCTION_TAG, "Function") \ |
123 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \ | 123 V(HANDLER_TAG, "Handler") \ |
124 V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \ | 124 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \ |
125 V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \ | 125 V(KEYED_LOAD_POLYMORPHIC_IC_TAG, "KeyedLoadPolymorphicIC") \ |
126 V(KEYED_STORE_IC_TAG, "KeyedStoreIC") \ | 126 V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \ |
127 V(KEYED_STORE_POLYMORPHIC_IC_TAG, "KeyedStorePolymorphicIC") \ | 127 V(KEYED_STORE_IC_TAG, "KeyedStoreIC") \ |
128 V(KEYED_EXTERNAL_ARRAY_STORE_IC_TAG, "KeyedExternalArrayStoreIC") \ | 128 V(KEYED_STORE_POLYMORPHIC_IC_TAG, "KeyedStorePolymorphicIC") \ |
129 V(LAZY_COMPILE_TAG, "LazyCompile") \ | 129 V(KEYED_EXTERNAL_ARRAY_STORE_IC_TAG, "KeyedExternalArrayStoreIC") \ |
130 V(CALL_IC_TAG, "CallIC") \ | 130 V(LAZY_COMPILE_TAG, "LazyCompile") \ |
131 V(CONSTRUCT_IC_TAG, "ConstructIC") \ | 131 V(CALL_IC_TAG, "CallIC") \ |
132 V(LOAD_IC_TAG, "LoadIC") \ | 132 V(LOAD_IC_TAG, "LoadIC") \ |
133 V(LOAD_POLYMORPHIC_IC_TAG, "LoadPolymorphicIC") \ | 133 V(LOAD_POLYMORPHIC_IC_TAG, "LoadPolymorphicIC") \ |
134 V(REG_EXP_TAG, "RegExp") \ | 134 V(REG_EXP_TAG, "RegExp") \ |
135 V(SCRIPT_TAG, "Script") \ | 135 V(SCRIPT_TAG, "Script") \ |
136 V(STORE_IC_TAG, "StoreIC") \ | 136 V(STORE_IC_TAG, "StoreIC") \ |
137 V(STORE_POLYMORPHIC_IC_TAG, "StorePolymorphicIC") \ | 137 V(STORE_POLYMORPHIC_IC_TAG, "StorePolymorphicIC") \ |
138 V(STUB_TAG, "Stub") \ | 138 V(STUB_TAG, "Stub") \ |
139 V(NATIVE_FUNCTION_TAG, "Function") \ | 139 V(NATIVE_FUNCTION_TAG, "Function") \ |
140 V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile") \ | 140 V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile") \ |
141 V(NATIVE_SCRIPT_TAG, "Script") | 141 V(NATIVE_SCRIPT_TAG, "Script") |
142 // Note that 'NATIVE_' cases for functions and scripts are mapped onto | 142 // Note that 'NATIVE_' cases for functions and scripts are mapped onto |
143 // original tags when writing to the log. | 143 // original tags when writing to the log. |
144 | 144 |
145 | 145 |
146 class JitLogger; | 146 class JitLogger; |
147 class PerfBasicLogger; | 147 class PerfBasicLogger; |
148 class LowLevelLogger; | 148 class LowLevelLogger; |
149 class Sampler; | 149 class Sampler; |
150 | 150 |
151 class Logger { | 151 class Logger { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 524 |
525 NameBuffer* name_buffer_; | 525 NameBuffer* name_buffer_; |
526 }; | 526 }; |
527 | 527 |
528 | 528 |
529 } // namespace internal | 529 } // namespace internal |
530 } // namespace v8 | 530 } // namespace v8 |
531 | 531 |
532 | 532 |
533 #endif // V8_LOG_H_ | 533 #endif // V8_LOG_H_ |
OLD | NEW |