So, I have finally managed how to omit the limitation of RPython to pass arguments of various type to the called functions. The limitation was due to passing the arguments as a list (which has to have elements of the same type in RPython). Instead of this, internally the jitffi module fishes elements from the passed list (this is a wrapped list from app-level) and pushes them directly to the calling stack.
I have added a simple cache for compiled loops. It's a bit primitive but it works. Simple, once the loop is compiled it has been stored in the cache and then before the whole compiling operation, we check if there is already compiled code (if the result type and arguments are the same).
It still needs some extra work, e.g. once we pushed something to the cache, it has never been removed from. So the cache can grow infinitely. I will try to add some cleaning operation later. It's not really important for now.
And this week..
I will continue my work to have C pointers working as arguments for calling functions.
Have a nice weekend!