v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
log.h
Go to the documentation of this file.
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
3// found in the LICENSE file.
4
5#ifndef V8_LOGGING_LOG_H_
6#define V8_LOGGING_LOG_H_
7
8#include <atomic>
9#include <memory>
10#include <set>
11#include <string>
12
14#include "include/v8-profiler.h"
18#include "src/objects/objects.h"
20
21namespace v8 {
22
23namespace sampler {
24class Sampler;
25} // namespace sampler
26
27namespace internal {
28
29struct TickSample;
30
31// V8FileLogger is used for collecting logging information from V8 during
32// execution. The result is dumped to a file.
33//
34// Available command line flags:
35//
36// --log
37// Minimal logging (no API, code, or GC sample events), default is off.
38//
39// --log-all
40// Log all events to the file, default is off. This is the same as combining
41// --log-api and --log-code.
42//
43// --log-api
44// Log API events to the logfile, default is off. --log-api implies --log.
45//
46// --log-code
47// Log code (create, move, and delete) events to the logfile, default is off.
48// --log-code implies --log.
49//
50// --logfile <filename>
51// Specify the name of the logfile, default is "v8.log".
52//
53// --prof
54// Collect statistical profiling information (ticks), default is off. The
55// tick profiler requires code events, so --prof implies --log-code.
56//
57// --prof-sampling-interval <microseconds>
58// The interval between --prof samples, default is 1000 microseconds (5000 on
59// Android).
60
61// Forward declarations.
62class LogEventListener;
63class Isolate;
64class JitLogger;
65class LogFile;
66class LowLevelLogger;
67class LinuxPerfBasicLogger;
68class LinuxPerfJitLogger;
69class Profiler;
70class SourcePosition;
71class Ticker;
72
73#if defined(V8_ENABLE_ETW_STACK_WALKING)
74class ETWJitLogger;
75#endif // V8_ENABLE_ETW_STACK_WALKING
76
77#undef LOG
78#define LOG(isolate, Call) \
79 do { \
80 if (v8::internal::v8_flags.log) (isolate)->v8_file_logger()->Call; \
81 } while (false)
82
83#define LOG_CODE_EVENT(isolate, Call) \
84 do { \
85 auto&& logger = (isolate)->v8_file_logger(); \
86 if (logger->is_listening_to_code_events()) logger->Call; \
87 } while (false)
88
90 public:
92 explicit ExistingCodeLogger(Isolate* isolate,
93 LogEventListener* listener = nullptr)
94 : isolate_(isolate), listener_(listener) {}
95
96 void LogCodeObjects();
97 void LogBuiltins();
98
99 void LogCompiledFunctions(bool ensure_source_positions_available = true);
102 LogEventListener::CodeTag tag = LogEventListener::CodeTag::kFunction);
104
105#if defined(V8_ENABLE_ETW_STACK_WALKING)
106 void LogInterpretedFunctions();
107#endif // V8_ENABLE_ETW_STACK_WALKING
108
109 private:
112};
113
114enum class LogSeparator;
115
117 public:
118 explicit V8FileLogger(Isolate* isolate);
119 ~V8FileLogger() override;
120
121 // The separator is used to write an unescaped "," into the log.
122 static const LogSeparator kNext;
123
124 // Acquires resources for logging if the right flags are set.
125 bool SetUp(Isolate* isolate);
126
127 // Additional steps taken after the logger has been set up.
128 void LateSetup(Isolate* isolate);
129
130 // Frees resources acquired in SetUp.
131 // When a temporary file is used for the log, returns its stream descriptor,
132 // leaving the file open.
134
135 // Sets the current code event handler.
136 void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler);
137
138#if defined(V8_ENABLE_ETW_STACK_WALKING)
139 void SetEtwCodeEventHandler(uint32_t options);
140 void ResetEtwCodeEventHandler();
141#endif // V8_ENABLE_ETW_STACK_WALKING
142
144 V8_EXPORT_PRIVATE std::string file_name() const;
145
147
148 // Emits an event with a string value -> (name, value).
149 V8_EXPORT_PRIVATE void StringEvent(const char* name, const char* value);
150
151 // Emits an event with an int value -> (name, value).
152 void IntPtrTEvent(const char* name, intptr_t value);
153
154 // Emits memory management events for C allocated structures.
155 void NewEvent(const char* name, void* object, size_t size);
156 void DeleteEvent(const char* name, void* object);
157
158 // ==== Events logged by --log-function-events ====
159 void FunctionEvent(const char* reason, int script_id, double time_delta_ms,
160 int start_position, int end_position,
161 Tagged<String> function_name);
162 void FunctionEvent(const char* reason, int script_id, double time_delta_ms,
163 int start_position, int end_position,
164 const char* function_name = nullptr,
165 size_t function_name_length = 0, bool is_one_byte = true);
166
167 void CompilationCacheEvent(const char* action, const char* cache_type,
169 void ScriptEvent(ScriptEventType type, int script_id);
170 void ScriptDetails(Tagged<Script> script);
171
172 // LogEventListener implementation.
174 const char* name) override;
176 DirectHandle<Name> name) override;
179 DirectHandle<Name> script_name) override;
182 DirectHandle<Name> script_name, int line,
183 int column) override;
184#if V8_ENABLE_WEBASSEMBLY
185 void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code,
186 wasm::WasmName name, const char* source_url,
187 int code_offset, int script_id) override;
188#endif // V8_ENABLE_WEBASSEMBLY
189
190 void CallbackEvent(DirectHandle<Name> name, Address entry_point) override;
192 Address entry_point) override;
194 Address entry_point) override;
197 RegExpFlags flags) override;
199 Tagged<InstructionStream> to) override;
201 Tagged<BytecodeArray> to) override;
202 void SharedFunctionInfoMoveEvent(Address from, Address to) override;
203 void NativeContextMoveEvent(Address from, Address to) override {}
204 void CodeMovingGCEvent() override;
206 DirectHandle<SharedFunctionInfo> shared) override;
208 int fp_to_sp_delta) override;
211 const char* reason) override;
214 void WeakCodeClearEvent() override {}
215
217 const char* kind, const char* reason);
218
219 // Emits a code line info record event.
221 Address code_start, Tagged<TrustedByteArray> source_position_table,
222 JitCodeEvent::CodeType code_type);
223#if V8_ENABLE_WEBASSEMBLY
224 void WasmCodeLinePosInfoRecordEvent(
225 Address code_start, base::Vector<const uint8_t> source_position_table);
226#endif // V8_ENABLE_WEBASSEMBLY
227
228 void CodeNameEvent(Address addr, int pos, const char* code_name);
229
230 void ICEvent(const char* type, bool keyed, DirectHandle<Map> map,
231 DirectHandle<Object> key, char old_state, char new_state,
232 const char* modifier, const char* slow_stub_reason);
233
234 void MapEvent(
235 const char* type, DirectHandle<Map> from, DirectHandle<Map> to,
236 const char* reason = nullptr,
238 void MapCreate(Tagged<Map> map);
239 void MapDetails(Tagged<Map> map);
240 void MapMoveEvent(Tagged<Map> from, Tagged<Map> to);
241
242 void SharedLibraryEvent(const std::string& library_path, uintptr_t start,
243 uintptr_t end, intptr_t aslr_slide);
244 void SharedLibraryEnd();
245
246 void CurrentTimeEvent();
247
248 V8_EXPORT_PRIVATE void TimerEvent(v8::LogEventStatus se, const char* name);
249
250 static void EnterExternal(Isolate* isolate);
251 static void LeaveExternal(Isolate* isolate);
252
254 Isolate* isolate, const char* name, v8::LogEventStatus se,
255 bool expose_to_api) {
256 LOG(isolate, TimerEvent(se, name));
257 if (V8_UNLIKELY(isolate->event_logger())) {
258 isolate->event_logger()(name, se);
259 }
260 }
261
262 V8_INLINE static void CallEventLogger(Isolate* isolate, const char* name,
264 bool expose_to_api) {
265 if (V8_UNLIKELY(v8_flags.log_timer_events)) {
266 CallEventLoggerInternal(isolate, name, se, expose_to_api);
267 }
268 }
269
271
273 return
274#if defined(V8_ENABLE_ETW_STACK_WALKING)
275 etw_jit_logger_ != nullptr ||
276#endif // V8_ENABLE_ETW_STACK_WALKING
277 is_logging() || jit_logger_ != nullptr;
278 }
279
280 bool allows_code_compaction() override {
281#if defined(V8_ENABLE_ETW_STACK_WALKING)
282 return etw_jit_logger_ == nullptr;
283#else // V8_ENABLE_ETW_STACK_WALKING
284 return true;
285#endif // V8_ENABLE_ETW_STACK_WALKING
286 }
287
290 // Logs all compiled functions found in the heap.
292 bool ensure_source_positions_available = true);
293 // Logs all accessor callbacks found in the heap.
295 // Used for logging stubs found in the snapshot.
298 // Logs all Maps found on the heap.
299 void LogAllMaps();
300
301 // Converts tag to a corresponding NATIVE_... if the script is native.
303
304#if defined(V8_ENABLE_ETW_STACK_WALKING)
305 void LogInterpretedFunctions();
306#endif // V8_ENABLE_ETW_STACK_WALKING
307
308 private:
309 Logger* logger() const;
310
311 void UpdateIsLogging(bool value);
312
313 // Emits the profiler's first message.
314 void ProfilerBeginEvent();
315
316 // Emits callback event messages.
317 void CallbackEventInternal(const char* prefix, DirectHandle<Name> name,
318 Address entry_point);
319
320 // Internal configurable move event.
321 void MoveEventInternal(Event event, Address from, Address to);
322
323 // Helper method. It resets name_buffer_ and add tag name into it.
325
326 // Emits a profiler tick event. Used by the profiler thread.
327 void TickEvent(TickSample* sample, bool overflow);
329
330 // Logs a StringEvent regardless of whether v8_flags.log is true.
331 void UncheckedStringEvent(const char* name, const char* value);
332
333 // Logs a scripts sources. Keeps track of all logged scripts to ensure that
334 // each script is logged only once.
336
340
342 void WriteApiNamedPropertyAccess(const char* tag, Tagged<JSObject> holder,
343 Tagged<Object> name);
345 uint32_t index);
346 void WriteApiObjectAccess(const char* tag, Tagged<JSReceiver> obj);
347 void WriteApiEntryCall(const char* name);
348
349 int64_t Time();
350
352
353 // The sampler used by the profiler and the sliding state window.
354 std::unique_ptr<Ticker> ticker_;
355
356 // When the statistical profile is active, profiler_
357 // points to a Profiler, that handles collection
358 // of samples.
359 std::unique_ptr<Profiler> profiler_;
360
361 // Internal implementation classes with access to private members.
362 friend class Profiler;
363
364 std::atomic<bool> is_logging_;
365 std::unique_ptr<LogFile> log_file_;
366#if V8_OS_LINUX
367 std::unique_ptr<LinuxPerfBasicLogger> perf_basic_logger_;
368 std::unique_ptr<LinuxPerfJitLogger> perf_jit_logger_;
369#endif
370 std::unique_ptr<LowLevelLogger> ll_logger_;
371 std::unique_ptr<JitLogger> jit_logger_;
372#ifdef ENABLE_GDB_JIT_INTERFACE
373 std::unique_ptr<JitLogger> gdb_jit_logger_;
374#endif
375#if defined(V8_ENABLE_ETW_STACK_WALKING)
376 std::unique_ptr<ETWJitLogger> etw_jit_logger_;
377#endif // V8_ENABLE_ETW_STACK_WALKING
378 std::set<int> logged_source_code_;
380
381 // Guards against multiple calls to TearDown() that can happen in some tests.
382 // 'true' between SetUp() and TearDown().
384
386
388};
389
390#define TIMER_EVENTS_LIST(V) \
391 V(RecompileSynchronous, true) \
392 V(RecompileConcurrent, true) \
393 V(CompileIgnition, true) \
394 V(CompileFullCode, true) \
395 V(OptimizeCode, true) \
396 V(CompileCode, true) \
397 V(CompileCodeBackground, true) \
398 V(DeoptimizeCode, true) \
399 V(Execute, true)
400
401#define V(TimerName, expose) \
402 class TimerEvent##TimerName : public AllStatic { \
403 public: \
404 static const char* name(void* unused = nullptr) { \
405 return "V8." #TimerName; \
406 } \
407 static bool expose_to_api() { return expose; } \
408 };
410#undef V
411
412template <class TimerEvent>
414 public:
415 explicit TimerEventScope(Isolate* isolate) : isolate_(isolate) {
416 LogTimerEvent(v8::LogEventStatus::kStart);
417 }
418
420
421 private:
422 void LogTimerEvent(v8::LogEventStatus se);
424};
425
426// Abstract
428 public:
429 explicit CodeEventLogger(Isolate* isolate);
431
432 void CodeCreateEvent(CodeTag tag, DirectHandle<AbstractCode> code,
433 const char* name) override;
434 void CodeCreateEvent(CodeTag tag, DirectHandle<AbstractCode> code,
435 DirectHandle<Name> name) override;
436 void CodeCreateEvent(CodeTag tag, DirectHandle<AbstractCode> code,
438 DirectHandle<Name> script_name) override;
439 void CodeCreateEvent(CodeTag tag, DirectHandle<AbstractCode> code,
441 DirectHandle<Name> script_name, int line,
442 int column) override;
443#if V8_ENABLE_WEBASSEMBLY
444 void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code,
445 wasm::WasmName name, const char* source_url,
446 int code_offset, int script_id) override;
447#endif // V8_ENABLE_WEBASSEMBLY
448
449 void RegExpCodeCreateEvent(DirectHandle<AbstractCode> code,
451 RegExpFlags flags) override;
452 void CallbackEvent(DirectHandle<Name> name, Address entry_point) override {}
454 Address entry_point) override {}
456 Address entry_point) override {}
457 void SharedFunctionInfoMoveEvent(Address from, Address to) override {}
458 void NativeContextMoveEvent(Address from, Address to) override {}
459 void CodeMovingGCEvent() override {}
461 int fp_to_sp_delta) override {}
464 const char* reason) override {}
465 void WeakCodeClearEvent() override {}
466
467 bool is_listening_to_code_events() override { return true; }
468
469 protected:
471
472 private:
473 class NameBuffer;
474
475 virtual void LogRecordedBuffer(
477 MaybeDirectHandle<SharedFunctionInfo> maybe_shared, const char* name,
478 size_t length) = 0;
479#if V8_ENABLE_WEBASSEMBLY
480 virtual void LogRecordedBuffer(const wasm::WasmCode* code, const char* name,
481 size_t length) = 0;
482#endif // V8_ENABLE_WEBASSEMBLY
483
484 std::unique_ptr<NameBuffer> name_buffer_;
485};
486
499
501 public:
502 explicit ExternalLogEventListener(Isolate* isolate);
503 ~ExternalLogEventListener() override;
504
506 const char* comment) override;
508 DirectHandle<Name> name) override;
511 DirectHandle<Name> name) override;
514 DirectHandle<Name> source, int line,
515 int column) override;
516#if V8_ENABLE_WEBASSEMBLY
517 void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code,
518 wasm::WasmName name, const char* source_url,
519 int code_offset, int script_id) override;
520#endif // V8_ENABLE_WEBASSEMBLY
521
524 RegExpFlags flags) override;
525 void CallbackEvent(DirectHandle<Name> name, Address entry_point) override {}
527 Address entry_point) override {}
529 Address entry_point) override {}
530 void SharedFunctionInfoMoveEvent(Address from, Address to) override {}
531 void NativeContextMoveEvent(Address from, Address to) override {}
533 Tagged<InstructionStream> to) override;
535 Tagged<BytecodeArray> to) override;
538 void CodeMovingGCEvent() override {}
540 int fp_to_sp_delta) override {}
543 const char* reason) override {}
544 void WeakCodeClearEvent() override {}
545
546 void StartListening(v8::CodeEventHandler* code_event_handler);
547 void StopListening();
548
549 bool is_listening_to_code_events() override { return true; }
550
551 private:
552 void LogExistingCode();
553
557};
558
559} // namespace internal
560} // namespace v8
561
562#endif // V8_LOGGING_LOG_H_
Isolate * isolate_
Builtins::Kind kind
Definition builtins.cc:40
SourcePosition pos
void GetterCallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.h:453
void CodeMovingGCEvent() override
Definition log.h:459
void SetterCallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.h:455
void WeakCodeClearEvent() override
Definition log.h:465
std::unique_ptr< NameBuffer > name_buffer_
Definition log.h:484
bool is_listening_to_code_events() override
Definition log.h:467
void CallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.h:452
void NativeContextMoveEvent(Address from, Address to) override
Definition log.h:458
virtual void LogRecordedBuffer(Tagged< AbstractCode > code, MaybeDirectHandle< SharedFunctionInfo > maybe_shared, const char *name, size_t length)=0
void CodeDeoptEvent(DirectHandle< Code > code, DeoptimizeKind kind, Address pc, int fp_to_sp_delta) override
Definition log.h:460
void SharedFunctionInfoMoveEvent(Address from, Address to) override
Definition log.h:457
void CodeDependencyChangeEvent(DirectHandle< Code > code, DirectHandle< SharedFunctionInfo > sfi, const char *reason) override
Definition log.h:462
void LogCompiledFunctions(bool ensure_source_positions_available=true)
Definition log.cc:2585
ExistingCodeLogger(Isolate *isolate, LogEventListener *listener=nullptr)
Definition log.h:92
void LogExistingFunction(DirectHandle< SharedFunctionInfo > shared, DirectHandle< AbstractCode > code, LogEventListener::CodeTag tag=LogEventListener::CodeTag::kFunction)
Definition log.cc:2646
LogEventListener * listener_
Definition log.h:111
void LogCodeObject(Tagged< AbstractCode > object)
Definition log.cc:2501
void StartListening(v8::CodeEventHandler *code_event_handler)
Definition log.cc:501
void CodeMoveEvent(Tagged< InstructionStream > from, Tagged< InstructionStream > to) override
Definition log.cc:655
void RegExpCodeCreateEvent(DirectHandle< AbstractCode > code, DirectHandle< String > source, RegExpFlags flags) override
Definition log.cc:617
void BytecodeMoveEvent(Tagged< BytecodeArray > from, Tagged< BytecodeArray > to) override
Definition log.cc:664
void CallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.h:525
void CodeDeoptEvent(DirectHandle< Code > code, DeoptimizeKind kind, Address pc, int fp_to_sp_delta) override
Definition log.h:539
void NativeContextMoveEvent(Address from, Address to) override
Definition log.h:531
void SetterCallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.h:528
void CodeCreateEvent(CodeTag tag, DirectHandle< AbstractCode > code, const char *comment) override
Definition log.cc:522
void CodeDisableOptEvent(DirectHandle< AbstractCode > code, DirectHandle< SharedFunctionInfo > shared) override
Definition log.h:536
void CodeMovingGCEvent() override
Definition log.h:538
ExternalLogEventListener(Isolate *isolate)
Definition log.cc:484
void GetterCallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.h:526
void SharedFunctionInfoMoveEvent(Address from, Address to) override
Definition log.h:530
void WeakCodeClearEvent() override
Definition log.h:544
bool is_listening_to_code_events() override
Definition log.h:549
void CodeDependencyChangeEvent(DirectHandle< Code > code, DirectHandle< SharedFunctionInfo > sfi, const char *reason) override
Definition log.h:541
v8::CodeEventHandler * code_event_handler_
Definition log.h:556
TimerEventScope(Isolate *isolate)
Definition log.h:415
V8_EXPORT_PRIVATE std::string file_name() const
Definition log.cc:2438
std::set< int > logged_source_code_
Definition log.h:378
V8_NOINLINE static V8_PRESERVE_MOST void CallEventLoggerInternal(Isolate *isolate, const char *name, v8::LogEventStatus se, bool expose_to_api)
Definition log.h:253
void SetterCallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.cc:1658
void MapCreate(Tagged< Map > map)
Definition log.cc:2058
void MapMoveEvent(Tagged< Map > from, Tagged< Map > to)
Definition log.cc:2082
void WriteApiEntryCall(const char *name)
Logger * logger() const
Definition log.cc:2486
void IntPtrTEvent(const char *name, intptr_t value)
Definition log.cc:1281
V8_EXPORT_PRIVATE bool is_logging()
Definition log.cc:1336
std::unique_ptr< Ticker > ticker_
Definition log.h:354
void LogCodeDisassemble(DirectHandle< AbstractCode > code)
Definition log.cc:1478
void WeakCodeClearEvent() override
Definition log.h:214
void CodeDependencyChangeEvent(DirectHandle< Code > code, DirectHandle< SharedFunctionInfo > sfi, const char *reason) override
Definition log.cc:1746
void CodeDisableOptEvent(DirectHandle< AbstractCode > code, DirectHandle< SharedFunctionInfo > shared) override
Definition log.cc:1701
static void LeaveExternal(Isolate *isolate)
void FeedbackVectorEvent(Tagged< FeedbackVector > vector, Tagged< AbstractCode > code)
Definition log.cc:1553
void DeleteEvent(const char *name, void *object)
Definition log.cc:1358
std::unique_ptr< JitLogger > jit_logger_
Definition log.h:371
static void EnterExternal(Isolate *isolate)
V8_EXPORT_PRIVATE void StopProfilerThread()
Definition log.cc:2442
void InitNameBuffer(Event tag)
void MapDetails(Tagged< Map > map)
Definition log.cc:2067
std::unique_ptr< Profiler > profiler_
Definition log.h:359
void BytecodeMoveEvent(Tagged< BytecodeArray > from, Tagged< BytecodeArray > to) override
Definition log.cc:1683
void MoveEventInternal(Event event, Address from, Address to)
Definition log.cc:1805
static V8_INLINE void CallEventLogger(Isolate *isolate, const char *name, v8::LogEventStatus se, bool expose_to_api)
Definition log.h:262
void CompilationCacheEvent(const char *action, const char *cache_type, Tagged< SharedFunctionInfo > sfi)
Definition log.cc:1859
std::atomic< bool > is_logging_
Definition log.h:364
V8_EXPORT_PRIVATE FILE * TearDownAndGetLogFile()
Definition log.cc:2449
void RegExpCodeCreateEvent(DirectHandle< AbstractCode > code, DirectHandle< String > source, RegExpFlags flags) override
Definition log.cc:1663
void WriteApiIndexedPropertyAccess(const char *tag, Tagged< JSObject > holder, uint32_t index)
bool is_listening_to_code_events() override
Definition log.h:272
void NativeContextMoveEvent(Address from, Address to) override
Definition log.h:203
void LogExistingFunction(DirectHandle< SharedFunctionInfo > shared, DirectHandle< AbstractCode > code)
Definition log.cc:2198
void ScriptEvent(ScriptEventType type, int script_id)
Definition log.cc:1876
V8_EXPORT_PRIVATE void LogAccessorCallbacks()
Definition log.cc:2210
bool EnsureLogScriptSource(Tagged< Script > script)
Definition log.cc:1925
void UncheckedStringEvent(const char *name, const char *value)
Definition log.cc:1274
void WriteApiNamedPropertyAccess(const char *tag, Tagged< JSObject > holder, Tagged< Object > name)
V8_EXPORT_PRIVATE void LogCompiledFunctions(bool ensure_source_positions_available=true)
Definition log.cc:2203
void CodeMoveEvent(Tagged< InstructionStream > from, Tagged< InstructionStream > to) override
Definition log.cc:1676
void CodeDeoptEvent(DirectHandle< Code > code, DeoptimizeKind kind, Address pc, int fp_to_sp_delta) override
Definition log.cc:1737
void CallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.cc:1649
void SharedFunctionInfoMoveEvent(Address from, Address to) override
Definition log.cc:1690
void LateSetup(Isolate *isolate)
Definition log.cc:2355
void CodeNameEvent(Address addr, int pos, const char *code_name)
Definition log.cc:1796
V8_EXPORT_PRIVATE void LogBuiltins()
Definition log.cc:2208
sampler::Sampler * sampler()
Definition log.cc:2437
void ProcessDeoptEvent(DirectHandle< Code > code, SourcePosition position, const char *kind, const char *reason)
Definition log.cc:1712
void UpdateIsLogging(bool value)
Definition log.cc:2488
void SetCodeEventHandler(uint32_t options, JitCodeEventHandler event_handler)
Definition log.cc:2413
uint32_t next_source_info_id_
Definition log.h:379
void SharedLibraryEvent(const std::string &library_path, uintptr_t start, uintptr_t end, intptr_t aslr_slide)
Definition log.cc:1290
V8_EXPORT_PRIVATE void TimerEvent(v8::LogEventStatus se, const char *name)
Definition log.cc:1318
void WriteApiObjectAccess(const char *tag, Tagged< JSReceiver > obj)
void MapEvent(const char *type, DirectHandle< Map > from, DirectHandle< Map > to, const char *reason=nullptr, DirectHandle< HeapObject > name_or_sfi=DirectHandle< HeapObject >())
Definition log.cc:2026
bool SetUp(Isolate *isolate)
Definition log.cc:2298
bool allows_code_compaction() override
Definition log.h:280
void TickEvent(TickSample *sample, bool overflow)
Definition log.cc:1971
std::unique_ptr< LogFile > log_file_
Definition log.h:365
void FunctionEvent(const char *reason, int script_id, double time_delta_ms, int start_position, int end_position, Tagged< String > function_name)
Definition log.cc:1830
void CodeLinePosInfoRecordEvent(Address code_start, Tagged< TrustedByteArray > source_position_table, JitCodeEvent::CodeType code_type)
Definition log.cc:1777
void ScriptDetails(Tagged< Script > script)
Definition log.cc:1905
void CodeCreateEvent(CodeTag tag, DirectHandle< AbstractCode > code, const char *name) override
Definition log.cc:1503
void ICEvent(const char *type, bool keyed, DirectHandle< Map > map, DirectHandle< Object > key, char old_state, char new_state, const char *modifier, const char *slow_stub_reason)
Definition log.cc:1995
V8_EXPORT_PRIVATE void StringEvent(const char *name, const char *value)
Definition log.cc:1270
void NewEvent(const char *name, void *object, size_t size)
Definition log.cc:1349
V8_EXPORT_PRIVATE void LogCodeObjects()
Definition log.cc:2196
static const LogSeparator kNext
Definition log.h:122
void GetterCallbackEvent(DirectHandle< Name > name, Address entry_point) override
Definition log.cc:1653
void LogSourceCodeInformation(DirectHandle< AbstractCode > code, DirectHandle< SharedFunctionInfo > shared)
Definition log.cc:1410
V8FileLogger(Isolate *isolate)
Definition log.cc:1230
std::unique_ptr< LowLevelLogger > ll_logger_
Definition log.h:370
void CodeMovingGCEvent() override
Definition log.cc:1695
void CallbackEventInternal(const char *prefix, DirectHandle< Name > name, Address entry_point)
Definition log.cc:1637
base::ElapsedTimer timer_
Definition log.h:387
ExistingCodeLogger existing_code_logger_
Definition log.h:385
static V8_INLINE CodeTag ToNativeByScript(CodeTag tag, Tagged< Script > script)
Definition log-inl.h:18
int start
int end
int position
Definition liveedit.cc:290
#define LOG(isolate, Call)
Definition log.h:78
#define TIMER_EVENTS_LIST(V)
Definition log.h:390
too high values may cause the compiler to set high thresholds for inlining to as much as possible avoid inlined allocation of objects that cannot escape trace load stores from virtual maglev objects use TurboFan fast string builder analyze liveness of environment slots and zap dead values trace TurboFan load elimination emit data about basic block usage in builtins to this enable builtin reordering when run mksnapshot flag for emit warnings when applying builtin profile data verify register allocation in TurboFan randomly schedule instructions to stress dependency tracking enable store store elimination in TurboFan rewrite far to near simulate GC compiler thread race related to allow float parameters to be passed in simulator mode JS Wasm Run additional turbo_optimize_inlined_js_wasm_wrappers enable experimental feedback collection in generic lowering enable Turboshaft s WasmLoadElimination enable Turboshaft s low level load elimination for JS enable Turboshaft s escape analysis for string concatenation use enable Turbolev features that we want to ship in the not too far future trace individual Turboshaft reduction steps trace intermediate Turboshaft reduction steps invocation count threshold for early optimization Enables optimizations which favor memory size over execution speed Enables sampling allocation profiler with X as a sample interval min size of a semi the new space consists of two semi spaces max size of the Collect garbage after Collect garbage after keeps maps alive for< n > old space garbage collections print one detailed trace line in name
Definition flags.cc:2086
V8_EXPORT_PRIVATE FlagValues v8_flags
void(*)(const JitCodeEvent *event) JitCodeEventHandler
LogEventStatus
@ kStart
CodeEventType
#define V8_EXPORT_PRIVATE
Definition macros.h:460
DirectHandle< String > script_name
Definition log.h:492
CodeEventType code_type
Definition log.h:495
uintptr_t code_start_address
Definition log.h:489
uintptr_t previous_code_start_address
Definition log.h:497
Isolate * isolate_
Definition log.h:488
DirectHandle< String > function_name
Definition log.h:491
const char * comment
Definition log.h:496
#define V8_INLINE
Definition v8config.h:500
#define V8_UNLIKELY(condition)
Definition v8config.h:660
#define V8_NOINLINE
Definition v8config.h:586
#define V8_PRESERVE_MOST
Definition v8config.h:598
#define V8_NODISCARD
Definition v8config.h:693