[bitc-dev] Re: Closure Conversion
Jonathan S. Shapiro
shap at eros-os.org
Sat Jul 9 12:41:51 EDT 2005
On Fri, 2005-07-08 at 16:34 -0400, Swaroop Sridhar wrote:
> Cases like:
>
> (define F (lambda (x) ((lambda (y) x) 2)))
>
> are easy. The inner-lambda's closure can be safely stack allocated.
>
> But consider:
> (define G (lambda (f) (let ((p 3)) (f (lambda (x) p)))))
>
> the inner lambda is apparently not escaping downward. But it is not
> clear whether its closure can be stack allocated or not.
>
> i) Escaping will come to mean escaping upwards or downwards, and most
> lambdas will have their closures heap allocated
I think that the escape analysis indeed is not trivial, but I don't have
a simple answer for you at the moment. I agree that we need to think
about this.
Ask MarkM for Jonathan Rees's email address and ask him about this --
this a richly explored area and we probably don't need to do any
invention.
shap
More information about the bitc-dev
mailing list