Godmar Back wrote: | | > | > JIT, in general, should be faster than interpreted. However, there is | > overhead: the JIT must compile the code to begin with. If it takes longer | > for the JIT to run than you save on the code, then overall, JIT will be | > slower. That's why newer VMs such as Sun's HotSpot only JIT when they "know" | > that a method will be frequently used. | | Well, if we ever get Senthil Kumar's efforts on integrating intrp and jit, | kaffe will have that too. I would be interested in integrating intrp and jit for other reasons: - Debugging: debugging JIT is too machine-dependent, so debug intrp only, but it may call JIT methods. - Faster intrp: use the JIT engine to re-write the bytecode into a different bytecode that can be interpreted 2-4x faster. [ Re: pre-JIT ] | The not-so-weird way how this will work is by using egcs's gcj Java front-end. | Other groups (HP India) have already reported success in combining egcs- | generated code with their VMs. | | With Cygnus's run-time library being rooted in an earlier version of Kaffe | (Per Bothner used to be contributor to Kaffe), this should certainly be | possible. Tim tried it and reported partial success a few months ago. | | If anybody wanted to tackle this project, it would be very welcome. | At this point, the difficulty is that Cygnus hasn't published the interfaces | to their run-time lib yet, so you'll have to look hard at the egcs source and | at the assembly code generated by egcs to find out what they are. | Also, exception handling is done differently. But that would be a very, | very useful project. For extra credit, create documentation of the | interfaces. I see two ways that this can be done: 1. Use egcs/gcj to make native-method versions of everything, assuming that its output can conform to the JNI. 2. Make an add-on to kaffe that does JIT to produce PIC, then re-write the class files, embedding the PIC in an attribute instead of the original bytecode. The resulting class file will sit with compilers and other java tools (except for javap/javad) just fine, but only kaffe can execute it. I'd rather not delve into the bowels of ecgs - trying to figure out something by looking at that code is not easy.