Hi Lu Lu,<div><br></div><div>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.</div>
<div><br></div><div>The code to compile is quite tailored for VMKit needs, but it still shows that you can avoid JNI calls doing it this way.</div><div><br></div><div>You can take a look at VMKit here: <a href="http://vmkit.llvm.org">http://vmkit.llvm.org</a>.</div>
<div><br></div><div>Cheers,</div><div>Nicolas<br><br><div class="gmail_quote">2011/7/7 lu lu <span dir="ltr"><<a href="mailto:lulu760@gmail.com">lulu760@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br><br clear="all">my c++ code have to call some functions coded by java. In the beginning, I call those functions by jni.<br><span lang="en"><span title="点击可显示其他翻译">Unfortunately, jni has lots of performance loss, so it can't meets my needs.<br>

<br>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++.<br><br>I am a green hand of LLVM and compilers. So tt's very </span></span>appreciated if someone told me if the idea is feasible or how to do it.<br>

<br>thanks!<br><a href="mailto:lulu760@gmail.com" target="_blank">lulu760@gmail.com</a><br><span lang="en"><span title="点击可显示其他翻译"> </span></span>
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div>