Hi Lu Lu,
It's feasible, that's what I do to link MMTk (a Java framework for
garbage
collection) written in Java with VMKit's Java runtime written in C++. To
translate the Java code to llvm IR, it uses the compiler in VMKit.
The code to compile is quite tailored for VMKit needs, but it still shows
that you can avoid JNI calls doing it this way.
You can take a look at VMKit here: http://vmkit.llvm.org.
Cheers,
Nicolas
2011/7/7 lu lu <lulu760 at gmail.com>
> Hi,
>
> my c++ code have to call some functions coded by java. In the beginning, I
> call those functions by jni.
> Unfortunately, jni has lots of performance loss, so it can't meets my
> needs.
>
> I wandor if I can convert these java codes to c/c++ by llvm. First, I
> convert java words to llvm bytecode, then covert llvm bytecodes to c/c++.
>
> I am a green hand of LLVM and compilers. So tt's very appreciated if
> someone told me if the idea is feasible or how to do it.
>
> thanks!
> lulu760 at gmail.com
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20110711/26680751/attachment.html>