74 class LogMessageBuilder;
77 class SlidingStateWindow;
81 #define LOG(isolate, Call) \
83 v8::internal::Logger* logger = \
84 (isolate)->logger(); \
85 if (logger->is_logging()) \
89 #define LOG_CODE_EVENT(isolate, Call) \
91 v8::internal::Logger* logger = \
92 (isolate)->logger(); \
93 if (logger->is_logging_code_events()) \
98 #define LOG_EVENTS_AND_TAGS_LIST(V) \
99 V(CODE_CREATION_EVENT, "code-creation") \
100 V(CODE_MOVE_EVENT, "code-move") \
101 V(CODE_DELETE_EVENT, "code-delete") \
102 V(CODE_MOVING_GC, "code-moving-gc") \
103 V(SHARED_FUNC_MOVE_EVENT, "sfi-move") \
104 V(SNAPSHOT_POSITION_EVENT, "snapshot-pos") \
105 V(SNAPSHOT_CODE_NAME_EVENT, "snapshot-code-name") \
106 V(TICK_EVENT, "tick") \
107 V(REPEAT_META_EVENT, "repeat") \
108 V(BUILTIN_TAG, "Builtin") \
109 V(CALL_DEBUG_BREAK_TAG, "CallDebugBreak") \
110 V(CALL_DEBUG_PREPARE_STEP_IN_TAG, "CallDebugPrepareStepIn") \
111 V(CALL_IC_TAG, "CallIC") \
112 V(CALL_INITIALIZE_TAG, "CallInitialize") \
113 V(CALL_MEGAMORPHIC_TAG, "CallMegamorphic") \
114 V(CALL_MISS_TAG, "CallMiss") \
115 V(CALL_NORMAL_TAG, "CallNormal") \
116 V(CALL_PRE_MONOMORPHIC_TAG, "CallPreMonomorphic") \
117 V(KEYED_CALL_DEBUG_BREAK_TAG, "KeyedCallDebugBreak") \
118 V(KEYED_CALL_DEBUG_PREPARE_STEP_IN_TAG, \
119 "KeyedCallDebugPrepareStepIn") \
120 V(KEYED_CALL_IC_TAG, "KeyedCallIC") \
121 V(KEYED_CALL_INITIALIZE_TAG, "KeyedCallInitialize") \
122 V(KEYED_CALL_MEGAMORPHIC_TAG, "KeyedCallMegamorphic") \
123 V(KEYED_CALL_MISS_TAG, "KeyedCallMiss") \
124 V(KEYED_CALL_NORMAL_TAG, "KeyedCallNormal") \
125 V(KEYED_CALL_PRE_MONOMORPHIC_TAG, "KeyedCallPreMonomorphic") \
126 V(CALLBACK_TAG, "Callback") \
127 V(EVAL_TAG, "Eval") \
128 V(FUNCTION_TAG, "Function") \
129 V(KEYED_LOAD_IC_TAG, "KeyedLoadIC") \
130 V(KEYED_LOAD_MEGAMORPHIC_IC_TAG, "KeyedLoadMegamorphicIC") \
131 V(KEYED_EXTERNAL_ARRAY_LOAD_IC_TAG, "KeyedExternalArrayLoadIC") \
132 V(KEYED_STORE_IC_TAG, "KeyedStoreIC") \
133 V(KEYED_STORE_MEGAMORPHIC_IC_TAG, "KeyedStoreMegamorphicIC") \
134 V(KEYED_EXTERNAL_ARRAY_STORE_IC_TAG, "KeyedExternalArrayStoreIC") \
135 V(LAZY_COMPILE_TAG, "LazyCompile") \
136 V(LOAD_IC_TAG, "LoadIC") \
137 V(REG_EXP_TAG, "RegExp") \
138 V(SCRIPT_TAG, "Script") \
139 V(STORE_IC_TAG, "StoreIC") \
140 V(STUB_TAG, "Stub") \
141 V(NATIVE_FUNCTION_TAG, "Function") \
142 V(NATIVE_LAZY_COMPILE_TAG, "LazyCompile") \
143 V(NATIVE_SCRIPT_TAG, "Script")
153 #define DECLARE_ENUM(enum_item, ignore) enum_item,
181 void StringEvent(
const char* name,
const char* value);
184 void IntEvent(
const char* name,
int value);
191 void NewEvent(
const char* name,
void*
object,
size_t size);
196 static void NewEventStatic(
const char* name,
void*
object,
size_t size);
211 void DebugTag(
const char* call_site_tag);
243 String* source,
int line);
263 int number,
int bytes);
269 intptr_t capacity, intptr_t used);
287 return logging_nesting_ > 0;
319 static const int kSamplingIntervalMs = 1;
333 void IssueCodeAddedEvent(
Code*
code,
const char* name,
size_t name_len);
335 void IssueCodeRemovedEvent(
Address from);
338 void ProfilerBeginEvent();
341 void CallbackEventInternal(
const char* prefix,
355 void LogCodeObject(
Object* code_object);
360 void RegisterSnapshotCodeName(
Code*
code,
const char* name,
int name_size);
364 void LowLevelCodeCreateEvent(
Code*
code,
const char* name,
int name_size);
368 void LowLevelCodeDeleteEvent(
Address from);
370 void LowLevelSnapshotPositionEvent(
Address addr,
int pos);
372 void LowLevelLogWriteBytes(
const char* bytes,
int size);
374 template <
typename T>
375 void LowLevelLogWriteStruct(
const T& s) {
377 LowLevelLogWriteBytes(reinterpret_cast<const char*>(&tag),
sizeof(tag));
378 LowLevelLogWriteBytes(reinterpret_cast<const char*>(&s),
sizeof(s));
384 void ApiEvent(
const char* name, ...);
387 void UncheckedStringEvent(
const char* name,
const char* value);
390 void UncheckedIntEvent(
const char* name,
int value);
391 void UncheckedIntPtrTEvent(
const char* name, intptr_t value);
394 bool IsProfilerSamplerActive();
409 const char*
const* log_events_;
425 int logging_nesting_;
426 int cpu_profiler_nesting_;
436 bool is_initialized_;
462 HAS_CPU_PROFILING_SAMPLERS
467 typedef void (*VisitSampler)(
Sampler*,
void*);
469 static State GetState();
473 static bool IterateActiveSamplers(VisitSampler func,
void* param);
480 static bool ActiveSamplersExist() {
481 return active_samplers_ !=
NULL && !active_samplers_->is_empty();
void LogRuntime(Vector< const char > format, JSArray *args)
static void NewEventStatic(const char *name, void *object, size_t size)
void RegExpCodeCreateEvent(Code *code, String *source)
void CodeMoveEvent(Address from, Address to)
void GetterCallbackEvent(String *name, Address entry_point)
void SetterCallbackEvent(String *name, Address entry_point)
static void DeleteEventStatic(const char *name, void *object)
void EnsureTickerStopped()
bool is_logging_code_events()
void LogCompiledFunctions()
void CodeDeleteEvent(Address from)
void IntPtrTEvent(const char *name, intptr_t value)
void EnsureTickerStarted()
void ApiNamedSecurityCheck(Object *key)
void HandleEvent(const char *name, Object **location)
void ApiIndexedSecurityCheck(uint32_t index)
void SnapshotPositionEvent(Address addr, int pos)
void HeapSampleJSProducerEvent(const char *constructor, Address *stack)
friend class LoggerTestHelper
void HeapSampleBeginEvent(const char *space, const char *kind)
void LogExistingFunction(Handle< SharedFunctionInfo > shared, Handle< Code > code)
#define DECLARE_ENUM(enum_item, ignore)
void DebugEvent(const char *event_type, Vector< uint16_t > parameter)
#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)
void RegExpCompileEvent(Handle< JSRegExp > regexp, bool in_cache)
void HeapSampleStats(const char *space, const char *kind, intptr_t capacity, intptr_t used)
INLINE(static LogEventsAndTags ToNativeByScript(LogEventsAndTags, Script *))
void EnableSlidingStateWindow()
void ApiNamedPropertyAccess(const char *tag, JSObject *holder, Object *name)
#define T(name, string, precedence)
void ApiIndexedPropertyAccess(const char *tag, JSObject *holder, uint32_t index)
void SharedLibraryEvent(const char *library_path, uintptr_t start, uintptr_t end)
void ApiEntryCall(const char *name)
void(* JitCodeEventHandler)(const JitCodeEvent *event)
void HeapSampleEndEvent(const char *space, const char *kind)
void HeapSampleJSConstructorEvent(const char *constructor, int number, int bytes)
void CallbackEvent(String *name, Address entry_point)
void HeapSampleItemEvent(const char *type, int number, int bytes)
void DeleteEvent(const char *name, void *object)
void ApiObjectAccess(const char *tag, JSObject *obj)
static const int kSamplingIntervalMs
void HeapSampleJSRetainersEvent(const char *constructor, const char *event)
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra emit comments in code disassembly enable use of SSE3 instructions if available enable use of CMOV instruction if available enable use of SAHF instruction if enable use of VFP3 instructions if available this implies enabling ARMv7 and VFP2 enable use of VFP2 instructions if available enable use of SDIV and UDIV instructions if enable loading bit constant by means of movw movt instruction enable unaligned accesses for enable use of MIPS FPU instructions if NULL
void SharedFunctionInfoMoveEvent(Address from, Address to)
void IntEvent(const char *name, int value)
void LogAccessorCallbacks()
activate correct semantics for inheriting readonliness enable harmony semantics for typeof enable harmony enable harmony proxies enable all harmony harmony_scoping harmony_proxies harmony_scoping tracks arrays with only smi values automatically unbox arrays of doubles use crankshaft use hydrogen range analysis use hydrogen global value numbering use function inlining maximum number of AST nodes considered for a single inlining loop invariant code motion print statistics for hydrogen trace generated IR for specified phases trace register allocator trace range analysis trace representation types environment for every instruction put a break point before deoptimizing polymorphic inlining perform array bounds checks elimination use dead code elimination trace on stack replacement optimize closures cache optimized code for closures functions with arguments object loop weight for representation inference allow uint32 values on optimize frames if they are used only in safe operations track parallel recompilation enable all profiler experiments number of stack frames inspected by the profiler call recompile stub directly when self optimizing trigger profiler ticks based on counting instead of timing weight back edges by jump distance for interrupt triggering percentage of ICs that must have type info to allow optimization watch_ic_patching retry_self_opt interrupt_at_exit extra verbose compilation tracing generate extra code(assertions) for debugging") DEFINE_bool(code_comments
friend class LogMessageBuilder
void CodeCreateEvent(LogEventsAndTags tag, Code *code, const char *source)
void DebugTag(const char *call_site_tag)
void ResourceEvent(const char *name, const char *tag)
void NewEvent(const char *name, void *object, size_t size)
void SuspectReadEvent(String *name, Object *obj)
#define LOG_EVENTS_AND_TAGS_LIST(V)
void StringEvent(const char *name, const char *value)
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)