classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: String/Hashtable boostrapping (again)


From: Patrick Doyle
Subject: Re: String/Hashtable boostrapping (again)
Date: Sun, 15 Jul 2001 23:10:23 -0400 (EDT)

On 15 Jul 2001, Brian Jones wrote:

> Patrick Doyle <address@hidden> writes:
> 
> > As classpath stands, I can't see any way to do this correctly.  Am I
> > missing it?  What is the sequence of events which causes these things to
> > be initialized properly?
> > 
> > Then, assuming there is such a correct sequence, doesn't this code still
> > seem somewhat obscure?  Should it be rewritten so as not to rely so
> > heavily on Java's precise initialization semantics, just for clarity?
> 
> Patrick,
> 
> There are at least two VMs using Classpath today (or variation
> thereof) and they have managed to resolve this issue in some way.  I
> would say yes let's change it so you can avoid this problem with
> String and Hashtable, but maybe this same thing happens
> elsewhere... and so on. 

Well, if this kind of cyclic initialization dependency exists, it would
probably be good to be aware of it, and at least make sure it's going to
work, if not rewrite it to do away with the circularity (perhaps with some
sort of two-phase initialization).

Anyway, if it turns out to be simply a matter of the JVM implementing the
initialization semantics properly, then I suppose the Classpath code
should be left alone, because it is already correct (well, at least
heavily tested), and changes are only going to introduce bugs.

> Maybe you could hash out the mechanics of how the other VMs handle
> this on our list if those from SableVM and ORP would like to
> contribute information.

I take it that SableVM has a "startup" mode during which is uses a special
"intern" method.  Then, when the necessary classes (like String and
Hashtable) are finished initializing, SableVM runs all the interned
strings through String.intern to get them included in the proper
Hashtable.

If ORP and the rest do a similar trick, essentially bypassing Classpath's
initialization code by special-casing it, then it makes one wonder why
Classpath's code is there at all.  :-)


BTW, after hacking and slashing through Classpath, I managed to run Hello
World on my JVM for the first time on Friday.  Then, I ran the SPECjvm98
201_compress benchmark yesterday.  (I'd rather not mention what the
runtime was... :-)  Thanks very much to the Classpath developers, and to
everyone else who helped me out.

--
Patrick Doyle
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]