ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.24k stars 116 forks source link

MethodHandle invokespecial fails to call a default interface implementation #538

Open wasabii opened 3 months ago

wasabii commented 3 months ago

This happens during dynamic compilation when generating a Proxy. The Proxy uses method handles to implement the interface methods. And it uses an invokespecial to call the default implementation. However, only the MethodBuilder is present on RuntimeDefaultInterfaceJavaMethod during dynamic compilation. And this cannot be called.

The same RuntimeDefaultInterfaceJavaMethod implementation is used for dynamic compilation and loading. But it doesn't seem to provide anyway to finalize the actual method builder. Likey we just need to implement the Finish path on it and have the method created and held at that point.