From: "alanwu (Alan Wu)" Date: 2021-12-31T18:31:02+00:00 Subject: [ruby-core:106935] [Ruby master Bug#18439] Support YJIT for VC++ Issue #18439 has been updated by alanwu (Alan Wu). Yes, supporting Window's x64 calling convention is non-trivial. In addition to what John already mentioned we also need to uphold [unwindability](https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#unwindability) constraints so among other things, `longjmp` can work. I think `longjmp()` is used for Ruby exceptions [on MSVC](https://github.com/ruby/ruby/blob/11b8aaa26a22bb67b144484af6890844771b5f46/win32/Makefile.sub#L864) like on POSIX. This means YJIT can't generate `PUSH` and `POP` outside of prolog and epilog anymore as they puts the stack pointer temporarily out of alignment. YJIT will also need to supply unwinding info through [`RtlInstallFunctionTableCallback()`](https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlinstallfunctiontablecallback). ---------------------------------------- Bug #18439: Support YJIT for VC++ https://bugs.ruby-lang.org/issues/18439#change-95756 * Author: usa (Usaku NAKAMURA) * Status: Open * Priority: Normal * Assignee: maximecb (Maxime Chevalier-Boisvert) * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN ---------------------------------------- I heard that supporting YJIT for VC++ needs mmap from k0kubun-san, so I implemented tiny mmap emulation on Windows and committed it to master. And, I found we need more changes to actually enabled YJIT for VC++, at least: - YJIT requires `OPT_DIRECT_THREADED_CODE` or `OPT_CALL_THREADED_CODE` in `rb_yjit_compile_iseq()`. Really? - Maybe ABI deffers between VC++ and YJIT's expectation. Can I get support to fix above? -- https://bugs.ruby-lang.org/ Unsubscribe: