[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Lightning] Re: Proof of concept work on inline functions
From: |
Ludovic Courtès |
Subject: |
[Lightning] Re: Proof of concept work on inline functions |
Date: |
Sat, 11 Sep 2010 15:10:59 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Hi,
Paolo Bonzini <address@hidden> writes:
> On Fri, Sep 10, 2010 at 19:05, Paulo César Pereira de Andrade
> <address@hidden> wrote:
>> 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.
>
> You could add the argument to the inline function, and then define a
> same-named macro like
>
> #define jit_addi_i(a,b,c) jit_add_i(_jit,a,b,c)
+1
Ludo’.