vnmakarov / mir

A lightweight JIT compiler based on MIR (Medium Internal Representation) and C11 JIT compiler and interpreter based on MIR
MIT License
2.26k stars 145 forks source link

Timeframe for testing/trying cruby integration? #248

Open dsisnero opened 2 years ago

vnmakarov commented 2 years ago

I started to work on MIR-based JIT of CRuby at the end of 2021. Currently I am busy with another project (GCC) and I can spend much more time on CRuby JIT work after GCC-12 release (probably after April).

I guess the preliminary CRuby MIR-based JIT implementation will be open to public this summer or even spring. I need not only to implement MIR-based JIT but also achieve better results than YJIT for this. It means I need to generate specialized code (bbv and profile based one).

Last couple years I was more interesting in MIR-project itself. Recent YJIT addition forced me to use more pragmatic approach to achieve my goals with CRuby JIT sooner. Instead of planed language agnostic implementation of code specialization in MIR itself, I started to work on Ruby specific specialization implementation. Still I see some new features should be implemented for MIR too (dealing with hard regs on MIR level, calling functions generated from MIR directly w/o thunks, implementing some builtins, etc) but these new features are minor in comparison with MIR based specialization (as I wrote I postponed this work -- although some very initial bbv implementation for MIR can be found in branch bbv).

A good JIT for CRuby is a long project. I think even if my MIR-based JIT will be not finally land in CRuby in the future, still this work will help to build a better CRuby JIT.