[Sablevm-developer] Off topic (probably)
Brought to you by:
egagnon
From: Ian R. <ir...@cs...> - 2001-09-19 18:51:57
|
Hi, hopefully this isn't too off topic and the work will help other people. > The initializer circular dependency sequence is described in details in > the JVM spec. So, you should simply implement the spec, and check > that you are getting the expected result. If not, then there's a bug;-) The actual problem was when I inserted my system properties this lead to File.<clinit> being ran which tried to use the properties I was inserting. To stop this I stopped Math.<clinit> from being ran by altering the definition of Hashtable.hash so it didn't need to use Math.abs. I believe I follow the JVM spec for loading classes very closely, although I haven't checked this rigorously. 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. I have a restriction that the bytecode that references this uninitialised class can't be executed by the static initialiser we're about to run. Unfortunately this set of circumstances happens in class/sablepath: run FileInputStream.<clinit> calls: run System.loadLibrary (java-io) --> wants Runtime.loadLibrary, Runtime uninitialised therefore: run Runtime.<clinit> calls: run Runtime.<init> calls: run File.<clinit> and oh no calls: System.loadLibrary (java-io) Obviously it should be legal in my JVM to execute System.loadLibrary in this way as there are no restrictions placed on the code from the JVM spec. However, it strikes me as wrong to be calling Runtime.loadLibrary when Runtime hasn't been statically initialised. The numerous calls to System.loadLibrary (java-io) seem excessive to me also (I can see why they're made but is there no better way?). Anyhow, I have tried pre-loading java/lang/Runtime and java/lang/System and both fail. You can't pre-load java/lang/Runtime without java/lang/System setting up the system properties. I can't pre-load java/lang/System as it leads to the same error as the one listed above. Any ideas before I remove my restriction? TIA. A simpler solution for me would be to alter the behaviour of Runtime.<init> . > I have updated the configure stuff, and merged with recent classpath > changes. Thanks for the reminder, I've subscribed to the mailing list and I believe I'm up-to-date. Cheers, Ian Rogers |