This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: class initialization check overhead
Kresten Krab Thorup <krab@trifork.com> writes:
> Effectively, all <clinit> *must* run lazily, i.e. at the latest possible
Yes, this would be a "use-at-your-own-risk" optimization, like
-fno-store-check. Still, it would be pretty safe.
> The reason for this is that <clinit>'s may depend on one another, so
> it it not until runtime it can be determined if there are cyclic
> problems, and how they should be resolved...
Hrm, shouldn't this be determinable at link time? Of course the
linker doesn't understand Java and probably shouldn't. But it should
still be possible to delay it until program initialization time, thus
eliminating the need for the call at the beginning of every static
method.
- a
--
"Through your rags I see your vanity" -- Socrates