[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, wip-on-demand, created. v2.0.2-150-gf4
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, wip-on-demand, created. v2.0.2-150-gf4e213d |
Date: |
Fri, 07 Oct 2011 23:55:49 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=f4e213df723f6dc31c8769a3e9eec9f942a5104c
The branch, wip-on-demand has been created
at f4e213df723f6dc31c8769a3e9eec9f942a5104c (commit)
- Log -----------------------------------------------------------------
commit f4e213df723f6dc31c8769a3e9eec9f942a5104c
Author: Andy Wingo <address@hidden>
Date: Sat Oct 8 01:49:36 2011 +0200
peval: visit operands on-demand, to inline mutually recursive bindings
This commit changes to use <operand> structures to hold the context
needed to visit lexical bindings lazily, in context, instead of eagerly
visiting them for value. This laziness enables inlining of mutually
recursive bindings.
On the meta-level, I agree that it is important to have comments in the
"residual code", but commit logs are to help in proving that changes
preserve correctness, so this commit is particularly verbose. I'm not
sure what should make it into the comments, but surely not all of this.
* module/language/tree-il/peval.scm (<var>): Remove comment about copy
propagation having to run build-var-table; things don't work like that
any more.
(build-var-table): Build <var> entries for all variables, even
unreferenced variables.
(alpha-rename): Remove. We will rename bindings on-demand now.
(peval lookup-var): New helper, to fetch the <var> of a gensym.
(peval fresh-gensyms): Fold here, under peval, and in it, handle
updating the store to record a mapping between new names and <var>
entries from the source program.
(peval record-source-expression): Don't call build-var-table on the
new expression, as alpha-renaming happens on-demand now.
(peval prune-bindings): Rewrite to work with mutually-recursive
bindings.
(peval extend-env): New helper.
(peval loop): OK, here goes... Remove the `operand' context, as now we
visit operands lazily. Add a `call' context, which does not
copy-propagate lambda expressions, used to residualize a call after
aborting an inlining attempt. Change the `env' to be a mapping of
gensym to <operand>. Instead of looking up the operand's binding then
alpha-renaming it, just rely on the fact that visiting the operand
will rename it if necessary.
If we residualize a lexical, do so with the fresh name from the
environment.
For let, letrec, fix, and lambda-case, instead of visiting the
bindings eagerly for value, simply record the source expressions and
environments in an <operand> and rely on copy-propagation to visit
them later in the right context. In the case of letrec and fix, this
allows mutually-recursive bindings to be inlined.
For applications, if we have to abort, process the procedure in call
context, which allows some folding but avoids inlining.
For lambdas, if we are processing for value, record the source
expression so we can detect recursion. This was previously done in
the lexical-ref copy propagator.
* test-suite/tests/tree-il.test ("partial evaluation"): Remove unused
recursive lexicals in a couple of cases. Add a couple test cases for
pruning.
In what is probably a bug, reduce the number of loops to unroll in
some cases, as the new evaluator is taking too long.
commit bd34459ef6bce2bffe882f551945e866dde397c1
Author: Andy Wingo <address@hidden>
Date: Thu Oct 6 10:56:12 2011 +0200
peval: add operand structure
* module/language/tree-il/peval.scm (<operand>): Add operand structure,
to be used by peval.
-----------------------------------------------------------------------
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, wip-on-demand, created. v2.0.2-150-gf4e213d,
Andy Wingo <=