Skip to content

Commit

Permalink
optimize call/1cc, too
Browse files Browse the repository at this point in the history
  • Loading branch information
mflatt committed Sep 22, 2024
1 parent 94be53e commit e09bfd3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions mats/cp0.ms
Original file line number Diff line number Diff line change
Expand Up @@ -3540,6 +3540,9 @@
(equivalent-expansion?
(expand/optimize '(call/cc (lambda (k) 10)))
'10)
(equivalent-expansion?
(expand/optimize '(call/1cc (lambda (k) 10)))
'10)
(equivalent-expansion?
(expand/optimize '(call-with-current-continuation (lambda (k) 10)))
'10)
Expand Down
2 changes: 1 addition & 1 deletion s/cp0.ss
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@
e]))
c-val)))))])))))])

(define-inline 2 (call/cc call-with-current-continuation)
(define-inline 2 (call/cc call/1cc call-with-current-continuation)
[(body)
(nanopass-case (Lsrc Expr) (value-visit-operand! body)
[(case-lambda ,preinfo (clause (,x) ,interface ,e))
Expand Down
2 changes: 1 addition & 1 deletion s/primdata.ss
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@
(bytevector-u56-set! [sig [(bytevector sub-index u56 symbol) -> (void)]] [flags true])
(bytevector-compress [sig [(ptr) -> (ptr)]] [flags])
(bytevector-uncompress [sig [(ptr) -> (ptr)]] [flags])
(call/1cc [sig [(procedure) -> (ptr ...)]] [flags])
(call/1cc [sig [(procedure) -> (ptr ...)]] [flags cp02])
(call-in-continuation [sig [(ptr procedure) -> (ptr ...)] [(ptr continuation-marks procedure) -> (ptr ...)]] [flags])
(call-with-input-file [sig [(pathname procedure) (pathname procedure sub-ptr) -> (ptr ...)]] [flags ieee r5rs]) ; has options argument
(call-with-output-file [sig [(pathname procedure) (pathname procedure sub-ptr) -> (ptr ...)]] [flags ieee r5rs]) ; has options argument
Expand Down

0 comments on commit e09bfd3

Please sign in to comment.