Ahead of time compiler solutions

Cedric Berger cedric@wireless-networks.com
Wed Nov 13 12:00:00 GMT 2002

Philippe Laporte wrote:

> Hi all,
>           I've been doing some research and survey.
> I am currently investigating precompiling the core class libraries to 
> native for the (God forbid) SUN JDK. My purpose is that 20 or so 
> Mozillas would run on the same system, each starting a JVM, but I 
> would like to have a single copy of the core classes system-wide. As 
> you all know the JVM text is loaded only once by the OS; I would like 
> it to be the same for the core (statically available) classes. 

I believe that some sharing of classes between JVMs is planned for JDK 
1.5, but who knows.

> How hard would it be to have gcj generate code for the SUN VM 1.4.1? 
> I'm new to the topic, but is the idea of a bridge interface between 
> VMs and Ahead of time compilers crazy? Is it conceivable?  

Probably conceivable, yes. There is one issue: if you use, for example, 
JNI for
the interface between compiled code and dynamic code, you may well ends up
running slower, because JNI is not a fast calling mechanism.

But I wonder if it would be possible to "tweak" hostspot and make it compile
all core classes using its own calling mechanism, and then saving the 
result on
a file somewhere and preload that next time?

> Coming back to the main task of ahead compilation, a good stategy, 
> employed by at least both TurboJ and Carlos Pineda at the Polytechnic 
> University of Catalunya, is to interface the JIT mechanism to the 
> precompiled code.
> I know it has been done with Kaffe, I've seen it running when I was at 
> Transvirtual. BTW, has GCJ subsumed Kaffe and Classpath yet? It's a 
> complete system now, right? Someone finish that AWT! :-) I guess 
> legalities come into play once more. It's hard to imagine GCJ not 
> outperforming the old Kaffe in all contexts...
> Thanks a lot,

More information about the Java mailing list