Thanks for discussing JVM topic!
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.
What about Falcon It is an optimizing Java JIT base on modern LLVM, perhaps it is able to learn from it. And I also have the same question: how to support JDK library?
*From:*llvm-dev [mailto:firstname.lastname@example.org] *On Behalf Of *Ratnesh Tiwari via llvm-dev
*Sent:* Monday, August 20, 2018 7:20
*To:* llvm-dev <email@example.com>
*Subject:* [llvm-dev] Using VMKit to convert Java Bytecode to LLVM IR
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.
I love Compiler Principle so I migrated DragonEgg from GCC-4.8 + LLVM-3.3 to GCC-8 + LLVM-6, you can also migrate VMkit from LLVM-3.3 to LLVM-8.
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.
Java Bytecode to LLVM IR is not difficult, but there is graalvm/sulong for transforming LLVM IR to Java Bytecode already
Thanks & Regards
LLVM Developers mailing list
llvm-dev Info Page
2. jdk8u/jdk8u-dev/jdk: log
5. GitHub - graalvm/sulong: Obsolete repository. Moved to oracle/graal.