Re: [Sablevm-developer] Off topic (probably)
Brought to you by:
egagnon
From: Etienne M. G. <eti...@uq...> - 2001-09-20 20:14:10
|
Ian Rogers wrote: >>>My new problems are caused by the way my JVM works. I run class >>>initialisers as soon as a bytecode is executed that references the >>>uninitialised class. >>> >>Mine is even more eager than that; it initializes a class when it >>prepares a method that contains bytecode referencing it. >> > > I'm unclear on the specification here. I believe the Java spec's policy > is to be lazy and being eager will cause classes to be initialised in > the wrong order. I believe this will cause classpath to initialise > incorrectly. However, I think this dependence on loading order is > hazardous. It should at least be kept to a minimum. You are right; I was thinking about "linking". Eager linking is allowed based on section 2.17.1 of the JVM spec (2nd ed.). On page 47, you can read: "The resolution step is optional at the time of initial linkage..." On the other hand, 2.17.4 specifies clearly (as you stated) that initialization happens "immediately" before certain things. I'll have to double-check my VM semantics there. >>This is not that "wrong", as long as Runtime is in a good enough state. >>Often, initialization is simply setting variables that are not used by >>the "early" executed method (here: loadLibrary). >> > > I have subsequently found that Runtime isn't in a good enough state. The > patch fixes this problem. My restriction is too strict, I will remove it > when I have a chance to hack at a substantial subsystem of my VM. > I know the feeling. This is what I am in the process of finishing... > [snip] > > Sorry, I'm working late and need to get some tea. I'll reply to anything > else tommorow. Sleep well. Have a good night! Etienne -- Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |