I've read through Fidgety a few times and I think I'm starting to get it. So the idea is that you would install a MethodHandle into the call site that knows how to handle the incoming objects and (potentially) re-patch the call site with a new method?
Is there any guarantee that the code in the MethodHandle will be inlined through? I may have missed some discussion on this, but I want to be absolutely clear on this point. If I wire up things exactly as in Fidgety's "Guard" method handle, will (e.g.) Hotspot inline all the way through? What are the edge cases? I may have enough to get this wired now...starting to see where the old pieces fit into the new structure. Hints still welcome :) - Charlie Charles Oliver Nutter wrote: > 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 > _______________________________________________ > mlvm-dev mailing list > mlvm-dev@openjdk.java.net > http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev