To support more direct binding of compiled Ruby code to callers, I added a NativeCall attribute to DynamicMethod in 1.6. NativeCall contains information on how to directly bind to the underlying Java method, allowing dynopt/indy modes to dispatch directly to the target rather than via the intermediate handle.
This is done currently for all core methods that are bound using generated TypePopulator impls (generated by AnnotationBinder), but not for any other scenarios:
- Compiled Ruby methods
- Java-based Ruby methods not pregenerated
- Reflectively bound methods
In order for dynopt and indy to be able to patch through as many methods as possible, all paths that define and bind JVM-bytecode-based Ruby methods should be generating NativeCall information.