[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?
From: |
Andrea Corallo |
Subject: |
bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations? |
Date: |
Wed, 08 Jul 2020 19:14:43 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Mattias Engdegård <mattiase@acm.org> writes:
> +(defun byte-optimize--substitutable-p (expr)
> + "Whether EXPR is a constant that can be propagated."
> + ;; Only consider numbers, symbols and strings to be values for substitution
> + ;; purposes. Numbers and symbols are immutable, and mutating string
> + ;; literals (or results from constant-evaluated string-returning functions)
> + ;; can be considered undefined.
> + ;; (What about other quoted values, like conses?)
> + (or (booleanp expr)
> + (numberp expr)
> + (stringp expr)
> + (and (consp expr)
> + (eq (car expr) 'quote)
> + (symbolp (cadr expr)))
> + (keywordp expr)))
Hi Mattias,
in the branch I'm working I've a function similar in scope to this so
reading your patch this got my attention.
In my version I assumed (after a look to the manual) to have strings to
be immutable only at speed 3. Is it safe to assume this always instead?
Also I wanted ask why symbols are not included but only keywords, is
this to respect the side effect of interning them or something else?
Thanks!
Andrea
--
akrl@sdf.org
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, (continued)
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Stefan Monnier, 2020/07/04
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/04
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/05
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/05
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/06
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/06
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/07
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?,
Andrea Corallo <=
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/08
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/08
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Stefan Monnier, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Stefan Monnier, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Paul Eggert, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Andrea Corallo, 2020/07/09
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Mattias Engdegård, 2020/07/05
- bug#42147: 28.0.50; pure vs side-effect-free, missing optimizations?, Paul Eggert, 2020/07/03