1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 19:50:24 +02:00

wire through the existing vm ops for variable-ref and variable-set!

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Compile
  variable-ref and variable-set instructions specially.

* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*): Add cases for variable-ref and
  variable-set!. The latter is a little tricky, because the args are
  switched for the VM op, and we can't really change that easily.
This commit is contained in:
Andy Wingo 2009-11-30 22:16:59 +01:00
parent 156d6fa1b5
commit 1d30393fbf
2 changed files with 9 additions and 0 deletions

View file

@ -112,6 +112,9 @@
((@slot-set! . 3) . slot-set)
((vector-ref . 2) . vector-ref)
((vector-set! . 3) . vector-set)
((variable-ref . 1) . variable-ref)
;; nb, *not* variable-set! -- the args are switched
((variable-set . 2) . variable-set)
;; hack for javascript
((return . 1) return)

View file

@ -53,6 +53,8 @@
cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
vector-ref vector-set!
variable-ref variable-set!
;; args of variable-set are switched; it needs special help
bytevector-u8-ref bytevector-u8-set!
bytevector-s8-ref bytevector-s8-set!
@ -291,3 +293,7 @@
(@call-with-current-continuation proc))
(define-primitive-expander values (x) x)
;; swap args
(define-primitive-expander variable-set! (var val)
(variable-set val var))