I answer to myself :) [...] >>>> I assume it's the type that the verifier computed for the receiver >>>> object on the stack, but I would like to be sure. >>>> >>>> >>> No, that type is always Object, and implicitly assumed. >>> >>> >> It seems like a shame to throw away type information. It means that >> somewhere down the line a downcast is likely needed, for HotSpot this may >> not be a big deal because it can inline the code and remove the cast again, >> but for more static compilers it results in a needless cast. >> >> > Hi jeroen, > in my opinion, the spec implicitly says that the type of the target > method handle is different from > the type of the callsite : callsite.getTarget().type() != classiste.type() > > As you said the type of the target method handle embeds the receiver type, > and as john said the type of the site doesn't include the receiver type. > > I don't like that mismatch, because it's confusing I know now why the receiver type is not available. because invokedynamic is an invokeinterface with java/dyn/Dynamic as receiver, the receiver is lost. So in my opinion callsite.type().parameters(0) should be always java/lang/Object.
>> Another question that may help clarify things for me: Is a design goal to >> allow invokedynamic to link directly (i.e. without an adapter method) to >> existing Java methods? >> >> > yes > >> This also brings up the issue that arguably method handles passed to >> CallSite.setTarget() should be allowed to be have covariant return and >> contravariant argument types. >> >> > In my opinion, it's better to change the spec to say that the type of > the callsite > must be the same that the type of the target. > >> Thanks, >> Jeroen >> >> > cheers, Jeroen > regards, Rémi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "JVM Languages" group. To post to this group, send email to jvm-languages@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/jvm-languages?hl=en -~----------~----~----~----~------~----~------~--~---