emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs Lisp JIT Compiler


From: Eli Zaretskii
Subject: Re: Emacs Lisp JIT Compiler
Date: Mon, 13 Aug 2018 18:15:36 +0300

> From: Tom Tromey <address@hidden>
> Date: Sun, 12 Aug 2018 22:01:34 -0600
> 
> Hi.  I've written a JIT compiler for Emacs Lisp, and I'd like to check
> it in.

Thanks.

> I have only tested this on x86-64.  Whether or not the JIT works on a
> given platform is primarily up to libjit.  (I suspect the JIT won't work
> on x86 with --with-wide-int; but that is something I could fix.)
> 
> I currently have the JIT set up to always compile all eligible functions
> (that is, just byte-compiled, lexically-bound functions).  It's robust
> enough that, as far as I can tell, everything works fine in this mode.
> It would be possible to have it be a bit lazier, say only compile after
> 100 invocations, or something like that.
> 
> Aside from the possible --with-wide-int thing, there are two bugs I know
> of.
> 
> First, libjit never frees functions.  So, if a function is JIT-compiled
> and then redefined, the old JIT code will linger.  It's possible to fix
> this with a custom allocator and a libjit patch (that I sent but that
> hasn't been checked in yet).
> 
> Second, I haven't gotten around to emulating the "quitcounter" behavior
> in the bytecode interpreter.  This seems straightforward.

I think, given the importance of byte compilation, this feature should
become more mature than it evidently is now, before we install it on
master.  The issues you mention are pretty basic, IMO.

So perhaps a feature branch where people could try JIT, and these
issues can be worked on would be the best course of action.  We could
then merge later when the issues are resolved.

Like Paul, I'm somewhat bothered by the relatively slow development of
libjit (its current version is just 0.1.2) and its small development
team.

Thanks.



reply via email to

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