1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

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.
This commit is contained in:
Andy Wingo 2023-09-04 10:09:53 +02:00
parent c2cba86785
commit f31819b6b1
2 changed files with 6 additions and 5 deletions

View file

@ -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)

View file

@ -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*