From 429aa3c3c58d93c3897fafc98d9b44ddc271e0d6 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 1 Jul 2022 08:29:57 -0700 Subject: Add update conversion. Now variables can't be updated after they're created, so they can be freely copied into closures. --- csc/ir2.csc | 104 ++++++++++++++++++++++++++++-------------------------------- 1 file changed, 49 insertions(+), 55 deletions(-) (limited to 'csc/ir2.csc') diff --git a/csc/ir2.csc b/csc/ir2.csc index 40109fe..7aea0a3 100644 --- a/csc/ir2.csc +++ b/csc/ir2.csc @@ -1,5 +1,10 @@ (define-library (csc ir2) (export + %apply + %branch + %closure + %fix + %primitive apply-arguments apply-procedure apply? @@ -37,10 +42,12 @@ make-kargs make-klabel make-ktail - make-update - update-atom - update-continuation - update-ref + make-primitive + primitive-arguments + primitive-continuation + primitive-operation + primitive-results + primitive? ; Re-exports from IR1. constant-expression @@ -80,7 +87,8 @@ loop return) (only (csc match) - define-match-record-type)) + define-match-record-type + match)) (begin ; This library defines the intermediate representation IR2. ; It's CPS time bitch. @@ -92,26 +100,6 @@ ; - constant, ; - lexical-ref, ; - or library-ref - ; After closure conversion, lexical refs are no longer allowed. - ; Lexical refs are converted to one of the below data types. - - - ; A variable representing the address of a function in the same compilation - ; unit. This will be a constant after linking. - (define-match-record-type