diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2024-02-07 22:36:37 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2024-02-07 22:36:37 -0800 |
commit | ed5672b77f5a2980872eca073608cb7bde4587e4 (patch) | |
tree | f2a551e685ebc5a83b3683119d4ffddeb9cf57b2 /stdlib/with-resources.tl | |
parent | e7a5166f6f523a6880105ad2f9c174b653feb749 (diff) | |
download | txr-ed5672b77f5a2980872eca073608cb7bde4587e4.tar.gz txr-ed5672b77f5a2980872eca073608cb7bde4587e4.tar.bz2 txr-ed5672b77f5a2980872eca073608cb7bde4587e4.zip |
compiler: implement inlining for chain expressions.
The opip syntax and its variants transforms into
chain expressions. Currently, we emit actual chain
function calls, and so all the chain arguments
that are lambda expressions have become closures.
In this commit, an inlining optimization is introduced
which turns some chain function calls into chained
expressions. The lambdas are then immediately called,
and so succumb to the lambda-eliminating optimization.
* stdlib/compiler.tl (compiler comp-fun-form): Handle
chain forms. At optimization level 6 or higher, if
the form is eligible for the transform, perform it.
(inline-chain-rec, can-inline-chain, inline-chain):
New functions.
* txr.1: Mention that *opt-level* 6 does this chain
optimization.
Diffstat (limited to 'stdlib/with-resources.tl')
0 files changed, 0 insertions, 0 deletions