mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-01-14 21:32:49 -08:00
Simplified the compiler for blocks, eliminating the need for temporaries.
This commit is contained in:
parent
35bceed7d8
commit
af90a24100
1 changed files with 14 additions and 22 deletions
|
|
@ -39,28 +39,20 @@
|
|||
(cmp-env-register-tag (tag-name exit) exit *cmp-env*)
|
||||
(cmp-env-register-cleanup cleanup-form *cmp-env*)
|
||||
(setf (blk-env blk) *cmp-env*)
|
||||
(c1with-saved-output (prefix postfix new-destination destination)
|
||||
(let ((body (c1translate new-destination `(progn ,@(rest args)))))
|
||||
(setf (blk-destination blk) new-destination)
|
||||
(if (plusp (var-ref blk-var))
|
||||
(progn
|
||||
(nconc prefix
|
||||
(c1bind (list blk-var))
|
||||
(c1frame-id blk-var)
|
||||
(c1frame-set blk-var exit)
|
||||
(c1set-from-values new-destination)
|
||||
(c1jmp exit)
|
||||
body
|
||||
(list exit)
|
||||
(c1set-loc destination new-destination)
|
||||
(c1unbind (list blk-var))
|
||||
cleanup-form
|
||||
postfix))
|
||||
(nconc prefix
|
||||
body
|
||||
(list exit)
|
||||
(c1set-loc destination new-destination)
|
||||
postfix)))))))
|
||||
(let ((body (c1translate destination `(progn ,@(rest args)))))
|
||||
(setf (blk-destination blk) destination)
|
||||
(if (plusp (var-ref blk-var))
|
||||
(nconc (c1bind (list blk-var))
|
||||
(c1frame-id blk-var)
|
||||
(c1frame-set blk-var exit)
|
||||
(c1set-from-values destination)
|
||||
(c1jmp exit)
|
||||
body
|
||||
(list exit)
|
||||
(c1unbind (list blk-var))
|
||||
cleanup-form)
|
||||
(nconc body
|
||||
(list exit)))))))
|
||||
|
||||
(defun c1return-from (destination args)
|
||||
(check-args-number 'RETURN-FROM args 1 2)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue