copmile-toplevel-ref and compile-toplevel-set know enough to see if we're mutating a module variable or not.
This commit is contained in:
parent
fe10bcb18c
commit
8851726a92
|
@ -491,7 +491,6 @@
|
||||||
(define (compile-toplevel-reference exp cenv target linkage)
|
(define (compile-toplevel-reference exp cenv target linkage)
|
||||||
(define prefix (ensure-prefix (list-ref cenv (ToplevelRef-depth exp))))
|
(define prefix (ensure-prefix (list-ref cenv (ToplevelRef-depth exp))))
|
||||||
(define prefix-element (list-ref (Prefix-names prefix) (ToplevelRef-pos exp)))
|
(define prefix-element (list-ref (Prefix-names prefix) (ToplevelRef-pos exp)))
|
||||||
|
|
||||||
(let ([singular-context-check (emit-singular-context linkage)])
|
(let ([singular-context-check (emit-singular-context linkage)])
|
||||||
(end-with-linkage linkage
|
(end-with-linkage linkage
|
||||||
cenv
|
cenv
|
||||||
|
@ -513,6 +512,9 @@
|
||||||
(: compile-toplevel-set (ToplevelSet CompileTimeEnvironment Target Linkage -> InstructionSequence))
|
(: compile-toplevel-set (ToplevelSet CompileTimeEnvironment Target Linkage -> InstructionSequence))
|
||||||
;; Compiles a toplevel mutation.
|
;; Compiles a toplevel mutation.
|
||||||
(define (compile-toplevel-set exp cenv target linkage)
|
(define (compile-toplevel-set exp cenv target linkage)
|
||||||
|
(define prefix (ensure-prefix (list-ref cenv (ToplevelSet-depth exp))))
|
||||||
|
(define prefix-element (list-ref (Prefix-names prefix) (ToplevelSet-pos exp)))
|
||||||
|
|
||||||
(let ([lexical-pos (make-EnvPrefixReference (ToplevelSet-depth exp)
|
(let ([lexical-pos (make-EnvPrefixReference (ToplevelSet-depth exp)
|
||||||
(ToplevelSet-pos exp))])
|
(ToplevelSet-pos exp))])
|
||||||
(let ([get-value-code
|
(let ([get-value-code
|
||||||
|
|
Loading…
Reference in New Issue
Block a user