Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 580b6dade24924fbe758fc530211de0faf00fb43
https://github.com/WebKit/WebKit/commit/580b6dade24924fbe758fc530211de0faf00fb43
Author: Sosuke Suzuki <[email protected]>
Date: 2026-08-26 (Wed, 26 Aug 2026)
Changed paths:
M Source/JavaScriptCore/ftl/FTLCompile.cpp
M Source/JavaScriptCore/ftl/FTLExitValue.h
M Source/JavaScriptCore/ftl/FTLJITCode.cpp
M Source/JavaScriptCore/ftl/FTLJITCode.h
M Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
M Source/JavaScriptCore/ftl/FTLOSRExit.cpp
M Source/JavaScriptCore/ftl/FTLOSRExit.h
M Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
Log Message:
-----------
[JSC] Store `OSRExitDescriptor` exit values as a compact byte stream
https://bugs.webkit.org/show_bug.cgi?id=322369
Reviewed by Yusuke Suzuki.
FTL::OSRExitDescriptor::m_values is a FixedOperands<ExitValue> with one 9 byte
entry per argument, local and tmp of the whole inline stack, and it is kept for
as long as the FTL code lives. Most entries carry almost no information. On
JetStream3 (5,455 FTL compiles, 161,428 descriptors, 60 entries per descriptor
on average) 83% of the entries are Dead, 4% are arguments flushed to their own
stack slot, and 4% are constants of which only 7% are distinct within one
JITCode. The dense arrays hold 86 MB over the run, 15.5 KB per FTL compile,
which makes them the largest part of the per-CodeBlock footprint of FTL code.
This patch replaces the dense array with OSRExitValues, which stores the same
information as a tag + payload byte stream; the format is described in the
comment above the class in FTLOSRExit.h. Dead values are run-length encoded
and constants are shared through a per-JITCode table. LowerDFGToB3 builds the
Operands<ExitValue> as before and encodes it once. operationCompileFTLOSRExit
decodes the stream into a stack-local FixedOperands<ExitValue> and passes it to
compileStub; this runs once per exit site, so the rest of the exit compiler is
unchanged. The localsOffset adjustment that FTL::compile applied to every entry
of every descriptor is now stored once in FTL::JITCode and applied while
decoding.
On the same JetStream3 run the byte streams and constant tables total 4.77 MB
(0.50 bytes per entry, -94.5%), 0.85 KB per FTL compile. Encoding takes 122 ns
per descriptor (0.3% of the FTL lowering time) and decoding 104 ns per exit stub
(1.3% of compileStub).
* Source/JavaScriptCore/ftl/FTLCompile.cpp:
* Source/JavaScriptCore/ftl/FTLExitValue.h:
* Source/JavaScriptCore/ftl/FTLJITCode.cpp:
* Source/JavaScriptCore/ftl/FTLJITCode.h:
* Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:
* Source/JavaScriptCore/ftl/FTLOSRExit.cpp:
* Source/JavaScriptCore/ftl/FTLOSRExit.h:
* Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp:
Canonical link: https://commits.webkit.org/319934@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications