summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-05-02 22:25:05 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-05-02 22:25:05 -0700
commit983d325544b6c587beea0206ac46d6d12dcdb1ff (patch)
tree4f3bc3ab918437136e445516ac18d34091f89e06 /share
parentf2f8a4d7738988533bca6687e94b561dd73f5e93 (diff)
downloadtxr-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.tl2
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))