Mangled names for invokedynamic
Attila Szegedi
szegedia at gmail.com
Sat Aug 1 13:25:32 PDT 2009
Folks (well, primarily John I think),
I'm trying to write a testcase for an invokedynamic call that
specifies "dyn:getprop:helloText" as the method name. So far, I've
tried the following (all using ASM to generate bytecode as I don't
know what if any is the javac-recognized syntax for these):
1. specify the name verbatim as "dyn:getprop:helloText" in the
argument to invokedynamic. Gives me the following exception when I
call CallSite.nameComponents():
[junit] java.lang.Character
[junit] java.lang.ArrayStoreException: java.lang.Character
[junit] at
sun.dyn.util.BytecodeName.parseBytecodeName(BytecodeName.java:324)
[junit] at java.dyn.CallSite.nameComponents(CallSite.java:224)
[junit] at
org
.dynalang
.dynalink.beans.BeansLinker.getGuardedInvocation(BeansLinker.java:29)
[junit] at
org
.dynalang
.dynalink
.support.DynamicLinkerImpl.relinkAndInvoke(DynamicLinkerImpl.java:68)
[junit] at sun.dyn.FilterGeneric$F0.invoke_C0(FilterGeneric.java:
343)
[junit] at sun.dyn.ToGeneric$A0.target(ToGeneric.java:625)
[junit] at sun.dyn.ToGeneric$A0.targetA0(ToGeneric.java:626)
[junit] at sun.dyn.ToGeneric$A0.invoke_L(ToGeneric.java:627)
[junit] at
org
.dynalang
.dynalink.GreeterDriverImpl.invokeGetHelloText(GreeterDriverImpl.java:
23)
[junit] at
org.dynalang.dynalink.TestGreeterDriver.testAll(TestGreeterDriver.java:
10)
2. specify the name mangled as either "\=dyn\!getprop\!helloText" or
"dyn\!getprop\!helloText". In neither case will CallSite.name()
demangle it, nor will CallSite.nameComponents() either demangle or
tokenize it - I get back a single-element array with the full mangled
name.
Am I doing something wrong?
Attila.
More information about the mlvm-dev
mailing list