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
