Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 67d43c36bbf9f2111a98316b5bd4a7ea1a539761 https://github.com/WebKit/WebKit/commit/67d43c36bbf9f2111a98316b5bd4a7ea1a539761 Author: Angelos Oikonomopoulos <ange...@igalia.com> Date: 2022-12-22 (Thu, 22 Dec 2022)
Changed paths: M Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h M Source/JavaScriptCore/b3/B3Common.cpp M Source/JavaScriptCore/b3/B3LowerToAir.cpp M Source/JavaScriptCore/b3/B3MemoryValueInlines.h M Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp M Source/JavaScriptCore/b3/air/AirArg.h M Source/JavaScriptCore/b3/air/AirCode.cpp M Source/JavaScriptCore/b3/air/AirHelpers.h M Source/JavaScriptCore/b3/air/AirLowerStackArgs.cpp M Source/JavaScriptCore/b3/air/opcode_generator.rb M Source/JavaScriptCore/wasm/WasmAirIRGenerator32_64.cpp M Source/JavaScriptCore/wasm/WasmAirIRGenerator64.cpp M Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h Log Message: ----------- Make MacroAssemblerARMv7 scratch regs available to Air https://bugs.webkit.org/show_bug.cgi?id=249648 Reviewed by Justin Michaud. Make addressTempRegister/dataTempRegister available for use in Air. We still need to reserve one of the two as the extendedOffsetAddrRegister, so this results in one extra usable register in Air. Legal load offsets on ARM differ between words and doubles, so we need to thread the Air opcode all the way to isValidAddrForm. We also make calls to MacroAssemblerARMv7::short_move (which make use of the cachedAddressTempRegister) conditional on m_allowScratchRegister, so that we don't accidentally try to use a cached value. The trickiest part is in the use of the extendedOffsetAddrRegister in Air. The register allocator in AirAllocateRegistersAndStackAndGenerateCode.cpp assumes that it can flush a register value without needing any extra registers. This is not the case on ARM when the offset relative to the callFrameRegister is too large. It used to be the case before this patch, because MacroAssemblerARMv7 was privately reserving a register. However, the extendedOffsetAddrRegister may have already been allocated by lowerStackArgs, so we can't rely on it being available when we later need to spill a value. Instead, we move the lowering of the extended offset to GenerateAndAllocateRegisters::generate, which becomes the sole user of extendedOffsetAddrRegister. Note that this is not a pure win on ARMv7. We lose the reuse of previously computed addresess in MacroAssemblerARMv7, which results in larger code size overall. We can hopefully claim those back by implementing the same caching logic generically in Air. This is a wash on the total score for JetStream2 but the corresponding code size is 18% larger. * Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::store32): (JSC::MacroAssemblerARMv7::cachedRegisterGetValue): (JSC::MacroAssemblerARMv7::cachedRegisterSetValue): (JSC::MacroAssemblerARMv7::short_move): (JSC::MacroAssemblerARMv7::move): (JSC::MacroAssemblerARMv7::setupArmAddress): (JSC::MacroAssemblerARMv7::absoluteAddressWithinShortOffset): (JSC::MacroAssemblerARMv7::moveFixedWidthEncoding): * Source/JavaScriptCore/b3/B3Common.cpp: (JSC::B3::extendedOffsetAddrRegister): * Source/JavaScriptCore/b3/B3LowerToAir.cpp: * Source/JavaScriptCore/b3/B3MemoryValueInlines.h: (JSC::B3::MemoryValue::isLegalOffsetImpl const): * Source/JavaScriptCore/b3/air/AirAllocateRegistersAndStackAndGenerateCode.cpp: (JSC::B3::Air::callFrameAddr): (JSC::B3::Air::GenerateAndAllocateRegisters::flush): (JSC::B3::Air::GenerateAndAllocateRegisters::alloc): (JSC::B3::Air::GenerateAndAllocateRegisters::generate): * Source/JavaScriptCore/b3/air/AirArg.h: (JSC::B3::Air::Arg::isValidAddrForm): (JSC::B3::Air::Arg::isValidForm const): * Source/JavaScriptCore/b3/air/AirCode.cpp: (JSC::B3::Air::Code::Code): * Source/JavaScriptCore/b3/air/AirHelpers.h: (JSC::B3::Air::moveForType): * Source/JavaScriptCore/b3/air/AirLowerStackArgs.cpp: (JSC::B3::Air::lowerStackArgs): * Source/JavaScriptCore/b3/air/opcode_generator.rb: * Source/JavaScriptCore/wasm/WasmAirIRGenerator32_64.cpp: (JSC::Wasm::AirIRGenerator32::emitZeroInitialize): (JSC::Wasm::AirIRGenerator32::emitLoad): (JSC::Wasm::AirIRGenerator32::emitStore): (JSC::Wasm::isFPLoadOp): (JSC::Wasm::AirIRGenerator32::emitLoadOp): (JSC::Wasm::isFPStoreOp): (JSC::Wasm::AirIRGenerator32::emitStoreOp): * Source/JavaScriptCore/wasm/WasmAirIRGenerator64.cpp: (JSC::Wasm::AirIRGenerator64::materializeAddrArg): * Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h: (JSC::Wasm::AirIRGeneratorBase::emitPatchpoint): (JSC::Wasm::ExpressionType>::restoreWebAssemblyGlobalState): (JSC::Wasm::ExpressionType>::addCurrentMemory): (JSC::Wasm::ExpressionType>::getGlobal): (JSC::Wasm::ExpressionType>::setGlobal): (JSC::Wasm::ExpressionType>::fixupPointerPlusOffsetForAtomicOps): (JSC::Wasm::ExpressionType>::addCallIndirect): Canonical link: https://commits.webkit.org/258279@main _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes