reusing more of LLVM

Samuel Audet samuel.audet at gmail.com
Fri Feb 1 04:58:12 UTC 2019


Hi,

Thanks for taking the time to reply. I'm talking about SystemABI, in 
this case. Maurizio posted a demo of how to call functions like 
getpid(), pow(), qsort() here previously:
https://mail.openjdk.java.net/pipermail/panama-dev/2018-November/003316.html

LLVM has all the machinery to JIT compile all that in the same way, and 
already includes ABIs for many architectures, see this tutorial for 
example where they wrap the API in a toy language:
http://llvm.org/docs/tutorial/LangImpl04.html#adding-a-jit-compiler

So, why not reuse that code? I would really like to understand the 
reasons why this wasn't considered. Is it because it's a C++ API? But 
isn't that the goal of Panama Foreign/Native anyway? To let Java 
developers use C++ APIs? If there are technical reasons why this 
wouldn't work, I honestly can't think of anything.

Samuel

On 2/1/19 9:17 AM, Vladimir Ivanov wrote:
> Samuel,
> 
> Can you elaborate your point a bit, please?
> 
> Shark was an attempt to bring LLVM-based JIT compiler to HotSpot JVM, 
> but that goal is orthogonal to Panama where the focus is on 
> interconnecting managed code with native code / hardware.
> 
> LLVM definitely looks attractive in some respects, but I don't 
> understand what you mean by "reimplementing portions of LLVM in Java".
> 
> Best regards,
> Vladimir Ivanov
> 
> On 31/01/2019 14:40, Samuel Audet wrote:
>> I am starting the get the impression that Panama is basically 
>> reimplementing portions of LLVM in Java as part of SystemABI. How much 
>> effort would it take to, for example, implement the required subset of 
>> the Java ABI in LLVM? Doing it that way, we would not need to test the 
>> C/C++ ABI, at least, making it possible instead to reuse tests from 
>> the JDK itself, or am I talking nonsense here? Looks like that might 
>> be challenging as well: http://openjdk.java.net/jeps/8189173. In any 
>> case, it would be great if we could have a discussion about these 
>> things instead of having OpenJDK dictate everything!



More information about the panama-dev mailing list