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

compile-assembly: make-meta refactor

* module/language/glil/compile-assembly.scm (make-meta): Avoid going
  through the compiler.
This commit is contained in:
Andy Wingo 2011-05-08 16:13:41 +02:00
parent 55fb5058a8
commit 6994fa9fef

View file

@ -94,16 +94,16 @@
(else
(lp (cdr in) out filename)))))))
;; Avoid going through the compiler so as to avoid adding to the
;; constant store.
(define (make-meta bindings sources arities tail)
;; sounds silly, but the only case in which we have no arities is when
;; compiling a meta procedure.
(if (and (null? bindings) (null? sources) (null? arities) (null? tail))
#f
(compile-assembly
(make-glil-program '()
(list
(make-glil-const `(,bindings ,sources ,arities ,@tail))
(make-glil-call 'return 1))))))
(let ((body `(,@(dump-object `(,bindings ,sources ,arities ,@tail) 0)
(return))))
`(load-program ()
,(addr+ 0 body)
#f
,@body)))
;; A functional stack of names of live variables.
(define (make-open-binding name boxed? index)