call-with-values can make fewer closures
* module/language/tree-il.scm: Rename let-exp and letrec-exp to let-body
and letrec-body. Add <let-values>, a one-expression let-values that
should avoid the needless creation of two closures in many common
multiple-value cases. We'll need to add an optimization pass to the
compiler to produce this form, though, as well as rewriting lambdas
into lets, etc.
I added this form instead of adding more special cases to the
call-with-values compile code because it's a useful intermediate form
-- it will allow the optimizer to perform constant folding across more
code.
* module/language/tree-il.scm (parse-tree-il, unparse-tree-il)
(tree-il->scheme, post-order!, pre-order!): Adapt to let/letrec body
renaming, and let-values.
* module/language/tree-il/analyze.scm (analyze-lexicals): Adapt for
renaming, and add cases for let-values.
* module/language/tree-il/compile-glil.scm (flatten): Add a new context,
`vals', used by let-values code for the values producer. Code that
produces multiple values can then jump to the let-values MV return
address directly, instead of trampolining into a procedure. Add code to
compile let-values.