1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Enable closure elision.

* module/language/cps/closure-conversion.scm (convert-one): Elide
  closures when possible.
This commit is contained in:
Andy Wingo 2019-06-07 16:41:19 +02:00
parent 73a769fc2b
commit 3bbdf22312

View file

@ -700,7 +700,7 @@ bound to @var{var}, and continue to @var{k}."
;; Known call, no free variables; no closure needed. If the ;; Known call, no free variables; no closure needed. If the
;; callee is well-known, elide the closure argument entirely. ;; callee is well-known, elide the closure argument entirely.
;; Otherwise pass #f. ;; Otherwise pass #f.
(if (and (intset-ref elidable label) #f) ; Disabled temporarily. (if (intset-ref elidable label)
(have-closure cps #f) (have-closure cps #f)
(with-cps cps (with-cps cps
($ (with-cps-constants ((false #f)) ($ (with-cps-constants ((false #f))
@ -847,7 +847,7 @@ bound to @var{var}, and continue to @var{k}."
(let$ term (visit-term term)) (let$ term (visit-term term))
(setk label ($kargs names vars ,term)))) (setk label ($kargs names vars ,term))))
(($ $kfun src meta self ktail kclause) (($ $kfun src meta self ktail kclause)
(if (and (intset-ref elidable label) #f) (if (intset-ref elidable label)
(with-cps cps (with-cps cps
(setk label ($kfun src meta #f ktail kclause))) (setk label ($kfun src meta #f ktail kclause)))
cps)) cps))