Hello! I want to implement ICs using hot swapping, I found out there is CallConv::Fast, is it the calling convention I should use to call into IC entries?
although you could probably make ICs that technically work with cranelift, it doesn't really have built in support for it and I would be surprised if you could get something that worked well out of it
I don't know a ton about the implementation of ICs but I would expect you would ideally want a tail call style ABI for them, for example, and cranelift doesn't have any support for tail calls right now
Yep, tail calls and lack of prologue/epilogue are the two key bits; we don't have either right now, but they could (and probably eventually will) be added
For now, what one could do is implement an "IC interpreter loop", where ICs are given indices, and every IC site calls this function, and the function body is a loop around a switch(ic_index) { ... }
that's not as efficient, but at least has the desired semantics wrt tail calls (no stack growth) while chaining
Last updated: Nov 22 2024 at 16:03 UTC