diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-05-02 22:25:05 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-05-02 22:25:05 -0700 |
commit | 983d325544b6c587beea0206ac46d6d12dcdb1ff (patch) | |
tree | 4f3bc3ab918437136e445516ac18d34091f89e06 /share | |
parent | f2f8a4d7738988533bca6687e94b561dd73f5e93 (diff) | |
download | txr-983d325544b6c587beea0206ac46d6d12dcdb1ff.tar.gz txr-983d325544b6c587beea0206ac46d6d12dcdb1ff.tar.bz2 txr-983d325544b6c587beea0206ac46d6d12dcdb1ff.zip |
compiler: check constantp in load-time.
* share/txr/stdlib/compiler.tl (compiler comp-load-time-lit):
Don't hoist constant expressions into load-time, since they
already get hoisted into a D register. Otherwise we just end
up generating load-time code that moves from one D register to
another.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/compiler.tl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl index f1c4ca09..9b0c0334 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -1244,7 +1244,7 @@ (mac-param-bind form (op loaded-p exp) form (cond (loaded-p me.(compile oreg env ^(quote ,exp))) - (*load-time* me.(compile oreg env exp)) + ((or *load-time* (constantp exp)) me.(compile oreg env exp)) (t (compile-in-toplevel me (let* ((*load-time* t) (dreg me.(alloc-dreg)) |