[llvm-dev] Using VMKit to convert Java Bytecode to LLVM IR

Ratnesh Tiwari via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 20 12:11:36 PDT 2018


Hi  Cranmer, Joshua, I read your suggestion:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
There’s been a lot of code changes from LLVM 3.3 to LLVM 6.0, so expecting
to just compile vmkit with a newer version of LLVM is not going to work.

Translation of pure JVM bytecode to LLVM itself is not particularly
challenging. You do need a garbage collector, which LLVM does not provide,
but that does not make the conversion that much harder. The difficult part
is that any effective project requires an implementation of several Java
classes that are very closely tied to implementation details (particularly
things like java.lang.Class or java.lang.String). The most obvious source
of the Java library (OpenJDK) essentially requires you to implement the
full and complex dynamic class loading interfaces before you can even get a
simple hello world application running.

VMKit did spend a lot of effort in being able to use the OpenJDK’s
implementation of the Java library, so while it may be a substantial amount
of effort to get VMKit to a newer version of LLVM (or OpenJDK, for that
matter), it is probably easier to do that instead of writing your own
JVM-to-LLVM converter.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

But, I do not understand what specifically you want to say in your last
paragraph in the above reply. Please tell me clearly what exactly I should
do?

Thanks& Regards,
Ratnesh Tiwari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180821/537d09c7/attachment.html>


More information about the llvm-dev mailing list