Differences in asType between MLVM/bsdport and JDK7

John Rose john.r.rose at oracle.com
Thu May 26 23:56:11 PDT 2011


On May 26, 2011, at 11:38 PM, Ola Bini wrote:

> It seems there is still a difference in how asType MHs work between what
> is in current JDK7 repo, and what you get from building bsdport with
> mlvm patches. Specifically, when running things with bsdport/mlvm they
> work. When running on JDK7 (built about 30 minutes ago) I get this:

There are changes to asType in meth-review-7032323.patch.

I just committed that change set a few hours ago here:
  http://hg.openjdk.java.net/hsx/hotspot-comp/jdk

I hope it will be in b145, although we are still figuring this out.

Are you comparing against b143 or b144 (which just came out a few minutes ago)?  (It should not matter very much; just asking.)

> Caused by: java.lang.IllegalArgumentException: target and fallback types
> must match: (SephObject,Object,Object,Object,Object)Object !=
> (SephObject,SephObject,SThread,LexicalScope,MethodHandle)SephObject

This mismatch is being correctly reported.  The change is probably in the logic that created one of the inputs to GWT.

>     	at
> java.lang.invoke.MethodHandleStatics.newIllegalArgumentException(MethodHandleStatics.java:87)
>     	at
> java.lang.invoke.MethodHandles.misMatchedTypes(MethodHandles.java:2074)
>     	at
> java.lang.invoke.MethodHandles.guardWithTest(MethodHandles.java:2058)
>     	at
> seph.lang.compiler.SephCallSite.computeSlowPath(SephCallSite.java:149)
>     	at seph.lang.compiler.SephCallSite.<init>(SephCallSite.java:46)
>     	at seph.lang.compiler.SephCallSite.bootstrap(SephCallSite.java:31)
>     	at java.lang.invoke.CallSite.makeSite(CallSite.java:276)
> 
> John, do you have any idea of what's missing to make this work in JDK7 too?

Please recheck your use of MethodHandles.invoker or MethodHandles.spreadInvoker.  The behavior was seriously out of sync. with the docs, and the docs were unclear.  The latest behavior should be correct and clearly documented.

If in doubt, you can apply asType to your invoker to make sure it has the type you expect.

I mention invokers because I think that's the likely source of the mismatch between Object and things like SThread.

-- John


More information about the mlvm-dev mailing list