Trying to work newer indy into JRuby

Fredrik Öhrström fredrik.ohrstrom at oracle.com
Tue May 19 08:22:11 PDT 2009


Rémi Forax skrev:
> In that case, guards etc can be implemented using only convert, spread 
> and collect and the JavaMethodHandle.
>   
If you have collect/spread that converts each array element,
then you do not need the JavaMethodHandle.
> But, for my pet project, for Groovy or for Neal's closure, you have to 
> deal with signatures including primitive types.
> In that case, insert/drop, permute and combine/guardWithTest are very 
> useful.
>   
This is only the case if you do not trust that your JVM will optimize
away autoboxing.
Insert/drop,permute/combine/guardwithtest can be easily implemented if you
have either:
         collect/spread   
or
         convert for each argument in a method handle invoke, as I
described before.

//Fredrik

(As an interesting sidenote, collect/spread is build into C# at the
lowest level,
   performing collect: void mytransform(params object[] args) { ....... }
   performing spread: mydelegate.DynamicInvoke(args);
since we do not have a bytecode identifier that can mark a Java method as
collecting its arguments, we cannot currently do this.)

> Rémi
>  
> _______________________________________________
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev
>   




More information about the mlvm-dev mailing list