@@ -78,7 +78,7 @@ class LinkBuffer {
7878public:
7979
8080#define FOR_EACH_LINKBUFFER_PROFILE (v ) \
81- v (BaselineJIT ) \
81+ v (Baseline ) \
8282 v (DFG ) \
8383 v (FTL ) \
8484 v (DFGOSREntry) \
@@ -90,10 +90,6 @@ class LinkBuffer {
9090 v (LLIntThunk) \
9191 v (DFGThunk) \
9292 v (FTLThunk) \
93- v (BoundFunctionThunk) \
94- v (RemoteFunctionThunk) \
95- v (SpecializedThunk) \
96- v (VirtualThunk) \
9793 v (WasmThunk) \
9894 v (ExtraCTIThunk) \
9995 v (WasmOMG) \
@@ -115,24 +111,15 @@ class LinkBuffer {
115111 static constexpr unsigned numberOfProfilesExcludingTotal = numberOfProfiles - 1 ;
116112
117113 LinkBuffer (MacroAssembler& macroAssembler, void * ownerUID, Profile profile = Profile::Uncategorized, JITCompilationEffort effort = JITCompilationMustSucceed)
118- : m_size(0 )
119- , m_didAllocate(false )
120- #ifndef NDEBUG
121- , m_completed(false )
122- #endif
114+ : m_ownerUID(ownerUID)
123115 , m_profile(profile)
124116 {
125- UNUSED_PARAM (ownerUID);
126117 linkCode (macroAssembler, effort);
127118 }
128119
129120 template <PtrTag tag>
130121 LinkBuffer (MacroAssembler& macroAssembler, CodePtr<tag> code, size_t size, Profile profile = Profile::Uncategorized, JITCompilationEffort effort = JITCompilationMustSucceed, bool shouldPerformBranchCompaction = true )
131122 : m_size(size)
132- , m_didAllocate(false )
133- #ifndef NDEBUG
134- , m_completed(false )
135- #endif
136123 , m_profile(profile)
137124 , m_code(code.template retagged<LinkBufferPtrTag>())
138125 {
@@ -302,17 +289,17 @@ class LinkBuffer {
302289 // displaying disassembly.
303290
304291 template <PtrTag tag>
305- CodeRef<tag> finalizeCodeWithoutDisassembly ()
292+ CodeRef<tag> finalizeCodeWithoutDisassembly (ASCIILiteral simpleName )
306293 {
307- return finalizeCodeWithoutDisassemblyImpl ().template retagged <tag>();
294+ return finalizeCodeWithoutDisassemblyImpl (simpleName ).template retagged <tag>();
308295 }
309296
310297 template <PtrTag tag, typename ... Args>
311- CodeRef<tag> finalizeCodeWithDisassembly (bool dumpDisassembly, const char * format, Args... args)
298+ CodeRef<tag> finalizeCodeWithDisassembly (bool dumpDisassembly, ASCIILiteral simpleName, const char * format, Args... args)
312299 {
313300ALLOW_NONLITERAL_FORMAT_BEGIN
314301 IGNORE_WARNINGS_BEGIN (" format-security" )
315- return finalizeCodeWithDisassemblyImpl (dumpDisassembly, format, args...).template retagged <tag>();
302+ return finalizeCodeWithDisassemblyImpl (dumpDisassembly, simpleName, format, args...).template retagged <tag>();
316303 IGNORE_WARNINGS_END
317304ALLOW_NONLITERAL_FORMAT_END
318305 }
@@ -345,8 +332,8 @@ ALLOW_NONLITERAL_FORMAT_END
345332 void setIsThunk () { m_isThunk = true ; }
346333
347334private:
348- JS_EXPORT_PRIVATE CodeRef<LinkBufferPtrTag> finalizeCodeWithoutDisassemblyImpl ();
349- JS_EXPORT_PRIVATE CodeRef<LinkBufferPtrTag> finalizeCodeWithDisassemblyImpl (bool dumpDisassembly, const char * format, ...) WTF_ATTRIBUTE_PRINTF(3 , 4 );
335+ JS_EXPORT_PRIVATE CodeRef<LinkBufferPtrTag> finalizeCodeWithoutDisassemblyImpl (ASCIILiteral );
336+ JS_EXPORT_PRIVATE CodeRef<LinkBufferPtrTag> finalizeCodeWithDisassemblyImpl (bool dumpDisassembly, ASCIILiteral, const char * format, ...) WTF_ATTRIBUTE_PRINTF(4 , 5 );
350337
351338#if ENABLE(BRANCH_COMPACTION)
352339 int executableOffsetFor (int location)
@@ -404,18 +391,21 @@ ALLOW_NONLITERAL_FORMAT_END
404391 static void dumpCode (void * code, size_t );
405392#endif
406393
394+ void logJITCodeForPerf (CodeRef<LinkBufferPtrTag>&, ASCIILiteral);
395+
407396 RefPtr<ExecutableMemoryHandle> m_executableMemory;
408- size_t m_size;
397+ size_t m_size { 0 };
398+ void * m_ownerUID { nullptr };
409399#if ENABLE(BRANCH_COMPACTION)
410400 AssemblerData m_assemblerStorage;
411401#if CPU(ARM64E)
412402 AssemblerData m_assemblerHashesStorage;
413403#endif
414404 bool m_shouldPerformBranchCompaction { true };
415405#endif
416- bool m_didAllocate;
406+ bool m_didAllocate { false } ;
417407#ifndef NDEBUG
418- bool m_completed;
408+ bool m_completed { false } ;
419409#endif
420410#if ASSERT_ENABLED
421411 bool m_isJumpIsland { false };
@@ -432,13 +422,13 @@ ALLOW_NONLITERAL_FORMAT_END
432422 static size_t s_profileCummulativeLinkedCounts[numberOfProfiles];
433423};
434424
435- #define FINALIZE_CODE_IF (condition, linkBufferReference, resultPtrTag, ...) \
436- (UNLIKELY ((condition) || JSC ::Options::logJIT() || JSC ::Options::logJITCodeForPerf() ) \
437- ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>((condition), __VA_ARGS__) \
438- : (linkBufferReference).finalizeCodeWithoutDisassembly<resultPtrTag>())
425+ #define FINALIZE_CODE_IF (condition, linkBufferReference, resultPtrTag, simpleName, ...) \
426+ (UNLIKELY ((condition) || JSC ::Options::logJIT()) \
427+ ? (linkBufferReference).finalizeCodeWithDisassembly<resultPtrTag>((condition), simpleName, __VA_ARGS__) \
428+ : (linkBufferReference).finalizeCodeWithoutDisassembly<resultPtrTag>(simpleName ))
439429
440- #define FINALIZE_CODE_FOR (codeBlock, linkBufferReference, resultPtrTag, ...) \
441- FINALIZE_CODE_IF ((shouldDumpDisassemblyFor(codeBlock) || Options::asyncDisassembly()), linkBufferReference, resultPtrTag, __VA_ARGS__)
430+ #define FINALIZE_CODE_FOR (codeBlock, linkBufferReference, resultPtrTag, simpleName, ...) \
431+ FINALIZE_CODE_IF ((shouldDumpDisassemblyFor(codeBlock) || Options::asyncDisassembly()), linkBufferReference, resultPtrTag, simpleName, __VA_ARGS__)
442432
443433// Use this to finalize code, like so:
444434//
@@ -456,20 +446,20 @@ ALLOW_NONLITERAL_FORMAT_END
456446// Note that the format string and print arguments are only evaluated when dumpDisassembly
457447// is true, so you can hide expensive disassembly-only computations inside there.
458448
459- #define FINALIZE_CODE (linkBufferReference, resultPtrTag, ...) \
460- FINALIZE_CODE_IF ((JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly()), linkBufferReference, resultPtrTag, __VA_ARGS__)
449+ #define FINALIZE_CODE (linkBufferReference, resultPtrTag, simpleName, ...) \
450+ FINALIZE_CODE_IF ((JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly()), linkBufferReference, resultPtrTag, simpleName, __VA_ARGS__)
461451
462452#define FINALIZE_DFG_CODE (linkBufferReference, resultPtrTag, ...) \
463- FINALIZE_CODE_IF ((JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpDFGDisassembly()), linkBufferReference, resultPtrTag, __VA_ARGS__)
453+ FINALIZE_CODE_IF ((JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpDFGDisassembly()), linkBufferReference, resultPtrTag, nullptr, __VA_ARGS__)
464454
465- #define FINALIZE_REGEXP_CODE (linkBufferReference, resultPtrTag, dataLogFArgumentsForHeading ) \
466- FINALIZE_CODE_IF (JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpRegExpDisassembly(), linkBufferReference, resultPtrTag, dataLogFArgumentsForHeading)
455+ #define FINALIZE_REGEXP_CODE (linkBufferReference, resultPtrTag, simpleName, dataLogFArgumentsForHeading ) \
456+ FINALIZE_CODE_IF (JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpRegExpDisassembly(), linkBufferReference, resultPtrTag, simpleName, dataLogFArgumentsForHeading)
467457
468- #define FINALIZE_WASM_CODE (linkBufferReference, resultPtrTag, ...) \
469- FINALIZE_CODE_IF ((JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpWasmDisassembly()), linkBufferReference, resultPtrTag, __VA_ARGS__)
458+ #define FINALIZE_WASM_CODE (linkBufferReference, resultPtrTag, simpleName, ...) \
459+ FINALIZE_CODE_IF ((JSC ::Options::asyncDisassembly() || JSC::Options::dumpDisassembly() || Options::dumpWasmDisassembly()), linkBufferReference, resultPtrTag, simpleName, __VA_ARGS__)
470460
471- #define FINALIZE_WASM_CODE_FOR_MODE (mode, linkBufferReference, resultPtrTag, ...) \
472- FINALIZE_CODE_IF (shouldDumpDisassemblyFor(mode), linkBufferReference, resultPtrTag, __VA_ARGS__)
461+ #define FINALIZE_WASM_CODE_FOR_MODE (mode, linkBufferReference, resultPtrTag, simpleName, ...) \
462+ FINALIZE_CODE_IF (shouldDumpDisassemblyFor(mode), linkBufferReference, resultPtrTag, simpleName, __VA_ARGS__)
473463
474464
475465
0 commit comments