emacs-devel
[Top][All Lists]
Advanced

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

Re: Suppressing native compilation (short and long term)


From: Andrea Corallo
Subject: Re: Suppressing native compilation (short and long term)
Date: Thu, 29 Sep 2022 08:18:08 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Andrea Corallo <akrl@sdf.org>
>> Cc: rlb@defaultvalue.org, emacs-devel@gnu.org
>> Date: Wed, 28 Sep 2022 21:32:13 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> Yes `native-comp-deferred-compilation' AFAIK does exactly this already,
>> >> `native-comp-available-p' is to check if the native compiler is
>> >> available (not necessarily the deferred/async mechanism).
>> >
>> > But then it should disable the trampolines as well, see startup.el.
>> 
>> Not in my opinion, trampolines are not deferred async compilation.
>> 
>> Also as mentioned ATM is not possible to disable trampolines and have a
>> fully working native comp Emacs (if we assume primitives can be
>> redefined).
>
> I'm confused.  I alluded to this part of startup.el:
>
>     (when (featurep 'native-compile)
>       (unless (native-comp-available-p)
>         ;; Disable deferred async compilation and trampoline synthesis
>         ;; in this session.  This is necessary if libgccjit is not
>         ;; available on MS-Windows, but Emacs was built with
>         ;; native-compilation support.
>         (setq native-comp-deferred-compilation nil
>               comp-enable-subr-trampolines nil))
>
> The last part disables trampolines, AFAIU.  So what am I missing here?

Hi Eli,

yes it does, what do you find confusing about this?

This is how I see things, we have two compilation mechanisms:

1- Syncronous native compilation.  This can be triggered:
   1.1- By the user (calling `native-compile').
   1.2- By Emacs in the need of generating a trampoline.

2- Async/deferred/jit (or how we wanna call it), this is triggered
   automatically when loafing a .elc with no corresponding .eln.

We have two customize to control the two automatic mechanisms:
`comp-enable-subr-trampolines' gates 1.2,
`native-comp-deferred-compilation' gates 2.

Indeed `native-comp-available-p' gates all native compilations.

Best Regards

  Andrea



reply via email to

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