Updated: 3/13/2003; 2:19:47 PM.
IKVM.NET Weblog
The development of a Java VM for .NET
        

Thursday, June 27, 2002
This weblog has moved to http://weblog.ikvm.net/

"Hello, world!" now runs without first having to process the entire transitive closure of classes. It turns out that there is (what I feel) a bug in ModuleBuilder.GetType(string). It can be used to construct array types for types that have not yet been finished, but whenever you do that, it does fire the AppDomain.TypeResolveEvent, which caused me to finish the type (which wouldn't work because it was already in the process of being finished). Fortunately, it's easy to workaround, by setting a flag to ignore the TypeResolveEvent while inside ModuleBuilder.GetType().

Running "Hello, world!" takes slightly less than 2 seconds. So startup performance could be better ;-)


1:33:14 PM    Comments
This weblog has moved to http://weblog.ikvm.net/

I removed the << from the title of the blog, because of Radio's problems with them.
12:24:12 PM    Comments
This weblog has moved to http://weblog.ikvm.net/

Hello, world!

It's running! Those who have ever implemented a JVM know that running "Hello, World!" requires a very large percentage of the VM to be up and running, so I'm very happy to have reached this point.

If anyone wants to see the results for themselves, a zip file containing the executable and two dlls is available here.

The full project is available here.

There are still many things todo (in no particular order):

  • Implement jumping into and out of try blocks (run peverify on hello.exe to see what I mean ;-))
  • A few missing bytecodes need to be implemented
  • CLR exceptions need to be mapped to Java exceptions
  • Exceptions should retain their stacktraces even though they are thrown again
  • Many classpath native methods have to be implemented
  • Many JNI methods need to be implemented
  • Figure out how to deal with final fields (CLR initonly is not the same as Java's final. In Java a class is allowed to change a final field (although most JITs don't support that))
  • Figure out a way to make sure that generated types are finished in the proper order, to avoid deadlock. This is a major problem now, if I don't save the dynamic assembly before starting to execute the main method, the loading of classes deadlocks.
  • Many things I haven't even discovered yet ;-)

11:39:22 AM    Comments

© Copyright 2003 Jeroen Frijters.
 
June 2002
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30            
May   Jul