1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

$throw is a new kind of CPS term

* module/language/cps.scm ($throw): New term type that doesn't have a
  continuation.  Adapt all callers.  Remove now-unneeded
  "prune-bailouts" pass.
This commit is contained in:
Andy Wingo 2018-01-03 18:25:42 +01:00
parent de5c81b1d1
commit ad55ee83c3
26 changed files with 145 additions and 148 deletions

View file

@ -98,14 +98,12 @@
(build-term
($continue k src ($primcall 'builtin-ref idx ())))))
(define (reify-clause cps ktail)
(define (reify-clause cps)
(with-cps cps
(let$ body
(with-cps-constants ((wna 'wrong-number-of-args)
(args '(#f "Wrong number of arguments" () #f)))
(build-term
($continue ktail #f
($primcall 'throw #f (wna args))))))
(build-term ($throw #f 'throw #f (wna args)))))
(letk kbody ($kargs () () ,body))
(letk kclause ($kclause ('() '() #f '() #f) kbody #f))
kclause))
@ -233,7 +231,7 @@
(match cont
(($ $kfun src meta self tail #f)
(with-cps cps
(let$ clause (reify-clause tail))
(let$ clause (reify-clause))
(setk label ($kfun src meta self tail clause))))
(($ $kargs names vars ($ $continue k src ($ $prim name)))
(with-cps cps