diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-02-11 01:27:44 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-02-11 01:27:44 -0800 |
commit | 512fa869e31d3fde5eb9422a5ed46e3fec58c94a (patch) | |
tree | c75c916943bd5a23ef22870144a41c2a3994a95b /checkman.txr | |
parent | 4e32c77f590b5191d488da142d3009522f0127ba (diff) | |
download | txr-512fa869e31d3fde5eb9422a5ed46e3fec58c94a.tar.gz txr-512fa869e31d3fde5eb9422a5ed46e3fec58c94a.tar.bz2 txr-512fa869e31d3fde5eb9422a5ed46e3fec58c94a.zip |
compiler: frame-eliminating optimization.
This optimization identifies let blocks whose variables are
not captured by closures. The variables are relocated to
registers and the frame M N ... end reg wrapping is removed.
* parser.c (read_file_common): Load version 6 files.
We remain backwards-compatible.
* share/txr/stdlib/compiler.tl (var-spy, capture-var-spy): New
structure types.
(struct compiler): New slot, var-spies.
(with-var-spy): New macro.
(compiler (alloc-new-treg, unalloc-reg-count, push-var-spy,
pop-var-spy)): New methods.
(compiler (comp-atom, compt-setq, comp-list-setq,
comp-lisp1-value)): Inform the spies in the spy notification
stack about assignments and accesses.
(compiler eliminate-frame): New method.
(compiler comp-let): Use spies to determine which variables
from this frame are captured, and if none are, then use
eliminate-frame to rename all the variables to t-registers and
drop the frame setup/teardown.
(compiler comp-lambda): Set up a capture-var-spy which
intercepts accesses and assignments within a lambda, and
informs other spies about the captures.
(%tlo-ver%): Bump compiled file version to to (6 0), because
of some behavioral changes necessary in the VM. We might
revert this if the issues are solved differently.
* vm.c (vm_getz): Do not null out T registers.
(vm_execute_toplevel, vm_execute_closure): Use zalloca to
allocate the register part of the frame, so T registers are
initialized to nil.
Diffstat (limited to 'checkman.txr')
0 files changed, 0 insertions, 0 deletions