lightning
[Top][All Lists]
Advanced

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

Re: [Lightning] Re: Proof of concept work on inline functions


From: Paulo César Pereira de Andrade
Subject: Re: [Lightning] Re: Proof of concept work on inline functions
Date: Fri, 10 Sep 2010 14:05:11 -0300

2010/9/10 Ludovic Courtès <address@hidden>:
> Hi,

  Hi,

> Paulo César Pereira de Andrade
> <address@hidden>
> writes:
>
>> static int
>> generate_foo(jit_state *lightning_state)
>> {
>>     jit_set_state(lightning_state);
>>     jit_stxi_p(bar, JIT_FP, JIT_RET);
>>     ...
>> }
>
> The pointer to the current state would still be global, so that wouldn’t
> be reentrant, which is unfortunate (e.g., it’d make it impossible to
> have several threads or co-routines JIT’ing at the same time.)

  I think this argument is good enough to change as soon as possible
to use the other approach suggested, that is to have a "hidden" extra
argument, so that one can have several jit generators in parallel and in
the same thread, if one per thread, could use a tls global.

  I did not bother much with it because I do not plan to have multiple
generators running in parallel in my language, and am wondering more
on having a clear way to handle "relocations"; by relocations I mean to
have some proper way to know what patches are relative, and a proper
way to handle the need to realloc'ate the jit buffer before finishing code
generation. If having multiple buffers, that may make things hard to
handle. In my language current implementation, it creates all jit in
a single segment and single function, but that should change soon,
to add functions in jit. Still, it has multiple threads, signal handing,
etc, all in jit generated with lightning :-)

> Thanks,
> Ludo’.

Thanks,
Paulo



reply via email to

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