summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-05-01 06:44:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-05-01 06:44:12 -0700
commitd1164882aa75bcf271a9bd6befcc11f4466ca2fd (patch)
tree0c4adfe964c73f5893477635dc4ebc5a3544b772
parentae064b0ecc0c699bd5e293eada2ee15dabc506be (diff)
downloadtxr-d1164882aa75bcf271a9bd6befcc11f4466ca2fd.tar.gz
txr-d1164882aa75bcf271a9bd6befcc11f4466ca2fd.tar.bz2
txr-d1164882aa75bcf271a9bd6befcc11f4466ca2fd.zip
compiler: load-time: eliminate temp register.
* share/txr/stdlib/compiler.tl (compiler comp-load-time-lit): When compiling the load-time argument expression, indicate the allocated D register as the destination, rather than using a freshly allocated T register. Now we need an instruction to move into the D reg only if the fragment chose a different register.
-rw-r--r--share/txr/stdlib/compiler.tl8
1 files changed, 3 insertions, 5 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index cd5f3150..ca86db11 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1242,16 +1242,14 @@
(if loaded-p
me.(compile oreg env ^(quote ,exp))
(compile-in-toplevel me
- (let* ((oreg me.(alloc-treg))
- (dreg me.(alloc-dreg))
- (exp me.(compile oreg (new env co me) exp))
+ (let* ((dreg me.(alloc-dreg))
+ (exp me.(compile dreg (new env co me) exp))
(lt-frag (new (frag dreg
^(,*exp.code
- (mov ,dreg ,exp.oreg))
+ ,*(maybe-mov dreg exp.oreg))
exp.fvars
exp.ffuns))))
(misleading-ref-check exp env form)
- me.(free-treg oreg)
(push lt-frag me.lt-frags)
(new (frag dreg nil)))))))