mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-21 12:10:26 +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:
parent
156d6fa1b5
commit
1d30393fbf
2 changed files with 9 additions and 0 deletions
|
@ -112,6 +112,9 @@
|
||||||
((@slot-set! . 3) . slot-set)
|
((@slot-set! . 3) . slot-set)
|
||||||
((vector-ref . 2) . vector-ref)
|
((vector-ref . 2) . vector-ref)
|
||||||
((vector-set! . 3) . vector-set)
|
((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
|
;; hack for javascript
|
||||||
((return . 1) return)
|
((return . 1) return)
|
||||||
|
|
|
@ -53,6 +53,8 @@
|
||||||
cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
|
cdaaar cdaadr cdadar cdaddr cddaar cddadr cdddar cddddr
|
||||||
|
|
||||||
vector-ref vector-set!
|
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-u8-ref bytevector-u8-set!
|
||||||
bytevector-s8-ref bytevector-s8-set!
|
bytevector-s8-ref bytevector-s8-set!
|
||||||
|
@ -291,3 +293,7 @@
|
||||||
(@call-with-current-continuation proc))
|
(@call-with-current-continuation proc))
|
||||||
|
|
||||||
(define-primitive-expander values (x) x)
|
(define-primitive-expander values (x) x)
|
||||||
|
|
||||||
|
;; swap args
|
||||||
|
(define-primitive-expander variable-set! (var val)
|
||||||
|
(variable-set val var))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue