diff options
Diffstat (limited to 'chromium/v8/src/logging')
-rw-r--r-- | chromium/v8/src/logging/code-events.h | 81 | ||||
-rw-r--r-- | chromium/v8/src/logging/counters-definitions.h | 84 | ||||
-rw-r--r-- | chromium/v8/src/logging/counters.cc | 2 | ||||
-rw-r--r-- | chromium/v8/src/logging/counters.h | 2 | ||||
-rw-r--r-- | chromium/v8/src/logging/log-inl.h | 14 | ||||
-rw-r--r-- | chromium/v8/src/logging/log.cc | 458 | ||||
-rw-r--r-- | chromium/v8/src/logging/log.h | 52 | ||||
-rw-r--r-- | chromium/v8/src/logging/runtime-call-stats.cc | 1 | ||||
-rw-r--r-- | chromium/v8/src/logging/runtime-call-stats.h | 8 |
9 files changed, 377 insertions, 325 deletions
diff --git a/chromium/v8/src/logging/code-events.h b/chromium/v8/src/logging/code-events.h index 8797e280dcd..01d1c5ea5ef 100644 --- a/chromium/v8/src/logging/code-events.h +++ b/chromium/v8/src/logging/code-events.h @@ -28,64 +28,56 @@ class WasmCode; using WasmName = base::Vector<const char>; } // namespace wasm -// clang-format off -#define LOG_EVENTS_LIST(V) \ - V(CODE_CREATION_EVENT, code-creation) \ - V(CODE_DISABLE_OPT_EVENT, code-disable-optimization) \ - V(CODE_MOVE_EVENT, code-move) \ - V(CODE_DELETE_EVENT, code-delete) \ - V(CODE_MOVING_GC, code-moving-gc) \ - V(SHARED_FUNC_MOVE_EVENT, sfi-move) \ - V(SNAPSHOT_CODE_NAME_EVENT, snapshot-code-name) \ - V(TICK_EVENT, tick) -// clang-format on +#define LOG_EVENT_LIST(V) \ + V(kCodeCreation, "code-creation") \ + V(kCodeDisableOpt, "code-disable-optimization") \ + V(kCodeMove, "code-move") \ + V(kCodeDeopt, "code-deopt") \ + V(kCodeDelete, "code-delete") \ + V(kCodeMovingGC, "code-moving-gc") \ + V(kSharedFuncMove, "sfi-move") \ + V(kSnapshotCodeName, "snapshot-code-name") \ + V(kTick, "tick") -#define TAGS_LIST(V) \ - V(BUILTIN_TAG, Builtin) \ - V(CALLBACK_TAG, Callback) \ - V(EVAL_TAG, Eval) \ - V(FUNCTION_TAG, Function) \ - V(HANDLER_TAG, Handler) \ - V(BYTECODE_HANDLER_TAG, BytecodeHandler) \ - V(LAZY_COMPILE_TAG, LazyCompile) \ - V(REG_EXP_TAG, RegExp) \ - V(SCRIPT_TAG, Script) \ - V(STUB_TAG, Stub) \ - V(NATIVE_FUNCTION_TAG, Function) \ - V(NATIVE_LAZY_COMPILE_TAG, LazyCompile) \ - V(NATIVE_SCRIPT_TAG, Script) -// Note that 'NATIVE_' cases for functions and scripts are mapped onto +#define CODE_TYPE_LIST(V) \ + V(kBuiltin, Builtin) \ + V(kCallback, Callback) \ + V(kEval, Eval) \ + V(kFunction, JS) \ + V(kHandler, Handler) \ + V(kBytecodeHandler, BytecodeHandler) \ + V(kRegExp, RegExp) \ + V(kScript, Script) \ + V(kStub, Stub) \ + V(kNativeFunction, JS) \ + V(kNativeScript, Script) +// Note that 'Native' cases for functions and scripts are mapped onto // original tags when writing to the log. -#define LOG_EVENTS_AND_TAGS_LIST(V) \ - LOG_EVENTS_LIST(V) \ - TAGS_LIST(V) - #define PROFILE(the_isolate, Call) (the_isolate)->logger()->Call; class LogEventListener { public: #define DECLARE_ENUM(enum_item, _) enum_item, - enum LogEventsAndTags { - LOG_EVENTS_AND_TAGS_LIST(DECLARE_ENUM) NUMBER_OF_LOG_EVENTS - }; + enum class Event : uint8_t { LOG_EVENT_LIST(DECLARE_ENUM) kLength }; + enum class CodeTag : uint8_t { CODE_TYPE_LIST(DECLARE_ENUM) kLength }; #undef DECLARE_ENUM virtual ~LogEventListener() = default; - virtual void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + virtual void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* name) = 0; - virtual void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + virtual void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) = 0; - virtual void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + virtual void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name) = 0; - virtual void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + virtual void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name, int line, int column) = 0; #if V8_ENABLE_WEBASSEMBLY - virtual void CodeCreateEvent(LogEventsAndTags tag, const wasm::WasmCode* code, + virtual void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, int code_offset, int script_id) = 0; #endif // V8_ENABLE_WEBASSEMBLY @@ -119,7 +111,8 @@ class LogEventListener { // Dispatches code events to a set of registered listeners. class Logger { public: - using LogEventsAndTags = LogEventListener::LogEventsAndTags; + using Event = LogEventListener::Event; + using CodeTag = LogEventListener::CodeTag; Logger() = default; Logger(const Logger&) = delete; @@ -153,28 +146,28 @@ class Logger { return _is_listening_to_code_events; } - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* comment) { base::MutexGuard guard(&mutex_); for (auto listener : listeners_) { listener->CodeCreateEvent(tag, code, comment); } } - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) { base::MutexGuard guard(&mutex_); for (auto listener : listeners_) { listener->CodeCreateEvent(tag, code, name); } } - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> name) { base::MutexGuard guard(&mutex_); for (auto listener : listeners_) { listener->CodeCreateEvent(tag, code, shared, name); } } - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> source, int line, int column) { base::MutexGuard guard(&mutex_); @@ -183,7 +176,7 @@ class Logger { } } #if V8_ENABLE_WEBASSEMBLY - void CodeCreateEvent(LogEventsAndTags tag, const wasm::WasmCode* code, + void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, int code_offset, int script_id) { base::MutexGuard guard(&mutex_); diff --git a/chromium/v8/src/logging/counters-definitions.h b/chromium/v8/src/logging/counters-definitions.h index 11c9ccaac85..e1e27fb4ed5 100644 --- a/chromium/v8/src/logging/counters-definitions.h +++ b/chromium/v8/src/logging/counters-definitions.h @@ -99,25 +99,33 @@ namespace internal { /* Backtracks observed in a single regexp interpreter execution */ \ /* The maximum of 100M backtracks takes roughly 2 seconds on my machine. */ \ HR(regexp_backtracks, V8.RegExpBacktracks, 1, 100000000, 50) \ - /* See the CagedMemoryAllocationOutcome enum in backing-store.cc */ \ - HR(caged_memory_allocation_outcome, V8.CagedMemoryAllocationOutcome, 0, 2, \ - 3) \ /* number of times a cache event is triggered for a wasm module */ \ HR(wasm_cache_count, V8.WasmCacheCount, 0, 100, 101) \ - SANDBOXED_HISTOGRAM_LIST(HR) - -#ifdef V8_ENABLE_SANDBOX -#define SANDBOXED_HISTOGRAM_LIST(HR) \ - /* Number of in-use external pointers in the external pointer table */ \ - /* Counted after sweeping the table at the end of mark-compact GC */ \ - HR(sandboxed_external_pointers_count, V8.SandboxedExternalPointersCount, 0, \ - kMaxSandboxedExternalPointers, 101) -#else -#define SANDBOXED_HISTOGRAM_LIST(HR) -#endif // V8_ENABLE_SANDBOX + HR(wasm_streaming_until_compilation_finished, \ + V8.WasmStreamingUntilCompilationFinishedMilliSeconds, 0, 10000, 50) \ + HR(wasm_compilation_until_streaming_finished, \ + V8.WasmCompilationUntilStreamFinishedMilliSeconds, 0, 10000, 50) \ + /* Number of in-use external pointers in the external pointer table */ \ + /* Counted after sweeping the table at the end of mark-compact GC */ \ + HR(external_pointers_count, V8.SandboxedExternalPointersCount, 0, \ + kMaxExternalPointers, 101) \ + HR(wasm_num_lazy_compilations_5sec, V8.WasmNumLazyCompilations5Sec, 0, \ + 200000, 50) \ + HR(wasm_num_lazy_compilations_20sec, V8.WasmNumLazyCompilations20Sec, 0, \ + 200000, 50) \ + HR(wasm_num_lazy_compilations_60sec, V8.WasmNumLazyCompilations60Sec, 0, \ + 200000, 50) \ + HR(wasm_num_lazy_compilations_120sec, V8.WasmNumLazyCompilations120Sec, 0, \ + 200000, 50) \ + /* Outcome of external pointer table compaction: kSuccess, */ \ + /* kPartialSuccessor kAbortedDuringSweeping. See */ \ + /* ExternalPointerTable::TableCompactionOutcome enum for more details */ \ + HR(external_pointer_table_compaction_outcome, \ + V8.ExternalPointerTableCompactionOutcome, 0, 2, 3) #define NESTED_TIMED_HISTOGRAM_LIST(HT) \ - /* Timer histograms, not thread safe: HT(name, caption, max, unit) */ \ + /* Nested timer histograms allow distributions of nested timed results. */ \ + /* HT(name, caption, max, unit) */ \ /* Garbage collection timers. */ \ HT(gc_idle_notification, V8.GCIdleNotification, 10000, MILLISECOND) \ HT(gc_incremental_marking, V8.GCIncrementalMarking, 10000, MILLISECOND) \ @@ -137,12 +145,7 @@ namespace internal { HT(compile_deserialize, V8.CompileDeserializeMicroSeconds, 1000000, \ MICROSECOND) \ /* Total compilation time incl. caching/parsing */ \ - HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) \ - /* Time for lazily compiling Wasm functions. */ \ - HT(wasm_lazy_compile_time, V8.WasmLazyCompileTimeMicroSeconds, 100000000, \ - MICROSECOND) \ - HT(wasm_compile_after_deserialize, \ - V8.WasmCompileAfterDeserializeMilliSeconds, 1000000, MILLISECOND) + HT(compile_script, V8.CompileScriptMicroSeconds, 1000000, MICROSECOND) #define NESTED_TIMED_HISTOGRAM_LIST_SLOW(HT) \ /* Total V8 time (including JS and runtime calls, exluding callbacks) */ \ @@ -228,6 +231,10 @@ namespace internal { MILLISECOND) \ HT(wasm_time_between_catch, V8.WasmTimeBetweenCatchMilliseconds, 1000, \ MILLISECOND) \ + HT(wasm_lazy_compile_time, V8.WasmLazyCompileTimeMicroSeconds, 100000000, \ + MICROSECOND) \ + HT(wasm_compile_after_deserialize, \ + V8.WasmCompileAfterDeserializeMilliSeconds, 1000000, MILLISECOND) \ /* Total compilation time incl. caching/parsing for various cache states. */ \ HT(compile_script_with_produce_cache, \ V8.CompileScriptMicroSeconds.ProduceCache, 1000000, MICROSECOND) \ @@ -251,7 +258,23 @@ namespace internal { HT(compile_script_on_background, \ V8.CompileScriptMicroSeconds.BackgroundThread, 1000000, MICROSECOND) \ HT(compile_function_on_background, \ - V8.CompileFunctionMicroSeconds.BackgroundThread, 1000000, MICROSECOND) + V8.CompileFunctionMicroSeconds.BackgroundThread, 1000000, MICROSECOND) \ + HT(wasm_max_lazy_compilation_time_5sec, \ + V8.WasmMaxLazyCompilationTime5SecMilliSeconds, 5000, MILLISECOND) \ + HT(wasm_max_lazy_compilation_time_20sec, \ + V8.WasmMaxLazyCompilationTime20SecMilliSeconds, 5000, MILLISECOND) \ + HT(wasm_max_lazy_compilation_time_60sec, \ + V8.WasmMaxLazyCompilationTime60SecMilliSeconds, 5000, MILLISECOND) \ + HT(wasm_max_lazy_compilation_time_120sec, \ + V8.WasmMaxLazyCompilationTime120SecMilliSeconds, 5000, MILLISECOND) \ + HT(wasm_sum_lazy_compilation_time_5sec, \ + V8.WasmSumLazyCompilationTime5SecMilliSeconds, 20000, MILLISECOND) \ + HT(wasm_sum_lazy_compilation_time_20sec, \ + V8.WasmSumLazyCompilationTime20SecMilliSeconds, 20000, MILLISECOND) \ + HT(wasm_sum_lazy_compilation_time_60sec, \ + V8.WasmSumLazyCompilationTime60SecMilliSeconds, 20000, MILLISECOND) \ + HT(wasm_sum_lazy_compilation_time_120sec, \ + V8.WasmSumLazyCompilationTime120SecMilliSeconds, 20000, MILLISECOND) #define AGGREGATABLE_HISTOGRAM_TIMER_LIST(AHT) \ AHT(compile_lazy, V8.CompileLazyMicroSeconds) @@ -278,13 +301,16 @@ namespace internal { // lines) rather than one macro (of length about 80 lines) to work around // this problem. Please avoid using recursive macros of this length when // possible. -#define STATS_COUNTER_LIST_1(SC) \ - /* Global Handle Count*/ \ - SC(global_handles, V8.GlobalHandles) \ - SC(alive_after_last_gc, V8.AliveAfterLastGC) \ - SC(compilation_cache_hits, V8.CompilationCacheHits) \ - SC(compilation_cache_misses, V8.CompilationCacheMisses) \ - SC(objs_since_last_young, V8.ObjsSinceLastYoung) \ +#define STATS_COUNTER_LIST_1(SC) \ + /* Global Handle Count*/ \ + SC(global_handles, V8.GlobalHandles) \ + SC(alive_after_last_gc, V8.AliveAfterLastGC) \ + SC(compilation_cache_hits, V8.CompilationCacheHits) \ + SC(compilation_cache_misses, V8.CompilationCacheMisses) \ + /* Number of times the cache contained a reusable Script but not \ + the root SharedFunctionInfo */ \ + SC(compilation_cache_partial_hits, V8.CompilationCachePartialHits) \ + SC(objs_since_last_young, V8.ObjsSinceLastYoung) \ SC(objs_since_last_full, V8.ObjsSinceLastFull) #define STATS_COUNTER_LIST_2(SC) \ diff --git a/chromium/v8/src/logging/counters.cc b/chromium/v8/src/logging/counters.cc index b7c9844b48d..a009025fba0 100644 --- a/chromium/v8/src/logging/counters.cc +++ b/chromium/v8/src/logging/counters.cc @@ -52,7 +52,7 @@ void Histogram::AddSample(int sample) { } } -V8_EXPORT_PRIVATE void* Histogram::CreateHistogram() const { +void* Histogram::CreateHistogram() const { return counters_->CreateHistogram(name_, min_, max_, num_buckets_); } diff --git a/chromium/v8/src/logging/counters.h b/chromium/v8/src/logging/counters.h index 2c74a8ecd88..1e284bf3312 100644 --- a/chromium/v8/src/logging/counters.h +++ b/chromium/v8/src/logging/counters.h @@ -155,7 +155,7 @@ class StatsCounter { class Histogram { public: // Add a single sample to this histogram. - void AddSample(int sample); + V8_EXPORT_PRIVATE void AddSample(int sample); // Returns true if this histogram is enabled. bool Enabled() { return histogram_ != nullptr; } diff --git a/chromium/v8/src/logging/log-inl.h b/chromium/v8/src/logging/log-inl.h index 764ba3dd174..602a9758162 100644 --- a/chromium/v8/src/logging/log-inl.h +++ b/chromium/v8/src/logging/log-inl.h @@ -13,16 +13,14 @@ namespace v8 { namespace internal { -LogEventListener::LogEventsAndTags V8FileLogger::ToNativeByScript( - LogEventListener::LogEventsAndTags tag, Script script) { +LogEventListener::CodeTag V8FileLogger::ToNativeByScript( + LogEventListener::CodeTag tag, Script script) { if (script.type() != Script::TYPE_NATIVE) return tag; switch (tag) { - case LogEventListener::FUNCTION_TAG: - return LogEventListener::NATIVE_FUNCTION_TAG; - case LogEventListener::LAZY_COMPILE_TAG: - return LogEventListener::NATIVE_LAZY_COMPILE_TAG; - case LogEventListener::SCRIPT_TAG: - return LogEventListener::NATIVE_SCRIPT_TAG; + case LogEventListener::CodeTag::kFunction: + return LogEventListener::CodeTag::kNativeFunction; + case LogEventListener::CodeTag::kScript: + return LogEventListener::CodeTag::kNativeScript; default: return tag; } diff --git a/chromium/v8/src/logging/log.cc b/chromium/v8/src/logging/log.cc index cf4d248de3c..e780ff4e777 100644 --- a/chromium/v8/src/logging/log.cc +++ b/chromium/v8/src/logging/log.cc @@ -30,6 +30,7 @@ #include "src/interpreter/bytecodes.h" #include "src/interpreter/interpreter.h" #include "src/libsampler/sampler.h" +#include "src/logging/code-events.h" #include "src/logging/counters.h" #include "src/logging/log-file.h" #include "src/logging/log-inl.h" @@ -55,36 +56,65 @@ #endif // V8_ENABLE_WEBASSEMBLY #if V8_OS_WIN -#if defined(V8_ENABLE_SYSTEM_INSTRUMENTATION) -#include "src/diagnostics/system-jit-win.h" +#if defined(V8_ENABLE_ETW_STACK_WALKING) +#include "src/diagnostics/etw-jit-win.h" #endif #endif // V8_OS_WIN namespace v8 { namespace internal { +static const char* kLogEventsNames[] = { +#define DECLARE_EVENT(ignore1, name) name, + LOG_EVENT_LIST(DECLARE_EVENT) +#undef DECLARE_EVENT +}; +static const char* kCodeTagNames[] = { #define DECLARE_EVENT(ignore1, name) #name, -static const char* kLogEventsNames[LogEventListener::NUMBER_OF_LOG_EVENTS] = { - LOG_EVENTS_AND_TAGS_LIST(DECLARE_EVENT)}; + CODE_TYPE_LIST(DECLARE_EVENT) #undef DECLARE_EVENT +}; + +std::ostream& operator<<(std::ostream& os, LogEventListener::CodeTag tag) { + os << kCodeTagNames[static_cast<int>(tag)]; + return os; +} +std::ostream& operator<<(std::ostream& os, LogEventListener::Event event) { + os << kLogEventsNames[static_cast<int>(event)]; + return os; +} -static v8::CodeEventType GetCodeEventTypeForTag( - LogEventListener::LogEventsAndTags tag) { +namespace { + +v8::CodeEventType GetCodeEventTypeForTag(LogEventListener::CodeTag tag) { switch (tag) { - case LogEventListener::NUMBER_OF_LOG_EVENTS: -#define V(Event, _) case LogEventListener::Event: - LOG_EVENTS_LIST(V) -#undef V - return v8::CodeEventType::kUnknownType; -#define V(From, To) \ - case LogEventListener::From: \ - return v8::CodeEventType::k##To##Type; - TAGS_LIST(V) -#undef V + case LogEventListener::CodeTag::kLength: + // Manually create this switch, since v8::CodeEventType is API expose and + // cannot be easily modified. + case LogEventListener::CodeTag::kBuiltin: + return v8::CodeEventType::kBuiltinType; + case LogEventListener::CodeTag::kCallback: + return v8::CodeEventType::kCallbackType; + case LogEventListener::CodeTag::kEval: + return v8::CodeEventType::kEvalType; + case LogEventListener::CodeTag::kNativeFunction: + case LogEventListener::CodeTag::kFunction: + return v8::CodeEventType::kFunctionType; + case LogEventListener::CodeTag::kHandler: + return v8::CodeEventType::kHandlerType; + case LogEventListener::CodeTag::kBytecodeHandler: + return v8::CodeEventType::kBytecodeHandlerType; + case LogEventListener::CodeTag::kRegExp: + return v8::CodeEventType::kRegExpType; + case LogEventListener::CodeTag::kNativeScript: + case LogEventListener::CodeTag::kScript: + return v8::CodeEventType::kScriptType; + case LogEventListener::CodeTag::kStub: + return v8::CodeEventType::kStubType; } - // The execution should never pass here UNREACHABLE(); } + #define CALL_CODE_EVENT_HANDLER(Call) \ if (listener_) { \ listener_->Call; \ @@ -92,14 +122,14 @@ static v8::CodeEventType GetCodeEventTypeForTag( PROFILE(isolate_, Call); \ } -static const char* ComputeMarker(SharedFunctionInfo shared, AbstractCode code) { - CodeKind kind = code.kind(); +const char* ComputeMarker(SharedFunctionInfo shared, AbstractCode code) { + PtrComprCageBase cage_base = GetPtrComprCageBase(shared); + CodeKind kind = code.kind(cage_base); // We record interpreter trampoline builtin copies as having the // "interpreted" marker. if (FLAG_interpreted_frames_native_stack && kind == CodeKind::BUILTIN && - code.GetCode().is_interpreter_trampoline_builtin() && - ToCodeT(code.GetCode()) != - *BUILTIN_CODE(shared.GetIsolate(), InterpreterEntryTrampoline)) { + !code.is_off_heap_trampoline(cage_base)) { + DCHECK_EQ(code.builtin_id(cage_base), Builtin::kInterpreterEntryTrampoline); kind = CodeKind::INTERPRETED_FUNCTION; } if (shared.optimization_disabled() && @@ -110,7 +140,7 @@ static const char* ComputeMarker(SharedFunctionInfo shared, AbstractCode code) { } #if V8_ENABLE_WEBASSEMBLY -static const char* ComputeMarker(const wasm::WasmCode* code) { +const char* ComputeMarker(const wasm::WasmCode* code) { switch (code->kind()) { case wasm::WasmCode::kWasmFunction: return code->is_liftoff() ? "" : "*"; @@ -120,15 +150,17 @@ static const char* ComputeMarker(const wasm::WasmCode* code) { } #endif // V8_ENABLE_WEBASSEMBLY +} // namespace + class CodeEventLogger::NameBuffer { public: NameBuffer() { Reset(); } void Reset() { utf8_pos_ = 0; } - void Init(LogEventsAndTags tag) { + void Init(CodeTag tag) { Reset(); - AppendBytes(kLogEventsNames[tag]); + AppendBytes(kCodeTagNames[static_cast<int>(tag)]); AppendByte(':'); } @@ -210,8 +242,7 @@ CodeEventLogger::CodeEventLogger(Isolate* isolate) CodeEventLogger::~CodeEventLogger() = default; -void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void CodeEventLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* comment) { DCHECK(is_listening_to_code_events()); name_buffer_->Init(tag); @@ -220,8 +251,7 @@ void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, name_buffer_->get(), name_buffer_->size()); } -void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void CodeEventLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) { DCHECK(is_listening_to_code_events()); name_buffer_->Init(tag); @@ -230,8 +260,7 @@ void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, name_buffer_->get(), name_buffer_->size()); } -void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void CodeEventLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name) { DCHECK(is_listening_to_code_events()); @@ -242,8 +271,7 @@ void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, LogRecordedBuffer(code, shared, name_buffer_->get(), name_buffer_->size()); } -void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void CodeEventLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name, int line, int column) { @@ -267,8 +295,7 @@ void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, } #if V8_ENABLE_WEBASSEMBLY -void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, - const wasm::WasmCode* code, +void CodeEventLogger::CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, int /*code_offset*/, int /*script_id*/) { @@ -291,7 +318,7 @@ void CodeEventLogger::CodeCreateEvent(LogEventsAndTags tag, void CodeEventLogger::RegExpCodeCreateEvent(Handle<AbstractCode> code, Handle<String> source) { DCHECK(is_listening_to_code_events()); - name_buffer_->Init(LogEventListener::REG_EXP_TAG); + name_buffer_->Init(LogEventListener::CodeTag::kRegExp); name_buffer_->AppendString(*source); LogRecordedBuffer(code, MaybeHandle<SharedFunctionInfo>(), name_buffer_->get(), name_buffer_->size()); @@ -388,13 +415,15 @@ void LinuxPerfBasicLogger::WriteLogRecordedBuffer(uintptr_t address, int size, void LinuxPerfBasicLogger::LogRecordedBuffer(Handle<AbstractCode> code, MaybeHandle<SharedFunctionInfo>, const char* name, int length) { + PtrComprCageBase cage_base(isolate_); if (FLAG_perf_basic_prof_only_functions && - CodeKindIsBuiltinOrJSFunction(code->kind())) { + CodeKindIsBuiltinOrJSFunction(code->kind(cage_base))) { return; } - WriteLogRecordedBuffer(static_cast<uintptr_t>(code->InstructionStart()), - code->InstructionSize(), name, length); + WriteLogRecordedBuffer( + static_cast<uintptr_t>(code->InstructionStart(cage_base)), + code->InstructionSize(cage_base), name, length); } #if V8_ENABLE_WEBASSEMBLY @@ -419,6 +448,7 @@ ExternalLogEventListener::~ExternalLogEventListener() { void ExternalLogEventListener::LogExistingCode() { HandleScope scope(isolate_); ExistingCodeLogger logger(isolate_, this); + logger.LogBuiltins(); logger.LogCodeObjects(); logger.LogCompiledFunctions(); } @@ -444,13 +474,14 @@ void ExternalLogEventListener::StopListening() { is_listening_ = false; } -void ExternalLogEventListener::CodeCreateEvent(LogEventsAndTags tag, +void ExternalLogEventListener::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* comment) { + PtrComprCageBase cage_base(isolate_); CodeEvent code_event; code_event.code_start_address = - static_cast<uintptr_t>(code->InstructionStart()); - code_event.code_size = static_cast<size_t>(code->InstructionSize()); + static_cast<uintptr_t>(code->InstructionStart(cage_base)); + code_event.code_size = static_cast<size_t>(code->InstructionSize(cage_base)); code_event.function_name = isolate_->factory()->empty_string(); code_event.script_name = isolate_->factory()->empty_string(); code_event.script_line = 0; @@ -461,16 +492,17 @@ void ExternalLogEventListener::CodeCreateEvent(LogEventsAndTags tag, code_event_handler_->Handle(reinterpret_cast<v8::CodeEvent*>(&code_event)); } -void ExternalLogEventListener::CodeCreateEvent(LogEventsAndTags tag, +void ExternalLogEventListener::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) { Handle<String> name_string = Name::ToFunctionName(isolate_, name).ToHandleChecked(); + PtrComprCageBase cage_base(isolate_); CodeEvent code_event; code_event.code_start_address = - static_cast<uintptr_t>(code->InstructionStart()); - code_event.code_size = static_cast<size_t>(code->InstructionSize()); + static_cast<uintptr_t>(code->InstructionStart(cage_base)); + code_event.code_size = static_cast<size_t>(code->InstructionSize(cage_base)); code_event.function_name = name_string; code_event.script_name = isolate_->factory()->empty_string(); code_event.script_line = 0; @@ -482,15 +514,16 @@ void ExternalLogEventListener::CodeCreateEvent(LogEventsAndTags tag, } void ExternalLogEventListener::CodeCreateEvent( - LogEventsAndTags tag, Handle<AbstractCode> code, - Handle<SharedFunctionInfo> shared, Handle<Name> name) { + CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, + Handle<Name> name) { Handle<String> name_string = Name::ToFunctionName(isolate_, name).ToHandleChecked(); + PtrComprCageBase cage_base(isolate_); CodeEvent code_event; code_event.code_start_address = - static_cast<uintptr_t>(code->InstructionStart()); - code_event.code_size = static_cast<size_t>(code->InstructionSize()); + static_cast<uintptr_t>(code->InstructionStart(cage_base)); + code_event.code_size = static_cast<size_t>(code->InstructionSize(cage_base)); code_event.function_name = name_string; code_event.script_name = isolate_->factory()->empty_string(); code_event.script_line = 0; @@ -502,19 +535,19 @@ void ExternalLogEventListener::CodeCreateEvent( } void ExternalLogEventListener::CodeCreateEvent( - LogEventsAndTags tag, Handle<AbstractCode> code, - Handle<SharedFunctionInfo> shared, Handle<Name> source, int line, - int column) { + CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, + Handle<Name> source, int line, int column) { Handle<String> name_string = Name::ToFunctionName(isolate_, handle(shared->Name(), isolate_)) .ToHandleChecked(); Handle<String> source_string = Name::ToFunctionName(isolate_, source).ToHandleChecked(); + PtrComprCageBase cage_base(isolate_); CodeEvent code_event; code_event.code_start_address = - static_cast<uintptr_t>(code->InstructionStart()); - code_event.code_size = static_cast<size_t>(code->InstructionSize()); + static_cast<uintptr_t>(code->InstructionStart(cage_base)); + code_event.code_size = static_cast<size_t>(code->InstructionSize(cage_base)); code_event.function_name = name_string; code_event.script_name = source_string; code_event.script_line = line; @@ -526,7 +559,7 @@ void ExternalLogEventListener::CodeCreateEvent( } #if V8_ENABLE_WEBASSEMBLY -void ExternalLogEventListener::CodeCreateEvent(LogEventsAndTags tag, +void ExternalLogEventListener::CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, @@ -537,15 +570,17 @@ void ExternalLogEventListener::CodeCreateEvent(LogEventsAndTags tag, void ExternalLogEventListener::RegExpCodeCreateEvent(Handle<AbstractCode> code, Handle<String> source) { + PtrComprCageBase cage_base(isolate_); CodeEvent code_event; code_event.code_start_address = - static_cast<uintptr_t>(code->InstructionStart()); - code_event.code_size = static_cast<size_t>(code->InstructionSize()); + static_cast<uintptr_t>(code->InstructionStart(cage_base)); + code_event.code_size = static_cast<size_t>(code->InstructionSize(cage_base)); code_event.function_name = source; code_event.script_name = isolate_->factory()->empty_string(); code_event.script_line = 0; code_event.script_column = 0; - code_event.code_type = GetCodeEventTypeForTag(LogEventListener::REG_EXP_TAG); + code_event.code_type = + GetCodeEventTypeForTag(LogEventListener::CodeTag::kRegExp); code_event.comment = ""; code_event_handler_->Handle(reinterpret_cast<v8::CodeEvent*>(&code_event)); @@ -553,11 +588,13 @@ void ExternalLogEventListener::RegExpCodeCreateEvent(Handle<AbstractCode> code, void ExternalLogEventListener::CodeMoveEvent(AbstractCode from, AbstractCode to) { + PtrComprCageBase cage_base(isolate_); CodeEvent code_event; code_event.previous_code_start_address = - static_cast<uintptr_t>(from.InstructionStart()); - code_event.code_start_address = static_cast<uintptr_t>(to.InstructionStart()); - code_event.code_size = static_cast<size_t>(to.InstructionSize()); + static_cast<uintptr_t>(from.InstructionStart(cage_base)); + code_event.code_start_address = + static_cast<uintptr_t>(to.InstructionStart(cage_base)); + code_event.code_size = static_cast<size_t>(to.InstructionSize(cage_base)); code_event.function_name = isolate_->factory()->empty_string(); code_event.script_name = isolate_->factory()->empty_string(); code_event.script_line = 0; @@ -665,6 +702,8 @@ void LowLevelLogger::LogCodeInfo() { const char arch[] = "s390"; #elif V8_TARGET_ARCH_RISCV64 const char arch[] = "riscv64"; +#elif V8_TARGET_ARCH_RISCV32 + const char arch[] = "riscv32"; #else const char arch[] = "unknown"; #endif @@ -674,14 +713,16 @@ void LowLevelLogger::LogCodeInfo() { void LowLevelLogger::LogRecordedBuffer(Handle<AbstractCode> code, MaybeHandle<SharedFunctionInfo>, const char* name, int length) { + PtrComprCageBase cage_base(isolate_); CodeCreateStruct event; event.name_size = length; - event.code_address = code->InstructionStart(); - event.code_size = code->InstructionSize(); + event.code_address = code->InstructionStart(cage_base); + event.code_size = code->InstructionSize(cage_base); LogWriteStruct(event); LogWriteBytes(name, length); - LogWriteBytes(reinterpret_cast<const char*>(code->InstructionStart()), - code->InstructionSize()); + LogWriteBytes( + reinterpret_cast<const char*>(code->InstructionStart(cage_base)), + code->InstructionSize(cage_base)); } #if V8_ENABLE_WEBASSEMBLY @@ -699,9 +740,10 @@ void LowLevelLogger::LogRecordedBuffer(const wasm::WasmCode* code, #endif // V8_ENABLE_WEBASSEMBLY void LowLevelLogger::CodeMoveEvent(AbstractCode from, AbstractCode to) { + PtrComprCageBase cage_base(isolate_); CodeMoveStruct event; - event.from_address = from.InstructionStart(); - event.to_address = to.InstructionStart(); + event.from_address = from.InstructionStart(cage_base); + event.to_address = to.InstructionStart(cage_base); LogWriteStruct(event); } @@ -754,14 +796,16 @@ JitLogger::JitLogger(Isolate* isolate, JitCodeEventHandler code_event_handler) void JitLogger::LogRecordedBuffer(Handle<AbstractCode> code, MaybeHandle<SharedFunctionInfo> maybe_shared, const char* name, int length) { - JitCodeEvent event = {}; + PtrComprCageBase cage_base(isolate_); + JitCodeEvent event; event.type = JitCodeEvent::CODE_ADDED; - event.code_start = reinterpret_cast<void*>(code->InstructionStart()); - event.code_type = - code->IsCode() ? JitCodeEvent::JIT_CODE : JitCodeEvent::BYTE_CODE; - event.code_len = code->InstructionSize(); + event.code_start = reinterpret_cast<void*>(code->InstructionStart(cage_base)); + event.code_type = code->IsCode(cage_base) ? JitCodeEvent::JIT_CODE + : JitCodeEvent::BYTE_CODE; + event.code_len = code->InstructionSize(cage_base); Handle<SharedFunctionInfo> shared; - if (maybe_shared.ToHandle(&shared) && shared->script().IsScript()) { + if (maybe_shared.ToHandle(&shared) && + shared->script(cage_base).IsScript(cage_base)) { event.script = ToApiHandle<v8::UnboundScript>(shared); } else { event.script = Local<v8::UnboundScript>(); @@ -775,7 +819,7 @@ void JitLogger::LogRecordedBuffer(Handle<AbstractCode> code, #if V8_ENABLE_WEBASSEMBLY void JitLogger::LogRecordedBuffer(const wasm::WasmCode* code, const char* name, int length) { - JitCodeEvent event = {}; + JitCodeEvent event; event.type = JitCodeEvent::CODE_ADDED; event.code_type = JitCodeEvent::WASM_CODE; event.code_start = code->instructions().begin(); @@ -826,13 +870,15 @@ void JitLogger::LogRecordedBuffer(const wasm::WasmCode* code, const char* name, void JitLogger::CodeMoveEvent(AbstractCode from, AbstractCode to) { base::MutexGuard guard(&logger_mutex_); + PtrComprCageBase cage_base(isolate_); JitCodeEvent event; event.type = JitCodeEvent::CODE_MOVED; event.code_type = - from.IsCode() ? JitCodeEvent::JIT_CODE : JitCodeEvent::BYTE_CODE; - event.code_start = reinterpret_cast<void*>(from.InstructionStart()); - event.code_len = from.InstructionSize(); - event.new_code_start = reinterpret_cast<void*>(to.InstructionStart()); + from.IsCode(cage_base) ? JitCodeEvent::JIT_CODE : JitCodeEvent::BYTE_CODE; + event.code_start = reinterpret_cast<void*>(from.InstructionStart(cage_base)); + event.code_len = from.InstructionSize(cage_base); + event.new_code_start = + reinterpret_cast<void*>(to.InstructionStart(cage_base)); event.isolate = reinterpret_cast<v8::Isolate*>(isolate_); code_event_handler_(&event); @@ -842,7 +888,7 @@ void JitLogger::AddCodeLinePosInfoEvent( void* jit_handler_data, int pc_offset, int position, JitCodeEvent::PositionType position_type, JitCodeEvent::CodeType code_type) { - JitCodeEvent event = {}; + JitCodeEvent event; event.type = JitCodeEvent::CODE_ADD_LINE_POS_INFO; event.code_type = code_type; event.user_data = jit_handler_data; @@ -855,7 +901,7 @@ void JitLogger::AddCodeLinePosInfoEvent( } void* JitLogger::StartCodePosInfoEvent(JitCodeEvent::CodeType code_type) { - JitCodeEvent event = {}; + JitCodeEvent event; event.type = JitCodeEvent::CODE_START_LINE_INFO_RECORDING; event.code_type = code_type; event.isolate = reinterpret_cast<v8::Isolate*>(isolate_); @@ -867,7 +913,7 @@ void* JitLogger::StartCodePosInfoEvent(JitCodeEvent::CodeType code_type) { void JitLogger::EndCodePosInfoEvent(Address start_address, void* jit_handler_data, JitCodeEvent::CodeType code_type) { - JitCodeEvent event = {}; + JitCodeEvent event; event.type = JitCodeEvent::CODE_END_LINE_INFO_RECORDING; event.code_type = code_type; event.code_start = reinterpret_cast<void*>(start_address); @@ -1161,32 +1207,6 @@ void V8FileLogger::TimerEvent(v8::LogEventStatus se, const char* name) { msg.WriteToLogFile(); } -void V8FileLogger::BasicBlockCounterEvent(const char* name, int block_id, - uint32_t count) { - if (!FLAG_turbo_profiling_log_builtins) return; - MSG_BUILDER(); - msg << ProfileDataFromFileConstants::kBlockCounterMarker << kNext << name - << kNext << block_id << kNext << count; - msg.WriteToLogFile(); -} - -void V8FileLogger::BasicBlockBranchEvent(const char* name, int true_block_id, - int false_block_id) { - if (!FLAG_turbo_profiling_log_builtins) return; - MSG_BUILDER(); - msg << ProfileDataFromFileConstants::kBlockHintMarker << kNext << name - << kNext << true_block_id << kNext << false_block_id; - msg.WriteToLogFile(); -} - -void V8FileLogger::BuiltinHashEvent(const char* name, int hash) { - if (!FLAG_turbo_profiling_log_builtins) return; - MSG_BUILDER(); - msg << ProfileDataFromFileConstants::kBuiltinHashMarker << kNext << name - << kNext << hash; - msg.WriteToLogFile(); -} - bool V8FileLogger::is_logging() { // Disable logging while the CPU profiler is running. if (isolate_->is_profiling()) return false; @@ -1218,22 +1238,22 @@ void V8FileLogger::DeleteEvent(const char* name, void* object) { namespace { void AppendCodeCreateHeader(LogFile::MessageBuilder& msg, - LogEventListener::LogEventsAndTags tag, - CodeKind kind, uint8_t* address, int size, - uint64_t time) { - msg << kLogEventsNames[LogEventListener::CODE_CREATION_EVENT] - << V8FileLogger::kNext << kLogEventsNames[tag] << V8FileLogger::kNext - << static_cast<int>(kind) << V8FileLogger::kNext << time - << V8FileLogger::kNext << reinterpret_cast<void*>(address) + LogEventListener::CodeTag tag, CodeKind kind, + uint8_t* address, int size, uint64_t time) { + msg << LogEventListener::Event::kCodeCreation << V8FileLogger::kNext << tag + << V8FileLogger::kNext << static_cast<int>(kind) << V8FileLogger::kNext + << time << V8FileLogger::kNext << reinterpret_cast<void*>(address) << V8FileLogger::kNext << size << V8FileLogger::kNext; } -void AppendCodeCreateHeader(LogFile::MessageBuilder& msg, - LogEventListener::LogEventsAndTags tag, - AbstractCode code, uint64_t time) { - AppendCodeCreateHeader(msg, tag, code.kind(), - reinterpret_cast<uint8_t*>(code.InstructionStart()), - code.InstructionSize(), time); +void AppendCodeCreateHeader(Isolate* isolate, LogFile::MessageBuilder& msg, + LogEventListener::CodeTag tag, AbstractCode code, + uint64_t time) { + PtrComprCageBase cage_base(isolate); + AppendCodeCreateHeader( + msg, tag, code.kind(cage_base), + reinterpret_cast<uint8_t*>(code.InstructionStart(cage_base)), + code.InstructionSize(cage_base), time); } } // namespace @@ -1261,22 +1281,24 @@ void AppendCodeCreateHeader(LogFile::MessageBuilder& msg, void V8FileLogger::LogSourceCodeInformation(Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared) { - Object script_object = shared->script(); - if (!script_object.IsScript()) return; + PtrComprCageBase cage_base(isolate_); + Object script_object = shared->script(cage_base); + if (!script_object.IsScript(cage_base)) return; Script script = Script::cast(script_object); EnsureLogScriptSource(script); MSG_BUILDER(); msg << "code-source-info" << V8FileLogger::kNext - << reinterpret_cast<void*>(code->InstructionStart()) + << reinterpret_cast<void*>(code->InstructionStart(cage_base)) << V8FileLogger::kNext << script.id() << V8FileLogger::kNext << shared->StartPosition() << V8FileLogger::kNext << shared->EndPosition() << V8FileLogger::kNext; // TODO(v8:11429): Clean-up baseline-replated code in source position // iteration. bool hasInlined = false; - if (code->kind() != CodeKind::BASELINE) { - SourcePositionTableIterator iterator(code->SourcePositionTable(*shared)); + if (code->kind(cage_base) != CodeKind::BASELINE) { + SourcePositionTableIterator iterator( + code->SourcePositionTable(cage_base, *shared)); for (; !iterator.done(); iterator.Advance()) { SourcePosition pos = iterator.source_position(); msg << "C" << iterator.code_offset() << "O" << pos.ScriptOffset(); @@ -1326,17 +1348,23 @@ void V8FileLogger::LogSourceCodeInformation(Handle<AbstractCode> code, void V8FileLogger::LogCodeDisassemble(Handle<AbstractCode> code) { if (!FLAG_log_code_disassemble) return; + PtrComprCageBase cage_base(isolate_); MSG_BUILDER(); msg << "code-disassemble" << V8FileLogger::kNext - << reinterpret_cast<void*>(code->InstructionStart()) - << V8FileLogger::kNext << CodeKindToString(code->kind()) + << reinterpret_cast<void*>(code->InstructionStart(cage_base)) + << V8FileLogger::kNext << CodeKindToString(code->kind(cage_base)) << V8FileLogger::kNext; { std::ostringstream stream; - if (code->IsCode()) { + if (code->IsCode(cage_base)) { #ifdef ENABLE_DISASSEMBLER Code::cast(*code).Disassemble(nullptr, stream, isolate_); #endif + } else if (V8_REMOVE_BUILTINS_CODE_OBJECTS && + code->IsCodeDataContainer(cage_base)) { +#ifdef ENABLE_DISASSEMBLER + CodeT::cast(*code).Disassemble(nullptr, stream, isolate_); +#endif } else { BytecodeArray::cast(*code).Disassemble(stream); } @@ -1347,28 +1375,26 @@ void V8FileLogger::LogCodeDisassemble(Handle<AbstractCode> code) { } // Builtins and Bytecode handlers -void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void V8FileLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* name) { if (!is_listening_to_code_events()) return; if (!FLAG_log_code) return; { MSG_BUILDER(); - AppendCodeCreateHeader(msg, tag, *code, Time()); + AppendCodeCreateHeader(isolate_, msg, tag, *code, Time()); msg << name; msg.WriteToLogFile(); } LogCodeDisassemble(code); } -void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void V8FileLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) { if (!is_listening_to_code_events()) return; if (!FLAG_log_code) return; { MSG_BUILDER(); - AppendCodeCreateHeader(msg, tag, *code, Time()); + AppendCodeCreateHeader(isolate_, msg, tag, *code, Time()); msg << *name; msg.WriteToLogFile(); } @@ -1376,8 +1402,7 @@ void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, } // Scripts -void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void V8FileLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name) { if (!is_listening_to_code_events()) return; @@ -1388,7 +1413,7 @@ void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, } { MSG_BUILDER(); - AppendCodeCreateHeader(msg, tag, *code, Time()); + AppendCodeCreateHeader(isolate_, msg, tag, *code, Time()); msg << *script_name << kNext << reinterpret_cast<void*>(shared->address()) << kNext << ComputeMarker(*shared, *code); msg.WriteToLogFile(); @@ -1401,11 +1426,12 @@ void V8FileLogger::FeedbackVectorEvent(FeedbackVector vector, AbstractCode code) { DisallowGarbageCollection no_gc; if (!FLAG_log_code) return; + PtrComprCageBase cage_base(isolate_); MSG_BUILDER(); msg << "feedback-vector" << kNext << Time(); msg << kNext << reinterpret_cast<void*>(vector.address()) << kNext << vector.length(); - msg << kNext << reinterpret_cast<void*>(code.InstructionStart()); + msg << kNext << reinterpret_cast<void*>(code.InstructionStart(cage_base)); msg << kNext << vector.tiering_state(); msg << kNext << vector.maybe_has_optimized_code(); msg << kNext << vector.invocation_count(); @@ -1426,8 +1452,7 @@ void V8FileLogger::FeedbackVectorEvent(FeedbackVector vector, // Although, it is possible to extract source and line from // the SharedFunctionInfo object, we left it to caller // to leave logging functions free from heap allocations. -void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, - Handle<AbstractCode> code, +void V8FileLogger::CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name, int line, int column) { @@ -1435,7 +1460,7 @@ void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, if (!FLAG_log_code) return; { MSG_BUILDER(); - AppendCodeCreateHeader(msg, tag, *code, Time()); + AppendCodeCreateHeader(isolate_, msg, tag, *code, Time()); msg << shared->DebugNameCStr().get() << " " << *script_name << ":" << line << ":" << column << kNext << reinterpret_cast<void*>(shared->address()) << kNext << ComputeMarker(*shared, *code); @@ -1447,8 +1472,7 @@ void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, } #if V8_ENABLE_WEBASSEMBLY -void V8FileLogger::CodeCreateEvent(LogEventsAndTags tag, - const wasm::WasmCode* code, +void V8FileLogger::CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* /*source_url*/, int /*code_offset*/, int /*script_id*/) { @@ -1477,10 +1501,9 @@ void V8FileLogger::CallbackEventInternal(const char* prefix, Handle<Name> name, Address entry_point) { if (!FLAG_log_code) return; MSG_BUILDER(); - msg << kLogEventsNames[LogEventListener::CODE_CREATION_EVENT] << kNext - << kLogEventsNames[LogEventListener::CALLBACK_TAG] << kNext << -2 << kNext - << Time() << kNext << reinterpret_cast<void*>(entry_point) << kNext << 1 - << kNext << prefix << *name; + msg << Event::kCodeCreation << kNext << CodeTag::kCallback << kNext << -2 + << kNext << Time() << kNext << reinterpret_cast<void*>(entry_point) + << kNext << 1 << kNext << prefix << *name; msg.WriteToLogFile(); } @@ -1501,20 +1524,22 @@ void V8FileLogger::RegExpCodeCreateEvent(Handle<AbstractCode> code, if (!is_listening_to_code_events()) return; if (!FLAG_log_code) return; MSG_BUILDER(); - AppendCodeCreateHeader(msg, LogEventListener::REG_EXP_TAG, *code, Time()); + AppendCodeCreateHeader(isolate_, msg, LogEventListener::CodeTag::kRegExp, + *code, Time()); msg << *source; msg.WriteToLogFile(); } void V8FileLogger::CodeMoveEvent(AbstractCode from, AbstractCode to) { if (!is_listening_to_code_events()) return; - MoveEventInternal(LogEventListener::CODE_MOVE_EVENT, from.InstructionStart(), - to.InstructionStart()); + PtrComprCageBase cage_base(isolate_); + MoveEventInternal(Event::kCodeMove, from.InstructionStart(cage_base), + to.InstructionStart(cage_base)); } void V8FileLogger::SharedFunctionInfoMoveEvent(Address from, Address to) { if (!is_listening_to_code_events()) return; - MoveEventInternal(LogEventListener::SHARED_FUNC_MOVE_EVENT, from, to); + MoveEventInternal(Event::kSharedFuncMove, from, to); } void V8FileLogger::CodeMovingGCEvent() { @@ -1528,17 +1553,16 @@ void V8FileLogger::CodeDisableOptEvent(Handle<AbstractCode> code, if (!is_listening_to_code_events()) return; if (!FLAG_log_code) return; MSG_BUILDER(); - msg << kLogEventsNames[LogEventListener::CODE_DISABLE_OPT_EVENT] << kNext - << shared->DebugNameCStr().get() << kNext - << GetBailoutReason(shared->disabled_optimization_reason()); + msg << Event::kCodeDisableOpt << kNext << shared->DebugNameCStr().get() + << kNext << GetBailoutReason(shared->disabled_optimization_reason()); msg.WriteToLogFile(); } void V8FileLogger::ProcessDeoptEvent(Handle<Code> code, SourcePosition position, const char* kind, const char* reason) { MSG_BUILDER(); - msg << "code-deopt" << kNext << Time() << kNext << code->CodeSize() << kNext - << reinterpret_cast<void*>(code->InstructionStart()); + msg << Event::kCodeDeopt << kNext << Time() << kNext << code->CodeSize() + << kNext << reinterpret_cast<void*>(code->InstructionStart()); std::ostringstream deopt_location; int inlining_id = -1; @@ -1615,17 +1639,15 @@ void V8FileLogger::CodeNameEvent(Address addr, int pos, const char* code_name) { if (code_name == nullptr) return; // Not a code object. if (!is_listening_to_code_events()) return; MSG_BUILDER(); - msg << kLogEventsNames[LogEventListener::SNAPSHOT_CODE_NAME_EVENT] << kNext - << pos << kNext << code_name; + msg << Event::kSnapshotCodeName << kNext << pos << kNext << code_name; msg.WriteToLogFile(); } -void V8FileLogger::MoveEventInternal(LogEventsAndTags event, Address from, - Address to) { +void V8FileLogger::MoveEventInternal(Event event, Address from, Address to) { if (!FLAG_log_code) return; MSG_BUILDER(); - msg << kLogEventsNames[event] << kNext << reinterpret_cast<void*>(from) - << kNext << reinterpret_cast<void*>(to); + msg << event << kNext << reinterpret_cast<void*>(from) << kNext + << reinterpret_cast<void*>(to); msg.WriteToLogFile(); } @@ -1780,8 +1802,8 @@ void V8FileLogger::TickEvent(TickSample* sample, bool overflow) { RuntimeCallTimerEvent(); } MSG_BUILDER(); - msg << kLogEventsNames[LogEventListener::TICK_EVENT] << kNext - << reinterpret_cast<void*>(sample->pc) << kNext << Time(); + msg << Event::kTick << kNext << reinterpret_cast<void*>(sample->pc) << kNext + << Time(); if (sample->has_external_callback) { msg << kNext << 1 << kNext << reinterpret_cast<void*>(sample->external_callback_entry); @@ -1955,17 +1977,17 @@ void V8FileLogger::LogAccessorCallbacks() { if (!obj.IsAccessorInfo()) continue; AccessorInfo ai = AccessorInfo::cast(obj); if (!ai.name().IsName()) continue; - Address getter_entry = v8::ToCData<Address>(ai.getter()); + Address getter_entry = ai.getter(); HandleScope scope(isolate_); Handle<Name> name(Name::cast(ai.name()), isolate_); - if (getter_entry != 0) { + if (getter_entry != kNullAddress) { #if USES_FUNCTION_DESCRIPTORS getter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(getter_entry); #endif PROFILE(isolate_, GetterCallbackEvent(name, getter_entry)); } - Address setter_entry = v8::ToCData<Address>(ai.setter()); - if (setter_entry != 0) { + Address setter_entry = ai.setter(); + if (setter_entry != kNullAddress) { #if USES_FUNCTION_DESCRIPTORS setter_entry = *FUNCTION_ENTRYPOINT_ADDRESS(setter_entry); #endif @@ -2072,8 +2094,8 @@ bool V8FileLogger::SetUp(Isolate* isolate) { } #endif // ENABLE_GDB_JIT_INTERFACE -#if defined(V8_OS_WIN) && defined(V8_ENABLE_SYSTEM_INSTRUMENTATION) - if (i::FLAG_enable_system_instrumentation) { +#if defined(V8_OS_WIN) && defined(V8_ENABLE_ETW_STACK_WALKING) + if (i::FLAG_enable_etw_stack_walking) { etw_jit_logger_ = std::make_unique<JitLogger>(isolate, i::ETWJITInterface::EventHandler); AddLogEventListener(etw_jit_logger_.get()); @@ -2112,6 +2134,7 @@ void V8FileLogger::SetCodeEventHandler(uint32_t options, if (jit_logger_) { RemoveLogEventListener(jit_logger_.get()); jit_logger_.reset(); + isolate_->UpdateLogObjectRelocation(); } if (event_handler) { @@ -2119,11 +2142,12 @@ void V8FileLogger::SetCodeEventHandler(uint32_t options, wasm::GetWasmEngine()->EnableCodeLogging(isolate_); #endif // V8_ENABLE_WEBASSEMBLY jit_logger_ = std::make_unique<JitLogger>(isolate_, event_handler); + isolate_->UpdateLogObjectRelocation(); AddLogEventListener(jit_logger_.get()); if (options & kJitCodeEventEnumExisting) { HandleScope scope(isolate_); - LogCodeObjects(); LogBuiltins(); + LogCodeObjects(); LogCompiledFunctions(); } } @@ -2170,6 +2194,7 @@ FILE* V8FileLogger::TearDownAndGetLogFile() { if (jit_logger_) { RemoveLogEventListener(jit_logger_.get()); jit_logger_.reset(); + isolate_->UpdateLogObjectRelocation(); } return log_->Close(); @@ -2183,14 +2208,16 @@ void V8FileLogger::UpdateIsLogging(bool value) { // Relaxed atomic to avoid locking the mutex for the most common case: when // logging is disabled. is_logging_.store(value, std::memory_order_relaxed); + isolate_->UpdateLogObjectRelocation(); } -void ExistingCodeLogger::LogCodeObject(Object object) { +void ExistingCodeLogger::LogCodeObject(AbstractCode object) { HandleScope scope(isolate_); - Handle<AbstractCode> abstract_code(AbstractCode::cast(object), isolate_); - LogEventListener::LogEventsAndTags tag = LogEventListener::STUB_TAG; + Handle<AbstractCode> abstract_code(object, isolate_); + CodeTag tag = CodeTag::kStub; const char* description = "Unknown code from before profiling"; - switch (abstract_code->kind()) { + PtrComprCageBase cage_base(isolate_); + switch (abstract_code->kind(cage_base)) { case CodeKind::INTERPRETED_FUNCTION: case CodeKind::TURBOFAN: case CodeKind::BASELINE: @@ -2198,50 +2225,51 @@ void ExistingCodeLogger::LogCodeObject(Object object) { return; // We log this later using LogCompiledFunctions. case CodeKind::FOR_TESTING: description = "STUB code"; - tag = LogEventListener::STUB_TAG; + tag = CodeTag::kStub; break; case CodeKind::REGEXP: description = "Regular expression code"; - tag = LogEventListener::REG_EXP_TAG; + tag = CodeTag::kRegExp; break; case CodeKind::BYTECODE_HANDLER: description = - isolate_->builtins()->name(abstract_code->GetCode().builtin_id()); - tag = LogEventListener::BYTECODE_HANDLER_TAG; + isolate_->builtins()->name(abstract_code->builtin_id(cage_base)); + tag = CodeTag::kBytecodeHandler; break; case CodeKind::BUILTIN: - if (Code::cast(object).is_interpreter_trampoline_builtin() && - ToCodeT(Code::cast(object)) != - *BUILTIN_CODE(isolate_, InterpreterEntryTrampoline)) { + if (!abstract_code->is_off_heap_trampoline(cage_base)) { + DCHECK_EQ(abstract_code->builtin_id(cage_base), + Builtin::kInterpreterEntryTrampoline); + // We treat interpreter trampoline builtin copies as + // INTERPRETED_FUNCTION, which are logged using LogCompiledFunctions. return; } - description = - isolate_->builtins()->name(abstract_code->GetCode().builtin_id()); - tag = LogEventListener::BUILTIN_TAG; + description = Builtins::name(abstract_code->builtin_id(cage_base)); + tag = CodeTag::kBuiltin; break; case CodeKind::WASM_FUNCTION: description = "A Wasm function"; - tag = LogEventListener::FUNCTION_TAG; + tag = CodeTag::kFunction; break; case CodeKind::JS_TO_WASM_FUNCTION: description = "A JavaScript to Wasm adapter"; - tag = LogEventListener::STUB_TAG; + tag = CodeTag::kStub; break; case CodeKind::JS_TO_JS_FUNCTION: description = "A WebAssembly.Function adapter"; - tag = LogEventListener::STUB_TAG; + tag = CodeTag::kStub; break; case CodeKind::WASM_TO_CAPI_FUNCTION: description = "A Wasm to C-API adapter"; - tag = LogEventListener::STUB_TAG; + tag = CodeTag::kStub; break; case CodeKind::WASM_TO_JS_FUNCTION: description = "A Wasm to JavaScript adapter"; - tag = LogEventListener::STUB_TAG; + tag = CodeTag::kStub; break; case CodeKind::C_WASM_ENTRY: description = "A C to Wasm entry stub"; - tag = LogEventListener::STUB_TAG; + tag = CodeTag::kStub; break; } CALL_CODE_EVENT_HANDLER(CodeCreateEvent(tag, abstract_code, description)) @@ -2251,21 +2279,35 @@ void ExistingCodeLogger::LogCodeObjects() { Heap* heap = isolate_->heap(); HeapObjectIterator iterator(heap); DisallowGarbageCollection no_gc; + PtrComprCageBase cage_base(isolate_); for (HeapObject obj = iterator.Next(); !obj.is_null(); obj = iterator.Next()) { - if (obj.IsCode()) LogCodeObject(obj); - if (obj.IsBytecodeArray()) LogCodeObject(obj); + InstanceType instance_type = obj.map(cage_base).instance_type(); + if (V8_REMOVE_BUILTINS_CODE_OBJECTS) { + // In this case AbstactCode is Code|CodeDataContainer|BytecodeArray but + // we want to log code objects only once, thus we ignore Code objects + // which will be logged via corresponding CodeDataContainer. + if (InstanceTypeChecker::IsCodeT(instance_type) || + InstanceTypeChecker::IsBytecodeArray(instance_type)) { + LogCodeObject(AbstractCode::cast(obj)); + } + } else { + // In this case AbstactCode is Code|BytecodeArray. + if (InstanceTypeChecker::IsCode(instance_type) || + InstanceTypeChecker::IsBytecodeArray(instance_type)) { + LogCodeObject(AbstractCode::cast(obj)); + } + } } } void ExistingCodeLogger::LogBuiltins() { - Builtins* builtins = isolate_->builtins(); - DCHECK(builtins->is_initialized()); - for (Builtin builtin = Builtins::kFirst; builtin <= Builtins::kLast; - ++builtin) { - Code code = FromCodeT(builtins->code(builtin)); - LogCodeObject(code); - } + DCHECK(isolate_->builtins()->is_initialized()); + // The main "copy" of used builtins are logged by LogCodeObjects() while + // iterating CodeT objects. + // TODO(v8:11880): Log other copies of remapped builtins once we + // decide to remap them multiple times into the code range (for example + // for arm64). } void ExistingCodeLogger::LogCompiledFunctions() { @@ -2311,9 +2353,9 @@ void ExistingCodeLogger::LogCompiledFunctions() { #endif // V8_ENABLE_WEBASSEMBLY } -void ExistingCodeLogger::LogExistingFunction( - Handle<SharedFunctionInfo> shared, Handle<AbstractCode> code, - LogEventListener::LogEventsAndTags tag) { +void ExistingCodeLogger::LogExistingFunction(Handle<SharedFunctionInfo> shared, + Handle<AbstractCode> code, + CodeTag tag) { if (shared->script().IsScript()) { Handle<Script> script(Script::cast(shared->script()), isolate_); int line_num = Script::GetLineNumber(script, shared->StartPosition()) + 1; @@ -2327,10 +2369,9 @@ void ExistingCodeLogger::LogExistingFunction( shared, script_name, line_num, column_num)) } else { // Can't distinguish eval and script here, so always use Script. - CALL_CODE_EVENT_HANDLER( - CodeCreateEvent(V8FileLogger::ToNativeByScript( - LogEventListener::SCRIPT_TAG, *script), - code, shared, script_name)) + CALL_CODE_EVENT_HANDLER(CodeCreateEvent( + V8FileLogger::ToNativeByScript(CodeTag::kScript, *script), code, + shared, script_name)) } } else { CALL_CODE_EVENT_HANDLER(CodeCreateEvent( @@ -2344,8 +2385,7 @@ void ExistingCodeLogger::LogExistingFunction( Object raw_call_data = fun_data->call_code(kAcquireLoad); if (!raw_call_data.IsUndefined(isolate_)) { CallHandlerInfo call_data = CallHandlerInfo::cast(raw_call_data); - Object callback_obj = call_data.callback(); - Address entry_point = v8::ToCData<Address>(callback_obj); + Address entry_point = call_data.callback(); #if USES_FUNCTION_DESCRIPTORS entry_point = *FUNCTION_ENTRYPOINT_ADDRESS(entry_point); #endif diff --git a/chromium/v8/src/logging/log.h b/chromium/v8/src/logging/log.h index 54464c5eb99..18560d78e23 100644 --- a/chromium/v8/src/logging/log.h +++ b/chromium/v8/src/logging/log.h @@ -83,6 +83,7 @@ class Ticker; class ExistingCodeLogger { public: + using CodeTag = LogEventListener::CodeTag; explicit ExistingCodeLogger(Isolate* isolate, LogEventListener* listener = nullptr) : isolate_(isolate), listener_(listener) {} @@ -93,8 +94,8 @@ class ExistingCodeLogger { void LogCompiledFunctions(); void LogExistingFunction( Handle<SharedFunctionInfo> shared, Handle<AbstractCode> code, - LogEventListener::LogEventsAndTags tag = LogEventListener::FUNCTION_TAG); - void LogCodeObject(Object object); + LogEventListener::CodeTag tag = LogEventListener::CodeTag::kFunction); + void LogCodeObject(AbstractCode object); private: Isolate* isolate_; @@ -167,18 +168,18 @@ class V8FileLogger : public LogEventListener { V8_EXPORT_PRIVATE void RemoveLogEventListener(LogEventListener* listener); // LogEventListener implementation. - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name, int line, int column) override; #if V8_ENABLE_WEBASSEMBLY - void CodeCreateEvent(LogEventsAndTags tag, const wasm::WasmCode* code, + void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, int code_offset, int script_id) override; #endif // V8_ENABLE_WEBASSEMBLY @@ -234,13 +235,6 @@ class V8FileLogger : public LogEventListener { V8_EXPORT_PRIVATE void TimerEvent(v8::LogEventStatus se, const char* name); - void BasicBlockCounterEvent(const char* name, int block_id, uint32_t count); - - void BasicBlockBranchEvent(const char* name, int true_block_id, - int false_block_id); - - void BuiltinHashEvent(const char* name, int hash); - static void EnterExternal(Isolate* isolate); static void LeaveExternal(Isolate* isolate); @@ -283,8 +277,7 @@ class V8FileLogger : public LogEventListener { void LogAllMaps(); // Converts tag to a corresponding NATIVE_... if the script is native. - V8_INLINE static LogEventListener::LogEventsAndTags ToNativeByScript( - LogEventListener::LogEventsAndTags, Script); + V8_INLINE static CodeTag ToNativeByScript(CodeTag tag, Script script); private: void UpdateIsLogging(bool value); @@ -297,11 +290,10 @@ class V8FileLogger : public LogEventListener { Address entry_point); // Internal configurable move event. - void MoveEventInternal(LogEventListener::LogEventsAndTags event, Address from, - Address to); + void MoveEventInternal(Event event, Address from, Address to); // Helper method. It resets name_buffer_ and add tag name into it. - void InitNameBuffer(LogEventListener::LogEventsAndTags tag); + void InitNameBuffer(Event tag); // Emits a profiler tick event. Used by the profiler thread. void TickEvent(TickSample* sample, bool overflow); @@ -352,7 +344,7 @@ class V8FileLogger : public LogEventListener { #ifdef ENABLE_GDB_JIT_INTERFACE std::unique_ptr<JitLogger> gdb_jit_logger_; #endif -#if defined(V8_OS_WIN) && defined(V8_ENABLE_SYSTEM_INSTRUMENTATION) +#if defined(V8_OS_WIN) && defined(V8_ENABLE_ETW_STACK_WALKING) std::unique_ptr<JitLogger> etw_jit_logger_; #endif std::set<int> logged_source_code_; @@ -409,18 +401,18 @@ class V8_EXPORT_PRIVATE CodeEventLogger : public LogEventListener { explicit CodeEventLogger(Isolate* isolate); ~CodeEventLogger() override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> script_name, int line, int column) override; #if V8_ENABLE_WEBASSEMBLY - void CodeCreateEvent(LogEventsAndTags tag, const wasm::WasmCode* code, + void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, int code_offset, int script_id) override; #endif // V8_ENABLE_WEBASSEMBLY @@ -477,18 +469,18 @@ class ExternalLogEventListener : public LogEventListener { explicit ExternalLogEventListener(Isolate* isolate); ~ExternalLogEventListener() override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, const char* comment) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<Name> name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> name) override; - void CodeCreateEvent(LogEventsAndTags tag, Handle<AbstractCode> code, + void CodeCreateEvent(CodeTag tag, Handle<AbstractCode> code, Handle<SharedFunctionInfo> shared, Handle<Name> source, int line, int column) override; #if V8_ENABLE_WEBASSEMBLY - void CodeCreateEvent(LogEventsAndTags tag, const wasm::WasmCode* code, + void CodeCreateEvent(CodeTag tag, const wasm::WasmCode* code, wasm::WasmName name, const char* source_url, int code_offset, int script_id) override; #endif // V8_ENABLE_WEBASSEMBLY diff --git a/chromium/v8/src/logging/runtime-call-stats.cc b/chromium/v8/src/logging/runtime-call-stats.cc index 5322b7412ff..82f3979befa 100644 --- a/chromium/v8/src/logging/runtime-call-stats.cc +++ b/chromium/v8/src/logging/runtime-call-stats.cc @@ -8,6 +8,7 @@ #include <iomanip> +#include "src/flags/flags.h" #include "src/tracing/tracing-category-observer.h" #include "src/utils/ostreams.h" diff --git a/chromium/v8/src/logging/runtime-call-stats.h b/chromium/v8/src/logging/runtime-call-stats.h index 1b1371cd1c8..e6998d4bfb1 100644 --- a/chromium/v8/src/logging/runtime-call-stats.h +++ b/chromium/v8/src/logging/runtime-call-stats.h @@ -10,11 +10,9 @@ #ifdef V8_RUNTIME_CALL_STATS #include "src/base/atomic-utils.h" -#include "src/base/optional.h" -#include "src/base/platform/elapsed-timer.h" +#include "src/base/platform/platform.h" #include "src/base/platform/time.h" #include "src/builtins/builtins-definitions.h" -#include "src/debug/debug-interface.h" #include "src/execution/thread-id.h" #include "src/init/heap-symbols.h" #include "src/logging/tracing-flags.h" @@ -489,15 +487,19 @@ class RuntimeCallTimer final { V(UpdateProtector) \ V(WebSnapshotDeserialize) \ V(WebSnapshotDeserialize_Arrays) \ + V(WebSnapshotDeserialize_ArrayBuffers) \ + V(WebSnapshotDeserialize_BigInts) \ V(WebSnapshotDeserialize_BuiltinObjects) \ V(WebSnapshotDeserialize_Classes) \ V(WebSnapshotDeserialize_Contexts) \ + V(WebSnapshotDeserialize_DataViews) \ V(WebSnapshotDeserialize_Exports) \ V(WebSnapshotDeserialize_Functions) \ V(WebSnapshotDeserialize_Maps) \ V(WebSnapshotDeserialize_Objects) \ V(WebSnapshotDeserialize_Strings) \ V(WebSnapshotDeserialize_Symbols) \ + V(WebSnapshotDeserialize_TypedArrays) \ V(WrappedFunctionLengthGetter) \ V(WrappedFunctionNameGetter) |