This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: class initialization check overhead



Adam Megacz wrote:
Or perhaps give gcj a list of classes that you know will be referenced
eventually, and have it run those <clinit>s immediately upon startup.
You'd have to have a way to figure out the dependency tree... is there
enough information at runtime to do this?  If not, this would either
require modifications to the linker, which is probably a bad idea.


We have to be very careful in modifying the initialization code, since JLS places some very specific requirements on the order of initialization.

Effectively, all <clinit> *must* run lazily, i.e. at the latest possible time before the class is used. 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...

Kresten



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]