all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: emacs-devel@gnu.org
Subject: Re: Emacs Lisp JIT Compiler
Date: Fri, 24 Aug 2018 23:23:26 +0300	[thread overview]
Message-ID: <83in3z8qf5.fsf@gnu.org> (raw)
In-Reply-To: <87ftz31wht.fsf@tromey.com> (message from Tom Tromey on Fri, 24 Aug 2018 11:54:06 -0600)

> From: Tom Tromey <tom@tromey.com>
> Cc: Tom Tromey <tom@tromey.com>,  emacs-devel@gnu.org
> Date: Fri, 24 Aug 2018 11:54:06 -0600
> 
> It looks pretty good to me.  I was surprised to see the code to
> dynamically load libjit, but I don't really know what restrictions the
> MinGW port is subject to.

In general, any library that is not strictly required for Emacs to
work (i.e. it either supports an optional feature or we have fallback
code to provide the same feature) should on Windows ideally be probed
at run time and loaded dynamically only if it's available, because we
want to allow users to run Emacs without those libraries being
installed.  The reason is that finding and installing all those
libraries is not always easy on Windows.

> There are several hunks like:
> 
> +#if EMACS_INT_MAX <= LONG_MAX
>        tem = jit_value_create_nint_constant (func, jit_type_sys_int,
>  					    MOST_POSITIVE_FIXNUM);
> +#else
> +      tem = jit_value_create_long_constant (func, jit_type_sys_longlong,
> +					    MOST_POSITIVE_FIXNUM);
> +#endif
> 
> Here I think it would be better to define a new type at init time and
> avoid #ifs in the code itself.

Maybe I'm missing something, but I didn't see how to do that with just
a type definition.  jit_value_create_long_constant is special in that
it allows to create 64-bit constants in a 32-bit build, by allocating
a 64-bit buffer and storing it address in the jit_value_t object it
returns.  jit_value_get_long_constant is then capable to access the
value in that buffer.  By contrast, all the other jit_value_create_*
functions store the value directly in the jit_value_t object, so they
can support values that are no wider than the native intptr_t type.

> I like the introduction of lisp_object_type for this reason.  I think I
> was being a bit lax about the types here, as you note.  Most things,
> like the CONSTANT macro, I think should be using lisp_object_type,
> because that's the fundamental type of bytecode operations.  Only
> specialized spots like extracting a fixnum value or calling some C
> function should be using other types.

We could indeed use lisp_object_type more, but that won't save us from
using jit_value_create_long_constant, as long as we want to support
the --with-wide-int build.  And we cannot replace the calls to
jit_value_create_nint_constant with the long variant because that will
make the code less efficient in 32-bit builds without wide ints.

But I will take another look and see what can be done to have less
#ifdef's.



  reply	other threads:[~2018-08-24 20:23 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-13  4:01 Emacs Lisp JIT Compiler Tom Tromey
2018-08-13  5:37 ` Paul Eggert
2018-08-13 15:15   ` Tom Tromey
2018-08-14  0:16   ` Tom Tromey
2018-08-14 20:11     ` Daniel Colascione
2018-08-14 20:55       ` Paul Eggert
2018-08-14 21:03         ` Daniel Colascione
2018-08-14 22:38           ` Paul Eggert
2018-08-15 16:41             ` Eli Zaretskii
2018-08-15 17:16               ` Paul Eggert
2018-08-15 17:47                 ` Eli Zaretskii
2018-08-16  0:29               ` Tom Tromey
2018-08-16 13:26                 ` Eli Zaretskii
2018-08-16 15:43                   ` Daniel Colascione
2018-08-16 16:22                     ` Andreas Schwab
2018-08-19 18:17                     ` Tom Tromey
2018-08-19 19:00                       ` Eli Zaretskii
2018-08-19 19:16                         ` Tom Tromey
2018-08-19 20:23                       ` Stefan Monnier
2018-08-18 10:10                   ` Steinar Bang
2018-08-18 11:31                     ` Eli Zaretskii
2018-08-19 10:00                       ` Robert Pluim
2018-08-19 15:01                         ` Eli Zaretskii
2018-08-19 15:26                   ` Tom Tromey
2018-08-23  0:47                 ` Tom Tromey
2018-08-23 16:48                   ` Eli Zaretskii
2018-08-24 17:54                     ` Tom Tromey
2018-08-24 20:23                       ` Eli Zaretskii [this message]
2018-08-24 21:03                         ` Tom Tromey
2018-08-25  6:51                           ` Eli Zaretskii
2018-09-10 11:03                             ` Ergus
2018-09-10 11:15                               ` Robert Pluim
2018-09-10 11:53                                 ` Tom Tromey
2018-09-12 13:37                                   ` Robert Pluim
2018-09-13  4:32                                     ` Tom Tromey
2018-08-16  0:03   ` Tom Tromey
2018-08-16  2:45     ` Eli Zaretskii
2018-08-16 18:07       ` Eli Zaretskii
2018-08-13 13:50 ` T.V Raman
2018-08-13 15:18   ` Tom Tromey
2018-08-13 15:23     ` T.V Raman
2018-08-13 15:15 ` Eli Zaretskii
2018-08-20 21:54   ` John Wiegley
2018-08-13 23:31 ` Richard Stallman
2018-08-13 23:51   ` Tom Tromey
2018-08-16  2:42     ` Richard Stallman
2018-08-15  0:21 ` Clément Pit-Claudel
2018-08-16  0:32   ` Tom Tromey
2018-08-16  2:14     ` Clément Pit-Claudel
  -- strict thread matches above, loose matches on Subject: below --
2016-12-11 17:37 Nickolas Lloyd
2016-12-12  6:07 ` John Wiegley
2016-12-12 11:51   ` Nickolas Lloyd
2016-12-12 16:45     ` John Wiegley
2016-12-23 17:22       ` Nickolas Lloyd
2016-12-13 22:24   ` Johan Bockgård
2016-12-05 18:16 Burton Samograd
2016-12-05 18:40 ` Eli Zaretskii
2016-12-05 19:32 ` Daniel Colascione
2016-12-05 21:03   ` Burton Samograd
2016-12-06 15:54     ` Lluís

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

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

  git send-email \
    --in-reply-to=83in3z8qf5.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=tom@tromey.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.