Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cbff45e59253712319ac26cab74d8c76557d91ca
      
https://github.com/WebKit/WebKit/commit/cbff45e59253712319ac26cab74d8c76557d91ca
  Author: Joseph Griego <jgri...@igalia.com>
  Date:   2022-12-22 (Thu, 22 Dec 2022)

  Changed paths:
    M Source/JavaScriptCore/b3/B3StackmapGenerationParams.cpp
    M 
Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp
    M Source/JavaScriptCore/b3/air/AirCode.cpp
    M Source/JavaScriptCore/b3/air/AirHandleCalleeSaves.cpp
    M Source/JavaScriptCore/b3/air/AirLowerAfterRegAlloc.cpp
    M Source/JavaScriptCore/b3/air/testair.cpp
    M Source/JavaScriptCore/interpreter/Interpreter.cpp

  Log Message:
  -----------
  [JSC] B3/Air should use the system register convention
https://bugs.webkit.org/show_bug.cgi?id=249776

Reviewed by Yusuke Suzuki.

A previous patch (189dce5799e8) changed several of these locations to use the
`vmCalleeSaveRegisters` over the `calleeSaveRegisters`--change them back.

Though on most platforms with Air support, these two register sets are
identical, on ARMv7, which is new to the Air club, fewer registers are included
in the VM register calee-save set than in the system's callee-save set, which
caused problems with unwinding.

This patch also addresses the ARMv7-only issue with unwinding: if an Air callee
in a VM stack being unwound saves registers other than VM callee-saves, they
simply won't be restored--this is OK for the time being as VM callers will only
expect the VM callee-saves to be preserved. Eventually we may want to enable
code generation on ARMv7 to select the VM convention over the system one to
avoid unnecessary save/restores in ARM-generated code. (The alternative, making
vmCalleeSaveRegisters use all of the available platform callee-saves, isn't
appealing, as we want more temporary registers available to the assembler and
lower tiers)

Note that the usage in `B3StackGenerationParams.cpp` was actually more-or-less
original to that file. Still, it seems correct to use `calleeSaveRegisters`
there. (And again, on platforms other than ARMv7, the change is a no-op; the
sets are identical)

* Source/JavaScriptCore/b3/B3StackmapGenerationParams.cpp:
(JSC::B3::StackmapGenerationParams::unavailableRegisters const):
* Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp:
(JSC::B3::Air::GenerateAndAllocateRegisters::prepareForGeneration):
* Source/JavaScriptCore/b3/air/AirCode.cpp:
(JSC::B3::Air::Code::Code):
* Source/JavaScriptCore/b3/air/AirHandleCalleeSaves.cpp:
(JSC::B3::Air::handleCalleeSaves):
* Source/JavaScriptCore/b3/air/AirLowerAfterRegAlloc.cpp:
(JSC::B3::Air::lowerAfterRegAlloc):
* Source/JavaScriptCore/b3/air/testair.cpp:
* Source/JavaScriptCore/interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):

Canonical link: https://commits.webkit.org/258261@main


_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to