Trying to work newer indy into JRuby

Charles Oliver Nutter charles.nutter at sun.com
Mon May 18 02:32:44 PDT 2009


Ok, I've been puzzling over the demos for a few hours, and I'm confused.

With the iteration from this fall, where the full set of args were 
available during the bootstrap, I was able to actually inspect the 
receiver object and get information from it. Now I don't see how I can 
do that.

Imagine this case:

* All objects are of type RubyObject
* The method table is just a hash contained within RubyObject#getMetaClass

When doing a dynamic call against one of those objects, there's now no 
way for me to call getMetaClass on the receiver object to get its method 
table, and no way for me to look up a named method in that table.

I'll keep hunting, but if someone has a hint I'd appreciate it.

What I need is essentially this:

... bootstrapDynamic(Object receiver, Class caller, String name, 
MethodType type) {
   MethodHandle handle = 
((RubyClass)receiver).getMetaClass().findMethodHandle(name, type);
   CallSite callSite = new CallSite(caller, name, type);
   callSite.setTarget(handle);
   return callSite;
}

I just don't see how I can get access to *my* method tables from within 
the bootstrap now, since they don't live on a Class or in a global 
location anywhere. And how would I bootstrap an interpreted method?

- Charlie



More information about the mlvm-dev mailing list