Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a261c62aff59aaffd41f5b40e9c99ad863038638
https://github.com/WebKit/WebKit/commit/a261c62aff59aaffd41f5b40e9c99ad863038638
Author: Sosuke Suzuki <[email protected]>
Date: 2026-09-01 (Tue, 01 Sep 2026)
Changed paths:
M Source/JavaScriptCore/ftl/FTLExitTimeObjectMaterialization.h
M Source/JavaScriptCore/ftl/FTLJITCode.cpp
M Source/JavaScriptCore/ftl/FTLJITCode.h
M Source/JavaScriptCore/ftl/FTLOSRExit.cpp
M Source/JavaScriptCore/ftl/FTLOSRExit.h
M Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
Log Message:
-----------
[JSC] Store FTL OSR exit `ValueRep`s as a byte stream and shrink
`FTL::OSRExit`
https://bugs.webkit.org/show_bug.cgi?id=322888
Reviewed by Yusuke Suzuki.
After 319934@main (FTL::OSRExitDescriptor) and 320007@main (DFG
VariableEventStream), the FTL still keeps an 80 byte FTL::OSRExit plus a
heap-allocated FixedVector<B3::ValueRep>, 16 bytes per exit argument, for
every exit site, although only 0.5% of the exits are ever taken. On JetStream3
that is 34 MB over the run, 210 bytes per exit.
This patch stores the ValueReps of all exits of a JITCode as one byte stream
(OSRExitValueReps; the format is in the comment above the class), keeps the
code refs of taken exits in a side vector instead of in every OSRExit, and
lowers the minimum capacity of the materialization property vectors from 16
to 4. FTL::OSRExit goes from 80 to 56 bytes, and the same JetStream3 run goes
from 34.4 MB to 13.9 MB (84 bytes per exit).
* Source/JavaScriptCore/ftl/FTLExitTimeObjectMaterialization.h:
* Source/JavaScriptCore/ftl/FTLJITCode.cpp:
(JSC::FTL::JITCode::shrinkToFit):
(JSC::FTL::JITCode::validateReferences):
(JSC::FTL::JITCode::liveRegistersToPreserveAtExceptionHandlingCallSite):
(JSC::FTL::JITCode::findPC):
* Source/JavaScriptCore/ftl/FTLJITCode.h:
* Source/JavaScriptCore/ftl/FTLOSRExit.cpp:
(JSC::FTL::DFG::encodeValueRep):
(JSC::FTL::DFG::decodeValueRep):
(JSC::FTL::OSRExitValueReps::append):
(JSC::FTL::OSRExitValueReps::decode const):
(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):
(JSC::FTL::OSRExit::OSRExit):
(JSC::FTL::OSRExit::valueReps const):
* Source/JavaScriptCore/ftl/FTLOSRExit.h:
(JSC::FTL::OSRExitValueReps::shrinkToFit):
* Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
(JSC::FTL::JSC_DEFINE_NOEXCEPT_JIT_OPERATION):
Canonical link: https://commits.webkit.org/320245@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications