[PATCH] further optimization for call-with-values

Per Bothner per@bothner.com
Fri Mar 27 04:41:00 GMT 2015



On 03/25/2015 04:12 PM, Jamison Hope wrote:
> The attached patch optimizes the call-with-values case where the
> consumer is a single-argument procedure to rewrite
> (call-with-values producer consumer) as (consumer (producer)).

Thanks - I checked this in.

> It works when the consumer is a LambdaExp and also when it is
> a ReferenceExp whose value is (known to be) a Procedure.

You "missed" one case: Where the consumer is a ReferenceExp
that is bound to a LambdaExp - i.e. when the consumer is a named
procedure that hasn't been compiled yet.  I tweaked your patch
to handle this.

I also added a test testsuite/values2.scm, and added it
to the check-inlining test to make sure it is optimized and
stays optimized.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/



More information about the Kawa mailing list