summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-16 06:59:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-03-16 06:59:23 -0700
commit9cafad653dbb6b09c6ee283fb105d000e0c8c0c2 (patch)
treef2eb550bd8b30bb32a05e7689aec56ba5f4867e1
parent5e6871023c4eac56dfec7fc2b4ea56e41af72e0c (diff)
downloadtxr-9cafad653dbb6b09c6ee283fb105d000e0c8c0c2.tar.gz
txr-9cafad653dbb6b09c6ee283fb105d000e0c8c0c2.tar.bz2
txr-9cafad653dbb6b09c6ee283fb105d000e0c8c0c2.zip
compiler: trim unused accumulation from var-spy.
The var-spy structure is only being used for detecting captured variables, not assigned or accessed variables. So the information about accessed and assigned is being wastefully accumulated, never used. * share/txr/stdlib/compiler.tl (struct var-spy): Remove slots acc-vars and set-vars. (var-spy accessed, var-spy assigned): Methods become no-ops.
-rw-r--r--share/txr/stdlib/compiler.tl10
1 files changed, 2 insertions, 8 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index c3e11d94..622ac476 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -140,17 +140,11 @@
(defstruct var-spy ()
env
- acc-vars
- set-vars
cap-vars
- (:method accessed (me vbin sym)
- (when (eq vbin.env me.env)
- (pushnew sym me.acc-vars)))
+ (:method accessed (me vbin sym))
- (:method assigned (me vbin sym)
- (when (eq vbin.env me.env)
- (pushnew sym me.set-vars)))
+ (:method assigned (me vbin sym))
(:method captured (me vbin sym)
(when (eq vbin.env me.env)