Le 14/10/2009 20:59, Sander Mak a écrit :
> A little context: running the szegedi build (http://www.szegedi.org/
> mlvm-macosx.html), trying to compile and run the simple Hello example
> of the project coin proposal (http://wikis.sun.com/display/mlvm/
> ProjectCoinProposal#ProjectCoinProposal-SIMPLEEXAMPLE%3A).
>
> First of all I had to tweak the max. and min. heap size of javac/java,
> otherwise there was an instant GC crash. After that, there where some
> compile errors in the Hello example. Adding some throws Throwable
> clauses and changing the way the static method lookup for the greeter
> methodhandle is done solved those. Just normal API progress I guess,
> resulting code can be seen in http://pastebin.ca/1620221
>
> The example now compiles, and javap shows that an invokedynamic
> bytecode is generated, yay! However, running the example results in
> the following exception:
>
> Caused by: java.dyn.NoAccessException: cannot access:
> *.Hello.bootstrapInvokeDynamic
> (java.lang.Class,java.lang.String,java.dyn.MethodType)
> java.dyn.CallSite, from Hello
>       at sun.dyn.MemberName.newNoAccessException(MemberName.java:421)
>       at sun.dyn.MemberName.newNoAccessException(MemberName.java:412)
>       at sun.dyn.MemberName$Factory.resolveOrFail(MemberName.java:517)
>       at java.dyn.MethodHandles$Lookup.findStatic(MethodHandles.java:234)
>       at java.dyn.Linkage.registerBootstrapMethod(Linkage.java:100)
>       at Hello.<clinit>(Hello.java:24)
>
> Am I missing something? Tried various access modifiers for the
> bootstrapInvokeDynamic method, since the exception seems to indicate
> access problems. No success though.
>
> I just noticed the signature in the exception for
> bootstrapInvokeDynamic that is expected is different from the one in
> the example. Will look into that now, but any help is appreciated.
>    

This article contains a code sample that demonstrates
how to register a bootstrap method:
http://java.sun.com/developer/technicalArticles/DynTypeLang/

And yes, the valid signature is:

CallSite myBootstrapMethod(Class caller, String name, MethodType type)


> Thanks,
>
> Sander
>    

cheers,
Rémi

--~--~---------~--~----~------------~-------~--~----~
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