Use SystemV ABI for Baseline JS JIT on Windows#29582
Conversation
94bdf19 to
dc9443d
Compare
|
EWS run on previous version of this PR (hash 94bdf19) Details |
dc9443d to
71a3ac0
Compare
|
EWS run on previous version of this PR (hash dc9443d) Details |
There was a problem hiding this comment.
You can prolly just get rid of this define either now or in a later patch.
There was a problem hiding this comment.
Feel like the OS and PLATFORM checks can go and just rely on whether or not JIT is enabled. @Constellation thoughts?
There was a problem hiding this comment.
Sounds good to me. We must enable it only for ARM64 and x64 and that's the most critical condition.
This comment was marked as outdated.
This comment was marked as outdated.
|
EWS run on previous version of this PR (hash fed1940) Details |
|
EWS run on previous version of this PR (hash 71a3ac0) Details |
|
Enabled more baseline JIT things for parity with the other platforms, it now fails even earlier. Test program: Fails in call to operationDefaultCall JITOperations.cpp#2390 calleeFrame is set to the same value as callLinkInfo. This is before baseline JIT kicks in, it's just calling via the generated thunk. If I switch defaultCallThunk to the llint_default_call_trampoline in LLIntEntrypoint.cpp, it gets further and the baseline jitted call to operationThrow fails, it gets a null call frame (and also looks like the globalObject->vm pointer is sometimes trashed). Here's the generated assembly for operationDefaultCall. It's a bit odd to me that it's using RSI and RDX for calleeFrame / callLinkInfo, what happened to RDI? Compare that with LLIntSlowPaths.cpp llint_default_call (which is used by llint_default_call_trampoline): Much simpler, we're using RSI and RDI as expected for a two-parameter function. I'll have to dig into why we're getting such odd assembly output for |
|
The above is still a problem after upgrading to clang 18.1.7 (previously using clang 16.0.5). |
|
I've got a minimal-ish repro on compiler explorer: https://godbolt.org/z/aT6xMhTfa If compiled without optimizations on Windows, operationDefaultCall ends up passing the parameters in |
|
EWS run on previous version of this PR (hash b78e1fb) Details |
b78e1fb to
580b6a2
Compare
|
EWS run on previous version of this PR (hash 580b6a2) Details |
580b6a2 to
cc0fe94
Compare
|
EWS run on previous version of this PR (hash cc0fe94) Details |
cc0fe94 to
ce82f3c
Compare
|
EWS run on current version of this PR (hash ce82f3c) Details |
There was a problem hiding this comment.
Sounds good to me. We must enable it only for ARM64 and x64 and that's the most critical condition.
|
Keep in mind that Apple JSC team does not maintain Windows JIT. So this is community effort to keep it working. |
https://bugs.webkit.org/show_bug.cgi?id=275213 Reviewed by Yusuke Suzuki. Using SystemV ABI for C++ entrypoints and JIT operations. Removed ExceptionOperationResultBase from OperationResult. Due to more conservative empty base class optimization on Windows, this was causing register spills which (surprisingly) added an extra register parameter to the compiled function, which broke when called from JIT generated assembly. USE_BUILTIN_FRAME_ADDRESS is still disabled, this requires work in clang to enable __builtin_stack_address(). Disabled CSS Selector JIT, requires further work Disable DFG JIT at runtime, requires further work Disable YARR JIT at runtime, requires further work * Source/JavaScriptCore/assembler/AbstractMacroAssembler.h: (JSC::AbstractMacroAssembler::TrustedImmPtr::TrustedImmPtr): * Source/JavaScriptCore/assembler/MacroAssembler.cpp: (JSC::stdFunctionCallback): * Source/JavaScriptCore/assembler/MacroAssembler.h: * Source/JavaScriptCore/assembler/MacroAssemblerPrinter.cpp: (JSC::Printer::printCallback): * Source/JavaScriptCore/assembler/MacroAssemblerPrinter.h: * Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::call): (JSC::MacroAssemblerX86_64::callWithUGPRPair): Deleted. * Source/JavaScriptCore/assembler/ProbeContext.h: * Source/JavaScriptCore/bytecode/CodeBlock.h: * Source/JavaScriptCore/bytecode/InlineCacheCompiler.cpp: (JSC::InlineCacheCompiler::emitDataICPrologue): * Source/JavaScriptCore/dfg/DFGArithMode.h: * Source/JavaScriptCore/dfg/DFGJITCompiler.h: (JSC::DFG::JITCompiler::appendCallWithUGPRPair): Deleted. * Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::appendCallSetResult): (JSC::DFG::SpeculativeJIT::appendCallWithUGPRPair): Deleted. * Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp: (JSC::DFG::SpeculativeJIT::emitCall): * Source/JavaScriptCore/interpreter/CallFrame.h: * Source/JavaScriptCore/jit/CCallHelpers.h: (JSC::CCallHelpers::ArgCollection::argCount): (JSC::CCallHelpers::calculatePokeOffset): (JSC::CCallHelpers::marshallArgumentRegister): (JSC::CCallHelpers::setupArgumentsImpl): * Source/JavaScriptCore/jit/JIT.h: * Source/JavaScriptCore/jit/JITCall.cpp: (JSC::JIT::emit_op_iterator_next): * Source/JavaScriptCore/jit/JITOpcodes.cpp: (JSC::JIT::op_enter_handlerGenerator): * Source/JavaScriptCore/jit/JITOperations.cpp: * Source/JavaScriptCore/jit/JITOperations.h: * Source/JavaScriptCore/jit/JITPropertyAccess.cpp: * Source/JavaScriptCore/jit/OperationResult.h: * Source/JavaScriptCore/jit/RegisterSet.cpp: (JSC::RegisterSetBuilder::wasmPinnedRegisters): * Source/JavaScriptCore/jit/SlowPathCall.cpp: (JSC::JITSlowPathCall::generateThunk): * Source/JavaScriptCore/jit/ThunkGenerators.cpp: (JSC::nativeForGenerator): (JSC::arityFixupGenerator): * Source/JavaScriptCore/llint/LLIntData.cpp: * Source/JavaScriptCore/llint/LLIntData.h: * Source/JavaScriptCore/llint/LLIntSlowPaths.cpp: (JSC::LLInt::logWasmPrologue): (JSC::LLInt::llint_write_barrier_slow): * Source/JavaScriptCore/llint/LLIntThunks.h: * Source/JavaScriptCore/runtime/Options.cpp: (JSC::Options::notifyOptionsChanged): * Source/JavaScriptCore/runtime/SlowPathFunction.h: * Source/JavaScriptCore/tools/JSDollarVM.cpp: * Source/WTF/wtf/FunctionTraits.h: (WTF::SYSV_ABI): * Source/WTF/wtf/PlatformEnable.h: * Source/WTF/wtf/PlatformUse.h: Canonical link: https://commits.webkit.org/280216@main
ce82f3c to
0b1e421
Compare
|
Committed 280216@main (0b1e421): https://commits.webkit.org/280216@main Reviewed commits have been landed. Closing PR #29582 and removing active labels. |
🛠 wpe-cairo
🧪 mac-AS-debug-wk2
0b1e421
ce82f3c
🛠 jsc-armv7🧪 jsc-armv7-tests