[JSC][ARMv7] Support callee save FPRs
Patch by Geza Lore <Geza Lore> on 2022-05-25
https://bugs.webkit.org/show_bug.cgi?id=240376
Reviewed by Yusuke Suzuki.
ARMv7 FPRs d8-d15 (also referenced as s16-s32 and q4-q7) are callee save
in the host ABI, but currently JSC is unaware of this. This does not
currently cause problems as they are not used, but will be used by the
Wasm JITs.
In preparation for the 32-bit ports of the Wasm JITs, this patch:
- Teaches JSC about callee save FPRs on ARMv7. d8-d15 are host ABI
callee save, but only d8-d14 are VM callee save, i.e.: we treat d15
as a volatile register in JIT code. This is so we can use d15 as a
macro assembler scratch register.
- Changes offlineasm and MacroAssemblerARMv7 to use d15 as the FP
scratch register. We do this so we can use the full range of d0-d7
as temporary, and in particular as Wasm argument/return registers.
- To achieve the above, we need to modify RegisterAtOffsetList as GPRs
and FPRs have different sizes on JSVALUE32_64 platforms
- Adds the ARMv7 specific registers to
RegisterSet::macroScratchRegisters()
- assembler/ARMv7Registers.h:
- assembler/MacroAssemblerARMv7.h:
- b3/air/AirCode.cpp:
(JSC::B3::Air::Code::calleeSaveRegisterAtOffsetList const):
(JSC::B3::Air::Code::dump const):
(testInfiniteLoopDoesntCauseBadHoisting):
(JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters):
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
(JSC::roundCalleeSaveSpaceAsVirtualRegisters): Deleted.
- bytecode/ValueRecovery.h:
(JSC::ValueRecovery::calleeSaveGPRDisplacedInJSStack):
(JSC::ValueRecovery::calleeSaveRegDisplacedInJSStack): Deleted.
(JSC::DFG::prepareOSREntry):
- dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::calleeSaveSlot):
- ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
- interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::restoreCalleeSavesFromVMEntryFrameCalleeSavesBufferImpl):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
(JSC::AssemblyHelpers::emitSave):
(JSC::AssemblyHelpers::emitRestore):
(JSC::AssemblyHelpers::emitSaveCalleeSavesFor):
(JSC::AssemblyHelpers::emitRestoreCalleeSavesFor):
(JSC::AssemblyHelpers::copyLLIntBaselineCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::emitSaveOrCopyLLIntBaselineCalleeSavesFor):
- jit/CallFrameShuffleData.cpp:
(JSC::CallFrameShuffleData::setupCalleeSaveRegisters):
(JSC::CallFrameShuffler::snapshot const):
- jit/CallFrameShuffler32_64.cpp:
(JSC::CallFrameShuffler::emitDisplace):
- jit/FPRInfo.h:
- jit/GPRInfo.h:
- jit/RegisterAtOffsetList.cpp:
(JSC::RegisterAtOffsetList::RegisterAtOffsetList):
- jit/RegisterAtOffsetList.h:
(JSC::RegisterAtOffsetList::registerCount const):
(JSC::RegisterAtOffsetList::sizeOfAreaInBytes const):
(JSC::RegisterAtOffsetList::adjustOffsets):
(JSC::RegisterAtOffsetList::size const): Deleted.
(JSC::RegisterAtOffsetList::at): Deleted.
(JSC::RegisterSet::macroScratchRegisters):
(JSC::RegisterSet::vmCalleeSaveRegisters):
- llint/LowLevelInterpreter.asm:
- offlineasm/arm.rb:
- wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::wasmToJS):
- wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):
Canonical link: https://commits.webkit.org/250952@main