Skip to content

Commit

Permalink
[JSC] Generate PerfLog only when new JIT code is generated
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=271515
rdar://125280914

Reviewed by Justin Michaud.

Do not count code rewriting as new JIT code generation in PerfLog's JITDump.

* Source/JavaScriptCore/assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::logJITCodeForPerf):
* Source/JavaScriptCore/assembler/LinkBuffer.h:
(JSC::LinkBuffer::LinkBuffer):

Canonical link: https://commits.webkit.org/276592@main
  • Loading branch information
Constellation committed Mar 23, 2024
1 parent 5e2b534 commit 9fa1775
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/JavaScriptCore/assembler/LinkBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ void LinkBuffer::logJITCodeForPerf(CodeRef<LinkBufferPtrTag>& codeRef, ASCIILite
dumpSimpleName(out, simpleName);
break;
}
PerfLog::log(out.toCString(), codeRef.code().untaggedPtr<const uint8_t*>(), codeRef.size());
if (!m_isRewriting)
PerfLog::log(out.toCString(), codeRef.code().untaggedPtr<const uint8_t*>(), codeRef.size());
#else
UNUSED_PARAM(codeRef);
UNUSED_PARAM(simpleName);
Expand Down
2 changes: 2 additions & 0 deletions Source/JavaScriptCore/assembler/LinkBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class LinkBuffer {
template<PtrTag tag>
LinkBuffer(MacroAssembler& macroAssembler, CodePtr<tag> code, size_t size, Profile profile = Profile::Uncategorized, JITCompilationEffort effort = JITCompilationMustSucceed, bool shouldPerformBranchCompaction = true)
: m_size(size)
, m_isRewriting(true)
, m_profile(profile)
, m_code(code.template retagged<LinkBufferPtrTag>())
{
Expand Down Expand Up @@ -404,6 +405,7 @@ ALLOW_NONLITERAL_FORMAT_END
#endif
bool m_alreadyDisassembled { false };
bool m_isThunk { false };
bool m_isRewriting { false };
Profile m_profile { Profile::Uncategorized };
CodePtr<LinkBufferPtrTag> m_code;
Vector<RefPtr<SharedTask<void(LinkBuffer&)>>> m_linkTasks;
Expand Down

0 comments on commit 9fa1775

Please sign in to comment.