[webkit-changes] [WebKit/WebKit] 15aaec: [JSC] Destroy LinkBuffer in compiler thread
Yusuke Suzuki
noreply at github.com
Tue Mar 5 09:21:50 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 15aaecdc0805096996f25abacbb59c509a1a6986
https://github.com/WebKit/WebKit/commit/15aaecdc0805096996f25abacbb59c509a1a6986
Author: Yusuke Suzuki <ysuzuki at apple.com>
Date: 2024-03-05 (Tue, 05 Mar 2024)
Changed paths:
M Source/JavaScriptCore/assembler/LinkBuffer.cpp
M Source/JavaScriptCore/assembler/LinkBuffer.h
M Source/JavaScriptCore/dfg/DFGJITFinalizer.cpp
M Source/JavaScriptCore/dfg/DFGJITFinalizer.h
M Source/JavaScriptCore/dfg/DFGLazyJSValue.cpp
M Source/JavaScriptCore/dfg/DFGLazyJSValue.h
M Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
M Source/JavaScriptCore/ftl/FTLCompile.cpp
M Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp
M Source/JavaScriptCore/ftl/FTLJITFinalizer.h
M Source/JavaScriptCore/ftl/FTLLink.cpp
M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
M Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp
M Source/JavaScriptCore/ftl/FTLState.cpp
M Source/JavaScriptCore/ftl/FTLState.h
M Source/JavaScriptCore/jit/BaselineJITPlan.cpp
M Source/JavaScriptCore/jit/BaselineJITPlan.h
M Source/JavaScriptCore/jit/JIT.cpp
M Source/JavaScriptCore/jit/JIT.h
M Source/JavaScriptCore/jit/JITCode.cpp
M Source/JavaScriptCore/jit/JITPlan.cpp
M Source/JavaScriptCore/jit/JITPlan.h
M Source/JavaScriptCore/jit/JITSizeStatistics.cpp
M Source/JavaScriptCore/jit/JITSizeStatistics.h
M Source/JavaScriptCore/runtime/ScriptExecutable.cpp
Log Message:
-----------
[JSC] Destroy LinkBuffer in compiler thread
https://bugs.webkit.org/show_bug.cgi?id=270503
rdar://124050058
Reviewed by Keith Miller.
We are keeping LinkBuffer only because m_mainThreadFinalizationTasks exists. That's not great since LinkBuffer
destruction is relatively costly operation. So we should do it in the compiler thread instead of the main thread.
This patch moves m_mainThreadFinalizationTasks to JITPlan and run it appropriately in JITPlan so that we can destroy
LinkBuffer in the compiler thread.
* Source/JavaScriptCore/assembler/LinkBuffer.cpp:
(JSC::LinkBuffer::runMainThreadFinalizationTasks): Deleted.
* Source/JavaScriptCore/assembler/LinkBuffer.h:
(JSC::LinkBuffer::addMainThreadFinalizationTask): Deleted.
* Source/JavaScriptCore/dfg/DFGJITFinalizer.cpp:
(JSC::DFG::JITFinalizer::JITFinalizer):
(JSC::DFG::JITFinalizer::codeSize):
(JSC::DFG::JITFinalizer::finalize):
* Source/JavaScriptCore/dfg/DFGJITFinalizer.h:
* Source/JavaScriptCore/dfg/DFGLazyJSValue.cpp:
(JSC::DFG::LazyJSValue::emit const):
* Source/JavaScriptCore/dfg/DFGLazyJSValue.h:
* Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compile):
(JSC::DFG::SpeculativeJIT::compileFunction):
(JSC::DFG::SpeculativeJIT::runSlowPathGenerators):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
* Source/JavaScriptCore/ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp:
(JSC::FTL::JITFinalizer::codeSize):
(JSC::FTL::JITFinalizer::finalize):
* Source/JavaScriptCore/ftl/FTLJITFinalizer.h:
(JSC::FTL::OutOfLineCodeInfo::OutOfLineCodeInfo): Deleted.
* Source/JavaScriptCore/ftl/FTLLink.cpp:
(JSC::FTL::link):
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileLazyJSConstant):
* Source/JavaScriptCore/ftl/FTLPatchpointExceptionHandle.cpp:
(JSC::FTL::PatchpointExceptionHandle::scheduleExitCreationForUnwind):
* Source/JavaScriptCore/ftl/FTLState.cpp:
(JSC::FTL::State::dumpDisassembly):
* Source/JavaScriptCore/ftl/FTLState.h:
(JSC::FTL::State::dumpDisassembly):
* Source/JavaScriptCore/jit/BaselineJITPlan.cpp:
(JSC::BaselineJITPlan::compileInThreadImpl):
(JSC::BaselineJITPlan::compileSync):
(JSC::BaselineJITPlan::codeSize const):
(JSC::BaselineJITPlan::finalize):
* Source/JavaScriptCore/jit/BaselineJITPlan.h:
* Source/JavaScriptCore/jit/JIT.cpp:
(JSC::JIT::JIT):
(JSC::JIT::privateCompileMainPass):
(JSC::JIT::privateCompileSlowCases):
(JSC::JIT::compileAndLinkWithoutFinalizing):
(JSC::JIT::finalizeOnMainThread):
(JSC::JIT::compileSync):
(JSC::JIT::privateCompile): Deleted.
* Source/JavaScriptCore/jit/JIT.h:
* Source/JavaScriptCore/jit/JITCode.cpp:
(JSC::JITCodeWithCodeRef::size):
* Source/JavaScriptCore/jit/JITPlan.cpp:
(JSC::JITPlan::runMainThreadFinalizationTasks):
* Source/JavaScriptCore/jit/JITPlan.h:
(JSC::JITPlan::addMainThreadFinalizationTask):
* Source/JavaScriptCore/jit/JITSizeStatistics.cpp:
(JSC::JITSizeStatistics::markEnd):
* Source/JavaScriptCore/jit/JITSizeStatistics.h:
* Source/JavaScriptCore/runtime/ScriptExecutable.cpp:
(JSC::setupJIT):
Canonical link: https://commits.webkit.org/275696@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list