> Yes, and this brings up an important point: the VM should be designed
> to allow code execution to easily transfer between compiled C/C++ code
> and JIT'd (or whatever) Java code. This is in some sense already a
> requirement anyway because of things like user-defined class loaders.

This is a tricky issue.  One of the nice things about gcj is the CNI
interface between Java and C++ - the ability to switch seamlessly between
Java and C++ is great when interfacing code written in both languages. 
This  does however come at a cost.

Firstly, the inherent safety of Java means that you can use memory
management techniques (copying garbage collectors) with the accompanying
performance advantages.  While it is possible to do copying collection in
a restricted subset of C/C++ if you have the necessary compiler support,
this isn't exactly the seamless integration that is desired here.

Secondly, JIT compilers have various performance advantages over their
ahead-of-time peers, and in particular library code can be inlined into
user applications at run time.  This advantage is lost when crossing a
language boundary (unless the C compiler can emit Java bytecode :-).

Robin


Reply via email to