mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-02 21:10:27 +02:00
Only emit receive-values if it is needed
* module/language/cps/compile-bytecode.scm (compile-fun): Don't emit receive-values unless there is a minimum or maximum number of values.
This commit is contained in:
parent
7ab76a830b
commit
4dfcb36006
1 changed files with 4 additions and 2 deletions
|
@ -334,7 +334,8 @@
|
||||||
(emit-prompt asm (slot tag) escape? proc-slot receive-args)
|
(emit-prompt asm (slot tag) escape? proc-slot receive-args)
|
||||||
(emit-br asm k)
|
(emit-br asm k)
|
||||||
(emit-label asm receive-args)
|
(emit-label asm receive-args)
|
||||||
(emit-receive-values asm proc-slot (->bool rest) nreq)
|
(unless (and rest (zero? nreq))
|
||||||
|
(emit-receive-values asm proc-slot (->bool rest) nreq))
|
||||||
(when (and rest
|
(when (and rest
|
||||||
(match (vector-ref contv (cfa-k-idx cfa khandler-body))
|
(match (vector-ref contv (cfa-k-idx cfa khandler-body))
|
||||||
(($ $kargs names (_ ... rest))
|
(($ $kargs names (_ ... rest))
|
||||||
|
@ -468,7 +469,8 @@
|
||||||
;; FIXME: Only allow more values if there is a rest arg.
|
;; FIXME: Only allow more values if there is a rest arg.
|
||||||
;; Express values truncation by the presence of an
|
;; Express values truncation by the presence of an
|
||||||
;; unused rest arg instead of implicitly.
|
;; unused rest arg instead of implicitly.
|
||||||
(emit-receive-values asm proc-slot #t nreq)
|
(unless (zero? nreq)
|
||||||
|
(emit-receive-values asm proc-slot #t nreq))
|
||||||
(when (and rest-var (maybe-slot rest-var))
|
(when (and rest-var (maybe-slot rest-var))
|
||||||
(emit-bind-rest asm (+ proc-slot 1 nreq)))
|
(emit-bind-rest asm (+ proc-slot 1 nreq)))
|
||||||
(for-each (match-lambda
|
(for-each (match-lambda
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue