That indeed works - thanks for the hep Rémi!
FWIW, I'm updating my dynamic linker framework library to work with this
version of MLVM; I got everything to compile after some nontrivial amount of
work (Linkage went away, for one thing :-) ) and was stumped on this for
running my test suite. Now that's eliminated, I hope I'll be able to roll out a
new version of the library soon.
Attila.
On Feb 7, 2011, at 11:40 AM, Rémi Forax wrote:
> On 02/07/2011 07:00 PM, Attila Szegedi wrote:
>> Hi Stephan (and MLVM folks in general),
>>
>> I have problems with this build. Here's a _very_ minimal testcase:
>>
>> public class X {
>> public static void main(String[] args) {
>> new
>> java.dyn.MutableCallSite(java.dyn.MethodType.methodType(Void.TYPE));
>> }
>> }
>
> I can reproduce it on Linux.
> There is a bug in the initialization order between Lookup and
> MethodHandleImpl.
> Lookup should be initialized first then MethodHandleImpl but in
> MethodHandles (near line 306)
> IMPL_TOKEN.getClass() is called before MethodHandleImpl.initLookup (near
> line 316)
>
> The temporary workaround is to initialize Lookup first:
> public static void main(String[] args) {
> MethodHandles.lookup();
> new
> java.dyn.MutableCallSite(java.dyn.MethodType.methodType(Void.TYPE));
> }
>
>
>> compiling then running it produces this output:
>>
>> $ ~/Downloads/java-1.7.0-internal-mlvm-2011_01_31/bin/javac X.java
>> $ ~/Downloads/java-1.7.0-internal-mlvm-2011_01_31/bin/java
>> -XX:+UnlockExperimentalVMOptions -XX:+EnableInvokeDynamic X
>> VM option '+UnlockExperimentalVMOptions'
>> VM option '+EnableInvokeDynamic'
>> Exception in thread "main" java.lang.InternalError
>> at sun.dyn.MethodHandleImpl.<clinit>(MethodHandleImpl.java:141)
>> at java.dyn.MethodHandles.<clinit>(MethodHandles.java:63)
>> at java.dyn.MethodHandles$Lookup.<clinit>(MethodHandles.java:319)
>> at java.dyn.CallSite.<clinit>(CallSite.java:228)
>> at X.main(X.java:5)
>>
>> I tried adding -XX:+EnableMethodHandles too, and that didn't help either.
>>
>> Here's the version:
>> $ ~/Downloads/java-1.7.0-internal-mlvm-2011_01_31/bin/java -version
>> openjdk version "1.7.0-internal-fastdebug"
>> OpenJDK Runtime Environment (build
>> 1.7.0-internal-fastdebug-stephen_2011_01_31_18_20-b00)
>> OpenJDK 64-Bit Server VM (build 20.0-b06-fastdebug, mixed mode)
>>
>> This is on Mac OS X 10.6.6
>>
>> Attila.
>
> Rémi
_______________________________________________
mlvm-dev mailing list
[email protected]
http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev