* module/ice-9/eval.scm (primitive-eval): Only lazily compile box-ref on
toplevel variables; otherwise compile eagerly to avoid the
indirection.
'()
(cons ((car args) env) (lp (cdr args)))))))))))))
'()
(cons ((car args) env) (lp (cdr args)))))))))))))
- (define (compile-box-ref cenv box)
+ (define (compile-box-ref box)
(match box
((,(typecode resolve) . loc)
(match box
((,(typecode resolve) . loc)
- (let ((var (%resolve-variable loc (env-toplevel cenv))))
- (lambda (env) (variable-ref var))))
+ (lazy (cenv)
+ (let ((var (%resolve-variable loc (env-toplevel cenv))))
+ (lambda (env) (variable-ref var)))))
((,(typecode lexical-ref) depth . width)
(lambda (env)
(variable-ref (env-ref env depth width))))
((,(typecode lexical-ref) depth . width)
(lambda (env)
(variable-ref (env-ref env depth width))))
(compile-call f args))
((,(typecode box-ref) . box)
(compile-call f args))
((,(typecode box-ref) . box)
- (lazy (env) (compile-box-ref env box)))
((,(typecode resolve) . loc)
(lazy (env) (compile-resolve env loc)))
((,(typecode resolve) . loc)
(lazy (env) (compile-resolve env loc)))