Re: invokedynamic and subclasses

2015-06-24 Thread Douglas Campos
JRuby also chains the bootstraps, you might find inspiration here: https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/runtime/invokedynamic/InvokeDynamicSupport.java On Wed, Jun 24, 2015 at 11:25 AM, Mike Jarmy wrote: > Jochen -- that comes tantalizingly close to making sens

Re: invokedynamic and subclasses

2015-06-24 Thread Mike Jarmy
Jochen -- that comes tantalizingly close to making sense to me :-). I don't quite follow all of the terminology yet, but the basic idea that you describe of chaining bootstrap calls is sort of like what I had vaguely designed in my head. Once I am doing learning how all this works I should be abl

Re: invokedynamic and subclasses

2015-06-24 Thread Jochen Theodorou
Hi Mike, First of all, the bootstrap method does not have to be in the same class. In Groovy we have for example one bootstrap method for all classes only. It is part of the runtime then you could say. We do it like this. We have two bootstrap methods in the Groovy runtime (you don't need t

Re: invokedynamic and subclasses

2015-06-24 Thread Mike Jarmy
Thanks guys, the cookbook is just the kind of thing I was looking for. On Wed, Jun 24, 2015 at 9:53 AM, Rémi Forax wrote: > Hi Mike, > i've compiled a small list of patterns, > https://code.google.com/p/jsr292-cookbook/ > > take a look to the first inlining cache example. > > cheers, > Rémi >

Re: invokedynamic and subclasses

2015-06-24 Thread Rémi Forax
Hi Mike, i've compiled a small list of patterns, https://code.google.com/p/jsr292-cookbook/ take a look to the first inlining cache example. cheers, Rémi Le 24 juin 2015 14:19:32 CEST, Mike Jarmy a écrit : >I've been experimenting with invokedynamic in a compiler for a dynamic >language >th

Re: invokedynamic and subclasses

2015-06-24 Thread MacGregor, Duncan (GE Energy Management)
Okay, this is just the sort of thing invokeDynamic is designed for. Where you want to call get_foo() you should use an invokeDynaimc instruction that will create a MutableCallSite. You should set the target of this to be a lookup method that can find the appropriate get_foo() method, and possibl

invokedynamic and subclasses

2015-06-24 Thread Mike Jarmy
I've been experimenting with invokedynamic in a compiler for a dynamic language that I'm working on, and I've run into a problem that I'm having difficulty solving. Let's say I have a class called A (Java syntax used for clarity): public class A { } And another called B, that is a subcla