Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [omr-dev] Calling functions recursively and via pointers

Hi Mark,

On 27 June 2018 at 22:38, Mark Stoodley <mstoodle@xxxxxxxxxx> wrote:
>
> I would check out the Call and ComputedCall services from JitBuilder. The basic idea is that there are indirect call opcodes whose first child is expected to compute the entry point. You will still need to cook up a ResolvedMethod structure corresponding to the final target, even though it's a computed entry point.
>
> For a recursive function call, you need to reuse the ResolvedMethod for the function you're compiling and it *should* just work (there are paths in the code generators to detect this case....it all amazingly just worked out when I did the JitBuilder support for Calls).

Great - sounds easy enough.

I am looking forward to creating a JIT backend for Ravi (my version of
Lua) using my C/OMRJIT backend. I already have done much of the work
of creating C code for a Lua function so this should not take too much
time. Of course the generated code for a typical Lua function has many
branches due to the runtime type checking - I will probably start with
a subset that relies upon Ravi extensions to detect types at compile
time.

Thanks and Regards
Dibyendu


Back to the top