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

Cranmer, Joshua via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 20 08:32:40 PDT 2018


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.

From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Ratnesh Tiwari via llvm-dev
Sent: Monday, August 20, 2018 7:20
To: llvm-dev <llvm-dev at lists.llvm.org>
Subject: [llvm-dev] Using VMKit to convert Java Bytecode to LLVM IR

Hi,

I wanted to use VMKit  project to convert Java Bytecode to LLVM IR bitcode. But  I do not know how to start, since I came to know that VMkit is written for llvm -3.3 version, but I want it for latest LLVM version 6.0.1.

So, could you please suggest me, whether I have to write it whole project from scratch to meet my requirement of latest llvm version, or can use existing project by building it. Since, I think existing VMKit project which is unmaintained might have a lot of bug to meet latest llvm version.

Also tell me if I have to write it from scratch to convert from Java Bytecode to LLVM IR, what is the basic code flow approach ,how to start and related guidance. Please help me by suggesting above queries.

Thanks & Regards
Ratnesh Tiwari

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180820/e157308e/attachment.html>


More information about the llvm-dev mailing list