From 81d2b24ecc75857eb705fbd1066725fdd9e606bb Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 22 Sep 2024 13:26:16 -0600 Subject: [PATCH] optimize `call/1cc`, too --- mats/cp0.ms | 3 +++ s/cp0.ss | 2 +- s/primdata.ss | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/mats/cp0.ms b/mats/cp0.ms index 3950560b2..52fe31f65 100644 --- a/mats/cp0.ms +++ b/mats/cp0.ms @@ -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) diff --git a/s/cp0.ss b/s/cp0.ss index 56bc83449..6b53747f4 100644 --- a/s/cp0.ss +++ b/s/cp0.ss @@ -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)) diff --git a/s/primdata.ss b/s/primdata.ss index ce0a6ef2a..0654dc347 100644 --- a/s/primdata.ss +++ b/s/primdata.ss @@ -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