[Top][All Lists]

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

Re: How does nativecomp compile circular lists?

From: Andrea Corallo
Subject: Re: How does nativecomp compile circular lists?
Date: Tue, 27 Jul 2021 09:28:50 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jimmy Yuen Ho Wong <wyuenho@gmail.com> writes:

> I'm not exactly sure how to even ask this question, as I've seen various 
> packages fail to natively compile circular lists
> or optimize it wrongly. So I've come up with a simple test case for me to be 
> able to disassemble the bytecode and the
> native code, and see if I could spot the problem, but disassembling natively 
> compiled code doesn't seem to work.
> Test case:
> (defun test-circular-list ()
>   (let ((l (list 1 2 3)))
>     (setcdr (last l) l)
>     l))
> (print (test-circular-list))
> (provide 'test-circular-list)
> M-x emacs-lisp-byte-compile-and-load
> M-x disassemble RET test-circular-list (works)
> M-x emacs-lisp-native-compile-and-load
> M-x disassemble RET test-circular-list (doesn't work)
> Debugger entered--Lisp error: (search-failed 
> "^.*<F746573742d63697263756c61722d6c697374_test_cir...")
>   re-search-forward("^.*<F746573742d63697263756c61722d6c697374_test_cir...")
>   disassemble-internal(test-circular-list 0 nil)
>   disassemble(test-circular-list nil 0 t)
>   funcall-interactively(disassemble test-circular-list nil 0 t)
>   command-execute(disassemble record)
>   execute-extended-command(nil "disassemble" nil)
>   funcall-interactively(execute-extended-command nil "disassemble" nil)
>   command-execute(execute-extended-command)
> Furthermore, this test case, though superficially similar, doesn't seem to be 
> able to reproduce the same failure to
> natively compile issue as seen in powerline.
> There seems to be more than one thing wrong with this journey into my deep 
> dive into how native compiling circular lists
> work.
> Jimmy Yuen Ho Wong

Hi Jimmy,

I'm failing to reproduce this issue.

Disassembling following your instructions works here. Also the compiled
`test-circular-list' function as expected here.

Am I missing something?

Best Regards


reply via email to

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