libjit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Libjit] Nesting compilation order


From: Aleksey Demakov
Subject: Re: [Libjit] Nesting compilation order
Date: Mon, 3 Dec 2018 00:04:35 +0300

Hi,

On Sat, Dec 1, 2018 at 9:37 PM Aritz Erkiaga <address@hidden> wrote:
>
> I know that nested functions in LibJIT must be compiled before their parents. 
> I was wondering if this also applies to those called via 
> jit_insn_call_nested_indirect() from Jakob's 'nesting' branch. If so, is 
> there any way to overcome this limitation?

In libjit nested functions are intended to support Pascal-like
lexically nested functions, libjit provides the means to access
variables defined in an outer function scope from an inner function,
subject to lexical scope rules. In this scenario you have definitions
of all nested functions together with the parent function. I think it
is required to build all nested functions before compilation just to
know what outer scope values are accessed from inner scope and so need
to be addressable.

However I think that after building all the functions, you might try
to compile them in any order. I never tried it myself, so it might
fail. But it might also work, as currently I do not see any problems
with that.

Regards,
Aleksey



reply via email to

[Prev in Thread] Current Thread [Next in Thread]