emacs-devel
[Top][All Lists]
Advanced

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

Re: byte-code optimizations


From: Stefan
Subject: Re: byte-code optimizations
Date: Sat, 18 Sep 2004 16:26:04 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (darwin)

> +         ;; dup varbind-X [car/cdr ...] unbind-1 --> [car/cdr ...]

I get the same optimization result by adding

        car/cdr/equal/nth unbind --> unbind car/cdr/equal/nth

Problem is that such an optimization is only safe if car/cdr/... is not
affected by the bound thing.  If the `unbind' unbinds a variable, then
I think it's always safe.  So I've added to the lapcode optimizer some logic
to keep track of the specpdl stack so that I can distinguish an unbind that
terminates a varbind from one that terminates an unwind-protect.

Better yet: you also get the exact same result code (without any lapcode
optimization) if you use

   (defsubst* cddr (x) (cdr (cdr x)))

I.e. using the `defubst*' (from CL).


        Stefan




reply via email to

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