[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#5863: defadvice in byte compiled file does not work
From: |
Andrea Corallo |
Subject: |
bug#5863: defadvice in byte compiled file does not work |
Date: |
Thu, 19 Nov 2020 08:14:54 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> BTW, it seems like advising primitives will work once we get native-comp
>> merged:
>>
>> The result of this procedure is that each newly activated function will
>> use the trampoline in place of the original primitive and the
>> trampoline will execute the call going through funcall making the
>> advice effective!
>>
>> This works so well that in-fact now is even possible to advice
>> effectively what wasn't effective in byte-code (ex the + function). But
>> hey, don't try this a home!
>>
>> https://akrl.sdf.org/gccemacs.html#org3b7398e
>
> AFAIK this still won't cover all cases: we'd additionally have to
> arrange for C calls to F<fun> to go through the trampoline. Maybe we
> can do that cheaply, I don't know.
I think there's no way we'll be able to fix the C to C case without some
very measurable performance impact.
For essentially the same reason the nativecomp trick does not work for
the (few) functions we opencode.
Ex on optimized compiled code redefining or advising `1+' will not take
effect. So yeah works better but is still not perfect.
> In any case, I think the story is still sufficiently complex that we're
> better off saying that "it may work or not depending on your luck".
thus agree.
Andrea