Le 25 mars 2010 à 18:10, John Rose a écrit :

> On Mar 25, 2010, at 8:43 AM, Attila Szegedi wrote:
> 
>> You'll get java.dyn.NoAccessException in more generic cases too, i.e. if. 
>> MethodHandles.findStatic/Virtual/Special fails to find a method of the 
>> expected signature etc.
> 
> Thanks, Attila.
> 
> The JSR 292 RI is still underdevelopment.  See yesterday's message for status 
> related to javadoc and invokeGeneric:
> 
>  http://mail.openjdk.java.net/pipermail/mlvm-dev/2010-March/001591.html
> 
> The invokeGeneric method, currently, should be treated as an alias for 
> invokeExact until I get a little more JVM plumbing done.  Until then, if you 
> want to write a simple generic invocation, and are willing to tolerate boxing 
> overheads in exchange, use MethodHandle.invokeVarargs.
> 
> Xavier, the draft javadoc is posted here, and was just updated yesterday:
> 
>  http://cr.openjdk.java.net/~jrose/pres/indy-javadoc-mlvm/
> 
> It includes an account of the associated changes to the classfile format, 
> too.  See the package-info page for java.dyn.


Thanks to both of you for the additional information, and pointers.
However, I am still missing something - probably obvious.

In the application I am working on, the Java 1.6 perfectly-working code 
contains the following line:
        return (Value) this.implementations[prim].invoke(null, 
(java.lang.Object[]) params);

And I would expect the following Java 1.7 line to be equivalent but it raises 
the aforementioned exception:
        return (Value) 
MethodHandles.lookup().unreflect(this.implementations[prim]).invokeVarargs((java.lang.Object[])
 params);

Also notice, that the following line do not raise any exception:
        MethodHandles.lookup().unreflect(this.implementations[prim]);

The environment of this line is as follows:
  - "this.implementations" has a type equal to "Method[]";
  - "params" has a type equal to "Value[]" ("Value" being an 
application-specific type);
  - "prim" has obviously its type equal to "int".


Sorry to keep posting on this thread, but I am really having a hard time 
figuring out what is going on.

Thanks for your patience,

Xavier Clerc

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
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.

Reply via email to