From 4dca2c5cfbbc68a76cb2b4f8ef6f4482a2dc906c Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Wed, 6 Dec 2017 13:45:24 +0100 Subject: [PATCH] Support closure annotations to scm-ref et al * module/language/cps/effects-analysis.scm (annotation->memory-kind): * module/language/cps/types.scm (annotation->type): Add pairs and closures. --- module/language/cps/effects-analysis.scm | 3 ++- module/language/cps/types.scm | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/module/language/cps/effects-analysis.scm b/module/language/cps/effects-analysis.scm index 4105bfa11..304045173 100644 --- a/module/language/cps/effects-analysis.scm +++ b/module/language/cps/effects-analysis.scm @@ -342,7 +342,8 @@ the LABELS that are clobbered by the effects of LABEL." (match annotation ('pair &pair) ('vector &vector) - ('box &box))) + ('box &box) + ('closure &closure))) (define-primitive-effects* param ((allocate-words size) (&allocate (annotation->memory-kind param))) diff --git a/module/language/cps/types.scm b/module/language/cps/types.scm index 62c9d50ed..9a1c6f208 100644 --- a/module/language/cps/types.scm +++ b/module/language/cps/types.scm @@ -712,8 +712,10 @@ minimum, and maximum." (define (annotation->type ann) ;; Expand me! (match ann + ('pair &pair) ('vector &vector) - ('box &box))) + ('box &box) + ('closure &procedure))) (define-type-inferrer/param (allocate-words param size result) (define! result (annotation->type param) (&min/0 size) (&max/scm-size size)))