3 ms·
CRuby needs a full C compiler and linker for JIT to be able to inline things like object allocation. The alternative proposal which Evan Phoenix explored was t
by jashmatthews 8y ago
CRuby needs a full C compiler and linker for JIT to be able to inline things like object allocation.
The alternative proposal which Evan Phoenix explored was to compile the VM and standard library into LLVM IR and keep it for use when JIT compiling Ruby methods.
If you look at the JIT compiler in Racket which is maintained by a small team like CRuby but does use a custom backend, then it has some big limitations like a maximum of 3 function args.
Implementing something like C1 would be an enormous amount of work.
- samth 8y agoI'm not sure what you mean about a maximum of 3 arguments, but the Racket JIT runs on all functions no matter how many arguments they take.
- jashmatthews 8y agoHah, thanks! I was reading the Racket JIT source code late and mixed something up.
- samth 8y agoCertainly, as in almost every JIT I know of, there are limits on which things get optimized in certain ways, which may be what you saw.