diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-07-26 06:53:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-07-26 06:53:34 -0700 |
commit | 2939e92c0991ddcd90dfde57b05bd2b09bf058fc (patch) | |
tree | 934d6a4272985d96913fed03943a9107cbfbc175 /stdlib/optimize.tl | |
parent | 5d8d7480614be7c945e85baac1079fd49e4ca452 (diff) | |
download | txr-2939e92c0991ddcd90dfde57b05bd2b09bf058fc.tar.gz txr-2939e92c0991ddcd90dfde57b05bd2b09bf058fc.tar.bz2 txr-2939e92c0991ddcd90dfde57b05bd2b09bf058fc.zip |
compiler: compress symbol tables also.
When functions are optimized away due to constant folding,
instead of replacing them with a nil, we now compact the
table to close the gaps and renumber the references in the
code.
* stdlib/compiler.tl (compiler null-stab): Method removed.
(compiler compact-dregs): Renamed to compact-dregs-and-syms.
Now compacts the symbol table also. This is combined with
D-reg compacting because it makes just two passes through
the instruction: a pass to identify the used D registers
and symbol indices, and then another pass to edit the
instructions with the renamed D registers and renumbered
symbol indices.
(compiler optimize): Remove the call to the null-unused-data
on the basic-blocks object; nulling out D regs and symbol
table entries is no longer required. Fllow the rename of
compact-dregs to compact-dregs-and-syms which is called
the same way otherwise.
* stdlib/optimize.tl (basic-blocks null-unused-data):
No longer used method removed.
Diffstat (limited to 'stdlib/optimize.tl')
-rw-r--r-- | stdlib/optimize.tl | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/stdlib/optimize.tl b/stdlib/optimize.tl index 49a8259e..908b7e0d 100644 --- a/stdlib/optimize.tl +++ b/stdlib/optimize.tl @@ -797,15 +797,6 @@ (each ((cl clist)) cl.(apply-treg-compacting-map map)))))) -(defmeth basic-blocks null-unused-data (bb) - (let ((used-funs 0) - (co bb.compiler)) - (each ((bl bb.list)) - (each ((insn bl.insns)) - (if-match (@(or gcall gapply getf getlx setlx) @nil @fn . @nil) insn - (set-mask used-funs (mask fn))))) - co.(null-stab used-funs))) - (defun rewrite (fun list) (build (while* list |