This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: implementing escape analysis
On Thu, 2006-02-16 at 09:44 -0800, David Daney wrote:
> Andrew Haley wrote:
> > Diego Novillo writes:
> > > Andrew Haley wrote:
> > >
> > > > http://www.research.ibm.com/people/g/gupta/escape.ps
> > > >
> > > > But I probably wouldn't recommend you to do it in a gcj-specific way.
> > > > gcj is merely the Java language front-end for gcc, and there may be a
> > > > plan for escape analysis that will suit all gcc's languages that can
> > > > use it.
> > > >
> > > Oh, excellent. It's been in my wish list for a while. I agree with
> > > Andrew, this analysis should not be done in the individual front ends.
> Is is possible to do a conversion of a heap allocation to a stack
> allocation in a language independent manner in GCC?
Presumably there are two parts, identifying thread local variables, and
identifying method local variables. The first relies on the second.
Is there a point in looking for thread local variables in a language
independent manner. There's more than 1 thread library which could be
used in non-java, and its not clear to me that the theory extends very
well. This would point at doing it in the gcj front end (presuming that
that's a good place to remove synchronization?).
If this was done in the front end, it would require the results of the
method local analysis to be available in the front-end as well. (The
method local analysis may also have to go elsewhere). It seems other
java specific optimizations would require these results, again in the
front-end.
Its not clear to me how complicated it would be to convert heap
allocation in a language independent way.
Since the analyses seem to be required in the front-end anyway, perhaps
the easiest thing is to start by doing a front-end only job, then seeing
whether the same techniques can be applied later on. Does that sound
like a good approach?
Thanks
Paul