emacs-devel
[Top][All Lists]
Advanced

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

Re: MPS prstack


From: Eli Zaretskii
Subject: Re: MPS prstack
Date: Mon, 27 May 2024 14:45:39 +0300

> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: Eli Zaretskii <eliz@gnu.org>,  Emacs Devel <emacs-devel@gnu.org>
> Date: Mon, 27 May 2024 11:15:35 +0200
> 
> We could write
> 
>   prstack.stack[prstack.sp] = e;
>   prstack.sp += 1;

You could, but AFAIU it's equivalent to the original code.

A compiler is allowed to reorder code if doing so doesn't change the
outcome.  So a valid translation of the above by the compiler would be
something like

  temp = prstack.sp;
  prstack.sp += 1;
  prstack.stack[temp] = e;

> Not sure how we then guarantee that e still in a register or the control
> stack at the second line.
> 
> But my question was more whether MPS actually does call scan_prstack at
> "any moment" or if this is just a theoretical possibility for some
> possible future version of MPS.

Why is all this order important, can you elaborate?  Neither MPS nor
we can rely on the order in which the generated code does this stuff,
AFAIU.



reply via email to

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