mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-17 14:51:20 -08:00
The CONS-CDR/CAR optimization was not working fully because the interpreter did not support it and because there were macros shadowing the actual functions.
This commit is contained in:
parent
bb283c298c
commit
d4f96996e3
4 changed files with 7 additions and 11 deletions
|
|
@ -322,6 +322,8 @@ static compiler_record database[] = {
|
|||
{@'list', c_list, 1},
|
||||
{@'list*', c_listA, 1},
|
||||
{@'endp', c_endp, 1},
|
||||
{@'si::cons-car', c_car, 1},
|
||||
{@'si::cons-cdr', c_cdr, 1},
|
||||
{NULL, NULL, 1}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -275,14 +275,14 @@
|
|||
(def-inline car :unsafe (cons) t "ECL_CONS_CAR(#0)")
|
||||
(def-inline car :unsafe (t) t "CAR(#0)")
|
||||
|
||||
(def-inline cons-car :always (t) t "CAR(#0)")
|
||||
(def-inline cons-car :unsafe (t) t "ECL_CONS_CAR(#0)")
|
||||
(def-inline si::cons-car :always (t) t "CAR(#0)")
|
||||
(def-inline si::cons-car :unsafe (t) t "ECL_CONS_CAR(#0)")
|
||||
|
||||
(def-inline cdr :unsafe (cons) t "ECL_CONS_CDR(#0)")
|
||||
(def-inline cdr :unsafe (t) t "CDR(#0)")
|
||||
|
||||
(def-inline cons-cdr :always (t) t "CDR(#0)")
|
||||
(def-inline cons-cdr :unsafe (t) t "ECL_CONS_CDR(#0)")
|
||||
(def-inline si::cons-cdr :always (t) t "CDR(#0)")
|
||||
(def-inline si::cons-cdr :unsafe (t) t "ECL_CONS_CDR(#0)")
|
||||
|
||||
(def-inline caar :unsafe (t) t "CAAR(#0)")
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
(si::while %dolist-var
|
||||
(setq ,var (first %dolist-var))
|
||||
,@body
|
||||
(setq %dolist-var (rest %dolist-var)))
|
||||
(setq %dolist-var (cons-cdr %dolist-var)))
|
||||
,(when exit `(setq ,var nil))
|
||||
,@exit)))))))
|
||||
(si::fset 'dolist f t))
|
||||
|
|
|
|||
|
|
@ -147,9 +147,3 @@
|
|||
,%iterators)))
|
||||
,@(and output (list output)))
|
||||
,@body)))
|
||||
|
||||
(defmacro cons-car (x)
|
||||
`(car (the cons ,x)))
|
||||
|
||||
(defmacro cons-cdr (x)
|
||||
`(cdr (the cons ,x)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue