diff options
Diffstat (limited to 'deps/v8/src/log.h')
-rw-r--r-- | deps/v8/src/log.h | 54 |
1 files changed, 37 insertions, 17 deletions
diff --git a/deps/v8/src/log.h b/deps/v8/src/log.h index 35f6688559..485de0f4d1 100644 --- a/deps/v8/src/log.h +++ b/deps/v8/src/log.h @@ -74,7 +74,6 @@ class PerfJitLogger; class Profiler; class RuntimeCallTimer; class Ticker; -class WasmCompiledModule; namespace interpreter { enum class Bytecode : uint8_t; @@ -125,6 +124,14 @@ class Logger : public CodeEventListener { public: enum StartEnd { START = 0, END = 1, STAMP = 2 }; + enum class ScriptEventType { + kReserveId, + kCreate, + kDeserialize, + kBackgroundCompile, + kStreamingCompile + }; + // The separator is used to write an unescaped "," into the log. static const LogSeparator kNext = LogSeparator::kSeparator; @@ -165,14 +172,20 @@ class Logger : public CodeEventListener { // object. void SuspectReadEvent(Name* name, Object* obj); - void FunctionEvent(const char* reason, Script* script, int script_id, - double time_delta_ms, int start_position = -1, - int end_position = -1, String* function_name = nullptr); - void FunctionEvent(const char* reason, Script* script, int script_id, - double time_delta_ms, int start_position, int end_position, + // ==== Events logged by --log-function-events ==== + void FunctionEvent(const char* reason, int script_id, double time_delta_ms, + int start_position = -1, int end_position = -1, + String* function_name = nullptr); + void FunctionEvent(const char* reason, int script_id, double time_delta_ms, + int start_position, int end_position, const char* function_name = nullptr, size_t function_name_length = 0); + void CompilationCacheEvent(const char* action, const char* cache_type, + SharedFunctionInfo* sfi); + void ScriptEvent(ScriptEventType type, int script_id); + void ScriptDetails(Script* script); + // ==== Events logged by --log-api. ==== void ApiSecurityCheck(); void ApiNamedPropertyAccess(const char* tag, JSObject* holder, Object* name); @@ -209,7 +222,7 @@ class Logger : public CodeEventListener { // Emits a code create event for a RegExp. void RegExpCodeCreateEvent(AbstractCode* code, String* source); // Emits a code move event. - void CodeMoveEvent(AbstractCode* from, AbstractCode* to); + void CodeMoveEvent(AbstractCode* from, Address to); // Emits a code line info record event. void CodeLinePosInfoRecordEvent(Address code_start, ByteArray* source_position_table); @@ -220,7 +233,7 @@ class Logger : public CodeEventListener { void CodeNameEvent(Address addr, int pos, const char* code_name); - void CodeDeoptEvent(Code* code, DeoptKind kind, Address pc, + void CodeDeoptEvent(Code* code, DeoptimizeKind kind, Address pc, int fp_to_sp_delta); void ICEvent(const char* type, bool keyed, Map* map, Object* key, @@ -246,8 +259,8 @@ class Logger : public CodeEventListener { static void DefaultEventLoggerSentinel(const char* name, int event) {} - INLINE(static void CallEventLogger(Isolate* isolate, const char* name, - StartEnd se, bool expose_to_api)); + V8_INLINE static void CallEventLogger(Isolate* isolate, const char* name, + StartEnd se, bool expose_to_api); bool is_logging() { return is_logging_; @@ -263,7 +276,6 @@ class Logger : public CodeEventListener { void LogExistingFunction(Handle<SharedFunctionInfo> shared, Handle<AbstractCode> code); - void LogCompiledModule(Handle<WasmCompiledModule> module); // Logs all compiled functions found in the heap. void LogCompiledFunctions(); // Logs all accessor callbacks found in the heap. @@ -278,8 +290,8 @@ class Logger : public CodeEventListener { void LogMaps(); // Converts tag to a corresponding NATIVE_... if the script is native. - INLINE(static CodeEventListener::LogEventsAndTags ToNativeByScript( - CodeEventListener::LogEventsAndTags, Script*)); + V8_INLINE static CodeEventListener::LogEventsAndTags ToNativeByScript( + CodeEventListener::LogEventsAndTags, Script*); // Callback from Log, stops profiling in case of insufficient resources. void LogFailure(); @@ -316,6 +328,10 @@ class Logger : public CodeEventListener { // Logs an IntPtrTEvent regardless of whether FLAG_log is true. void UncheckedIntPtrTEvent(const char* name, intptr_t value); + // Logs a scripts sources. Keeps track of all logged scripts to ensure that + // each script is logged only once. + bool EnsureLogScriptSource(Script* script); + Isolate* isolate_; // The sampler used by the profiler and the sliding state window. @@ -398,7 +414,7 @@ class TimerEventScope { class CodeEventLogger : public CodeEventListener { public: - CodeEventLogger(); + explicit CodeEventLogger(Isolate* isolate); ~CodeEventLogger() override; void CodeCreateEvent(LogEventsAndTags tag, AbstractCode* code, @@ -419,9 +435,12 @@ class CodeEventLogger : public CodeEventListener { void SetterCallbackEvent(Name* name, Address entry_point) override {} void SharedFunctionInfoMoveEvent(Address from, Address to) override {} void CodeMovingGCEvent() override {} - void CodeDeoptEvent(Code* code, DeoptKind kind, Address pc, + void CodeDeoptEvent(Code* code, DeoptimizeKind kind, Address pc, int fp_to_sp_delta) override {} + protected: + Isolate* isolate_; + private: class NameBuffer; @@ -434,6 +453,7 @@ class CodeEventLogger : public CodeEventListener { }; struct CodeEvent { + Isolate* isolate_; uintptr_t code_start_address; size_t code_size; Handle<String> function_name; @@ -466,11 +486,11 @@ class ExternalCodeEventListener : public CodeEventListener { void GetterCallbackEvent(Name* name, Address entry_point) override {} void SetterCallbackEvent(Name* name, Address entry_point) override {} void SharedFunctionInfoMoveEvent(Address from, Address to) override {} - void CodeMoveEvent(AbstractCode* from, AbstractCode* to) override {} + void CodeMoveEvent(AbstractCode* from, Address to) override {} void CodeDisableOptEvent(AbstractCode* code, SharedFunctionInfo* shared) override {} void CodeMovingGCEvent() override {} - void CodeDeoptEvent(Code* code, DeoptKind kind, Address pc, + void CodeDeoptEvent(Code* code, DeoptimizeKind kind, Address pc, int fp_to_sp_delta) override {} void StartListening(CodeEventHandler* code_event_handler); |