Bug when trying to find an exactInvoker ? [Was]: Spurious NPE in guardWithTest

Rémi Forax forax at univ-mlv.fr
Mon Dec 20 23:53:15 PST 2010


John, there are two different bugs:
One throws a NPE  when calling a guardWithTest, the other can't get the 
exactInvoker when
calling invokeWithArguments() and is only reproductible with mlvm 
workspace code.

Basically, lookup.findVirtual(MethodHandle.class, "invoke", methodType) 
fails.

Rémi

On 12/19/2010 05:09 PM, Rémi Forax wrote:
> Is the mlvm workspace usable ?
>
> /usr/jdk/i586/jdk1.7.0/bin/java -davinci 
> -Xbootclasspath/p:/tmp/davinci-classes.jar 
> -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic ConvertBug
> VM option '+UnlockExperimentalVMOptions'
> VM option '+EnableInvokeDynamic'
> Exception in thread "main" java.lang.InternalError: JVM cannot find 
> invoker for (double,double)double
>     at sun.dyn.Invokers.exactInvoker(Invokers.java:74)
>     at sun.dyn.Invokers.genericInvoker(Invokers.java:82)
>     at java.dyn.MethodHandle.invokeWithArguments(MethodHandle.java:420)
>     at java.dyn.MethodHandle.invokeVarargs(MethodHandle.java:468)
>     at ConvertBug.main(ConvertBug.java:19)
>
> Rémi
>
> ----------------------------------------------------------------------------------------------------------------------------- 
>
> import java.dyn.MethodHandle;
> import java.dyn.MethodHandles;
> import java.dyn.MethodType;
>
> public class ConvertBug {
>   public static double add(double x, double y) {
>     return x + y;
>   }
>
>   public static void main(String[] args) throws Throwable {
>     MethodHandle mh = 
> MethodHandles.lookup().findStatic(ConvertBug.class, "add",
>         MethodType.methodType(double.class, double.class, double.class));
>     System.out.println(mh.invokeVarargs(1, 2.0));  // ok ?
>   }
> }
>
>



On 12/21/2010 01:10 AM, John Rose wrote:
> On Dec 20, 2010, at 2:58 AM, Christian Thalinger wrote:
>
>> I can reproduce it on x86 and SPARC with -Xint.  I'm not sure yet what causes this but can this be an API problem?
> Could be a problem with a generic invoker, I suppose.  Generic invocation is relatively new code.
>
> Remi, what's the type of the receiver of invokeWithArguments (invokeVarargs)?
>
> -- John
>
> _______________________________________________
> 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