how VM is implemented in JNode

folks i want to ask one thing regarding Virtual Machine of JNode. I have read about this Operating System. Java runs using JRE( which is a actually collection of JVM and some libraries). Instead of getting interpreted, the byte code is converted into machine code using compilers that are written in C/C++.

I have the following questions here

1 ) Which compilers JNode is using? C based ? In which language those compilers are written?

2) Why you have chosen the above compiler? Does that give better performance than C ?

3) Can you name some languages that can be used to implement JVM and acheive better results than C?

4) Given your effort, why still most of the JVM's are still implemented in C ?

Regards!

Answers

1) Which compilers JNode is using? C based ? In which language those compilers are written?

We use Sun's javac compiler to compile to bytecodes, then a JNode specific compiler to compile bytecodes to native codes. Both compilers are implemented in Java.

2) Why you have chosen the above compiler? Does that give better performance than C ?

JNode is a pure Java system by design. It won't run C or C++, or any other language that doesn't compile to bytecodes. So a C native code compiler is simply not an option. AFAIK, there were no open source bytecode to native code compilers available when the JNode project started. Hence Ewout had no choice but to implement the JNode compiler from scratch.

I doubt that we are getting better performance than if we had implemented our native code compiler C, but the point is hypothetical ... and largely irrelevant, since native compiler speed won't matter much (see above), and overall system performance has never been a primary goal for the JNode project.

I suspect that compiler implementation language makes little difference to overall performance of a Java OS. If you take a Java OS that is running a typical application mix, and integrate over the system's lifetime, you are likely to find that the percentage of time spent compiling bytecode is very small. What is more important to system performance is the quality of the code generated by the native code compiler. That depends on the compilation / optimization algorithms used, not on the language they are implemented in.

3) Can you name some languages that can be used to implement JVM and acheive better results than C?

I (we) have not researched this topic.

4) Given your effort, why still most of the JVM's are still implemented in C ?

You would have to ask the implementors of the other JVMs. Smiling