recognize long form of call/cc in optimization

original commit: 05c31cd27455bce6d122188da14b4973d8a49d7a
This commit is contained in:
Matthew Flatt 2020-03-13 08:14:39 -06:00
parent 5f57648104
commit 840e5143e2

View File

@ -1728,7 +1728,8 @@
[(call ,info ,mdcl ,pr [(call ,info ,mdcl ,pr
(case-lambda ,info2 (clause (,x) ,interface ,[body (->in-get-cont mode) -> body]))) (case-lambda ,info2 (clause (,x) ,interface ,[body (->in-get-cont mode) -> body])))
(guard (and (memq mode '(tail tail/none tail/some tail/reified)) (guard (and (memq mode '(tail tail/none tail/some tail/reified))
(eq? (primref-name pr) 'call/cc) (or (eq? (primref-name pr) 'call/cc)
(eq? (primref-name pr) 'call-with-current-continuation))
(= interface 1))) (= interface 1)))
;; Since we're in tail position, we can just reify the continuation and ;; Since we're in tail position, we can just reify the continuation and
;; put the stack link in the argument variable. ;; put the stack link in the argument variable.