This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Eager vs Lazy resolution of classes
Andrew Haley wrote:
Bryce McKinlay writes:
> Chris Gray wrote:
> >IMO any code that relies on this behaviour is broken. If that means that some
> >Eclipse 2.x versions were broken and Eclipse 3 is not, then that shows that
> >the Eclipse guys are learning as they go along.
> >
> >
> I agree. I think we could actually support this stuff with the
> BC-ABI, but we'd have to jump through some hoops to do it. As
> Andrew suggests, it is something that could be added later, if it
> proves neccessary, provided we don't do anything to preclude it.
It would be fairly easy to support lazy resolution by generating
accessor methods for static data members and using these instead of
getting the addresses directly. All you have to do is create a libffi
thunk that, when called, does the resolution.
Actually, I don't think it would be neccessary to do that. Since access
to a static class field requires a class initialization check to be
inserted anyway, we'd just need to add hooks to the class linker to
update the appropriate otable/atable entries in classes that depend on
it. This would work by putting unlinked java.lang.Class "placeholders"
in the indirect dispatch tables, and having them resolved when an
attempt is made to initialize them.
Regards
Bryce