polyglot-compiler / JLang

JLang: Ahead-of-time compilation of Java programs to LLVM
http://polyglot-compiler.github.io/JLang/
Other
287 stars 30 forks source link

Properly implement Interface Method Dispatch from Runtime #31

Open dz333 opened 6 years ago

dz333 commented 6 years ago

There is a function in jni_help.h (CallJavaInterfaceMethod) that allows runtime code to call methods which are defined as interface methods (and therefore are not in a class' CDV). The normal functions for calling methods doesn't delegate to this in the case where the method is an interface method.

In order to correctly call methods in general from runtime, we need to 1) check if the method is defined in an interface and then 2) use CallJavaInterfaceMethod to call it.

This isn't terribly important since it is not a common case and currently doesn't prevent our test suites from passing, but should be done at some point to enable any method to be called via runtime code easily.