On Sun, Jun 13, 2010 at 2:51 AM, Yoko Harada <yoko...@gmail.com> wrote:
> This performance improvement will be nice for embedding users since
> objects are going back and forth between Ruby and Java.
>
> If Java interface is implemented by Ruby, and the instance of that
> type is used in Java, does this change cause something different? I
> couldn't figure out how interface proxy worked when I tracked down the
> code before.

When a Ruby object implements a Java interface, we actually create a
real Java class for it that extends RubyObject and implements
IRubyObject. So those objects no longer need a wrapper because the
Java object *is* the Ruby object.

If we were able to inject IRubyObject into arbitrary Java types, we
wouldn't need the wrapper there either, other than for instance vars
and singletons.

Note that this is somewhat new in JRuby 1.5, but even in JRuby 1.4,
the implementing object (basically like a java.lang.reflect.Proxy) and
the Ruby object are inseparable, so no wrapper-tracking logic is
needed.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to