unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
	Stefan Kangas <stefan@marxist.se>,
	Lennart Borgman <lennart.borgman@gmail.com>,
	5863@debbugs.gnu.org
Subject: bug#5863: defadvice in byte compiled file does not work
Date: Thu, 19 Nov 2020 08:14:54 +0000	[thread overview]
Message-ID: <xjf1rgpbw5d.fsf@sdf.org> (raw)
In-Reply-To: <jwvzh3e6i42.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Thu, 19 Nov 2020 00:20:16 -0500")

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





  reply	other threads:[~2020-11-19  8:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 15:26 bug#5863: defadvice in byte compiled file does not work Lennart Borgman
2010-04-08 15:50 ` Andreas Schwab
2010-04-08 15:57   ` Lennart Borgman
2010-04-08 16:06     ` Andreas Schwab
2010-04-08 16:22       ` Lennart Borgman
2010-04-08 16:55         ` Andreas Schwab
2010-04-08 16:56           ` Lennart Borgman
2010-04-08 17:04             ` Andreas Schwab
2010-04-08 17:06               ` Lennart Borgman
2010-04-08 18:22                 ` Lennart Borgman
2010-04-08 21:52                 ` Andreas Schwab
2010-04-08 23:13                   ` Lennart Borgman
2010-04-09  0:19                     ` Lennart Borgman
2010-04-09  2:06             ` Stefan Monnier
2010-04-09  3:37               ` Drew Adams
2020-11-19  3:23               ` Stefan Kangas
2020-11-19  5:20                 ` Stefan Monnier
2020-11-19  8:14                   ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-11-20  5:07                     ` Stefan Kangas
2020-11-27 11:45                       ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xjf1rgpbw5d.fsf@sdf.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=5863@debbugs.gnu.org \
    --cc=akrl@sdf.org \
    --cc=lennart.borgman@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=schwab@linux-m68k.org \
    --cc=stefan@marxist.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).