Jochen Theodorou wrote: > Charles Oliver Nutter schrieb: >> Jochen Theodorou wrote: >>> hmm... In my example with flyby and ricochet (if I used them correctly) >>> both use the stack directly without creating new frames. I am no VM >>> implementor, so I don't know if that is possible. But given, that "my" >>> ricochet is simply like a method executed after mh it does not sound >>> extremely complicated... in fact I would have seen more problems for the >>> flyby. Possibly the problem comes from wanting to present the original >>> arguments... but that is something that is IMHO not needed or can be >>> simulated by DUPing the arguments or maybe we define a predefined >>> MethodHandle which does nothing but double all arguments on the stack, >>> so X1,X2,...,Xn becomes X1,X2,...,Xn,X1,X2,...,Xn. >> I would picture the flyby more like... >> >> public static void myConvertArgs(Object[] args) { >> for each arg do conversion and reinsert into array >> } > > >> And in bootstrap: >> >> MethodHandle incomingHandle = (handle based on call site); >> MethodHandle flyby = MethodHandle.findStatic(This.class, >> "myConvertArgs", ...); >> MethodHandle adapter = MethodHandlers.adaptArguments(incomingHandle, flyby); > > An array is no option, because I don't want my primtive ints to be > boxed. There are drop and insert so I hope this can be used along with a > single argmument converter to replace an argument. At last I don't think > it is impossible to realize
Try to see the big picture :) I was showing a simple example; method handles are typed just like anything else, and so you should be able to adapt any set of arguments to any other set of arguments. And yes, I could also see a flyby pattern where you specify converters for specific arguments in the list as well, so you'd have an "int" converter handle you specify for argument N. You'd do the construction of that adapter once based on the set of incoming arguments, and from there you'd be all set. > true, yes, but adaptArguments is missing too atm. John did say he had not implemented flyby and ricochet yet. adaptArguments is present but (mostly?) unimplemented, and only has signatures for limited, simple cases. - Charlie --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---