1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +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

@ -205,7 +205,9 @@ disjoint, an error will be signalled."
(($ $branch kf kt)
(visit-cont kf (visit-cont kt labels)))
(($ $prompt k kh)
(visit-cont k (visit-cont kh labels))))))))))))
(visit-cont k (visit-cont kh labels)))
(($ $throw)
labels))))))))))
(define* (compute-reachable-functions conts #:optional (kfun 0))
"Compute a mapping LABEL->LABEL..., where each key is a reachable
@ -262,7 +264,8 @@ intset."
(match term
(($ $continue k) (propagate1 k))
(($ $branch kf kt) (propagate2 kf kt))
(($ $prompt k kh) (propagate2 k kh))))
(($ $prompt k kh) (propagate2 k kh))
(($ $throw) (propagate0))))
(($ $kreceive arity k)
(propagate1 k))
(($ $kfun src meta self tail clause)
@ -296,7 +299,8 @@ intset."
(match term
(($ $continue k) (add-pred k preds))
(($ $branch kf kt) (add-pred kf (add-pred kt preds)))
(($ $prompt k kh) (add-pred k (add-pred kh preds)))))))
(($ $prompt k kh) (add-pred k (add-pred kh preds)))
(($ $throw) preds)))))
(persistent-intmap
(intset-fold add-preds labels
(intset->intmap (lambda (label) '()) labels))))