implementing escape analysis

Paul Biggar
Thu Feb 16 19:58:00 GMT 2006

On Thu, 2006-02-16 at 14:06 -0500, Diego Novillo wrote:
> Andrew Haley wrote:
> > I agree that doing the job in a langauge-specific way might be a pain
> > to start with, but it seems like a better plan in the long term.
> > 
> You mean "language-independent"?  I don't think doing this work on the
> front end is a good idea.  We have fairly strong data and control flow
> analysis capabilities at the GIMPLE level.  We also have full access to
> the front end's type system, via langhooks.

There seems to be a consensus that it would be possible to do a quick
and dirty job on the front-end, but much better to do it on the
back-end. I like the idea of doing on the back-end (having changed my
mind since an hour ago). Extending this to more languages than java
would be interesting research, which is my prime motivator at this
point. The fact that many of the analyses are already implemented helps.
However, I don't have any concept of how difficult this might be.

A question that remains is whether or not it will need to be implemented
at both ends. In particular, there were questions of StringBuffer
optimizations which seem to require the data being available at the

Another question is whether, if it is to be done at the back-end,
somebody else is already working on it, in gcc. Or it may be done
before. I found this post when looking through the gcc archives:
I can't find any evidence of what came of it though.


Paul Biggar

More information about the Java mailing list