Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 587d98eac80670b1c2e1fa542df2885259e58151
https://github.com/WebKit/WebKit/commit/587d98eac80670b1c2e1fa542df2885259e58151
Author: Dan Hecht <[email protected]>
Date: 2026-02-19 (Thu, 19 Feb 2026)
Changed paths:
M Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp
Log Message:
-----------
[JSC] GreedyRegAlloc: remove groupForSpill call when traversing instructions
https://bugs.webkit.org/show_bug.cgi?id=308158
rdar://170666692
Reviewed by Keith Miller.
When the tmp coalescable groups are large, groupForSpill can take time so
avoid calling it when traversing instruction args.
It appears this code has evolved considerably and is overly convoluted,
so let's try to simplify the Move to Move32 for spills logic.
For 64-bit CPUs, transforming Move to Move32 has the effect of using
load32 or store32 in this context, as well as making the instruction
a ZDef32. The latter side effect should not be needed in this context.
Let's choose store32 if this is a store to a 32-bit spill slot, so that
we don't need to stretch the spill slot. Or, if this is a load of a
32-bit spill slot (but not a store to a 64-bit slot) then let's use
load32. The old logic was mostly arriving at the same decision except
for some weird edge cases. Also, the old logic occurred piecemeal which
is hard to reason about especially since the decision impacts the size
of the spill slot for each arg.
Additionally, the comment here seems to be correct in that we shouldn't
need to bail on doing in-place defs of a spill slot if the instruction
can admit it. However, preserve this for smaller ZDef so that
a single 64-bit store can be used (rather than two 32-bit stores)
and also to avoid potentially needing to handle ZDef smaller than 32-bits
to stack slots in lowerStackArgs.
* Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp:
(JSC::B3::Air::Greedy::GreedyAllocator::emitSpillCodeAndEnqueueNewTmps):
Canonical link: https://commits.webkit.org/307857@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications