I'm wanting to use an Object[] to simulate an ANF-style activation-record, 
and to load arguments to MethodHandles by their indices in the Object[] 
(including use of the arrayElementSetter combinator as needed to set/update 
slots in the Object[]).  Besides wanting to use A-normal form (just because 
I like it's conceptual simplicity -- I'm just a hobbyist, not an actual 
compiler expert), I was hoping to generate code that didn't have to create, 
spread & collect other Object[] instances, and which would instead run each 
MethodHandle by marshalling their argument lists from the single Object[] 
instance that I passed to it.  

I looked briefly at using spread/filter to accomplish this, by having an 
Object[] with each index being the input Object[] that I want to use as my 
AR, and doing the actual work in filters, but it looked to me that this 
whole approach, besides seeming very inefficient, also required me to have 
a "top-level" MethodHandle of the same arity as the cardinality of the 
sequence of method handles that I wanted to execute.  And it seemed so 
ungainly that at that point just writing my own combinator to do that work 
looked more efficient... except for the creation of all the Object[] 
instances needed to glue it all together, which would be far less 
preferable than something which could generate aaload instructions instead.

Does that make more sense?  Am I barking up the wrong tree vis-a-vis method 
handles, and need to statically generate java or bytecode instead?  Perhaps 
method handles are intended for an "expression tree" approach where a new 
tree is constructed for each instance that's to be run/evaluated?

thanks,

James

On Friday, December 27, 2013 9:36:20 AM UTC-8, fo...@univ-mlv.fr wrote:
>
> I'm not sure to fully understand what you want to do, 
> anyway,  a combination of spreadArguments + filterArguments + 
> collectArguments should do something near what you want. 
> spread transform an array into several arguments, filter allow you to 
> apply different methodhandles for each argument and collect is the dual 
> of spread so it takes several arguments and collect them to one array. 
>
> cheers, 
> R�mi

<snip>

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jvm-languages+unsubscr...@googlegroups.com.
To post to this group, send email to jvm-languages@googlegroups.com.
Visit this group at http://groups.google.com/group/jvm-languages.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to