summaryrefslogtreecommitdiff
path: root/module/language/tree-il
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2023-09-04 10:09:53 +0200
committerAndy Wingo <wingo@pobox.com>2023-09-04 10:09:53 +0200
commitf31819b6b179429a617c8bd881dbb61219823e39 (patch)
tree6f60aa86e7c7d92a45e72f162b8f421b96e1a640 /module/language/tree-il
parentc2cba86785a34351788f52ea4fccf9f10f3a1dee (diff)
downloadguile-f31819b6b179429a617c8bd881dbb61219823e39.tar.gz
Recognize `make-variable' as primitive
* module/language/tree-il/primitives.scm (*interesting-primitive-names*): (*primitive-constructors*): (*effect+exception-free-primitives*): Add make-variable. * module/language/tree-il/cps-primitives.scm (make-variable): Lower as `box' primitive.
Diffstat (limited to 'module/language/tree-il')
-rw-r--r--module/language/tree-il/cps-primitives.scm4
-rw-r--r--module/language/tree-il/primitives.scm7
2 files changed, 6 insertions, 5 deletions
diff --git a/module/language/tree-il/cps-primitives.scm b/module/language/tree-il/cps-primitives.scm
index 196461904..ab16653ae 100644
--- a/module/language/tree-il/cps-primitives.scm
+++ b/module/language/tree-il/cps-primitives.scm
@@ -1,6 +1,6 @@
;;; Continuation-passing style (CPS) intermediate language (IL)
-;; Copyright (C) 2013-2015, 2017-2020 Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015, 2017-2020, 2023 Free Software Foundation, Inc.
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -45,7 +45,7 @@
(define (tree-il-primitive->cps-primitive+nargs+nvalues name)
(hashq-ref *primitives* name))
-(define-cps-primitive box 1 1)
+(define-cps-primitive (make-variable box) 1 1)
(define-cps-primitive (variable-ref box-ref) 1 1)
(define-cps-primitive (variable-set! box-set!) 2 0)
(define-cps-primitive (%variable-ref %box-ref) 1 1)
diff --git a/module/language/tree-il/primitives.scm b/module/language/tree-il/primitives.scm
index bcd2a1c05..3ddfb0fbc 100644
--- a/module/language/tree-il/primitives.scm
+++ b/module/language/tree-il/primitives.scm
@@ -84,7 +84,7 @@
length
make-vector vector-length vector-ref vector-set!
- variable? variable-ref variable-set!
+ variable? make-variable variable-ref variable-set!
variable-bound?
current-module define!
@@ -145,7 +145,8 @@
;; Primitives that return a fresh object.
'(acons cons cons* list vector make-vector
make-struct/simple
- make-prompt-tag))
+ make-prompt-tag
+ make-variable))
(define *primitive-accessors*
;; Primitives that are pure, but whose result depends on the mutable
@@ -205,7 +206,7 @@
exact-integer?
bytevector? keyword? bitvector?
procedure? thunk? atomic-box?
- acons cons cons* list vector))
+ acons cons cons* list vector make-variable))
;; Primitives that don't always return one value.
(define *multiply-valued-primitives*