Interface implementations using JRuby objects currently use our CachingCallSite logic for invoking the Ruby object's methods, be that object a full Ruby object or a proc/block for lambda-like interface coercion. These upcalls back into JRuby should be made more efficient in two ways:
- By using a ScopedValue to access the ThreadContext.
- By using InvokeDynamic to call the actual method or block body.
This would represent the "last mile" for interface performance and allow calls through such objects to inline and optimize with the Java code that calls them.
Interface implementations using JRuby objects currently use our CachingCallSite logic for invoking the Ruby object's methods, be that object a full Ruby object or a proc/block for lambda-like interface coercion. These upcalls back into JRuby should be made more efficient in two ways:
This would represent the "last mile" for interface performance and allow calls through such objects to inline and optimize with the Java code that calls them.