invokedynamic question
John Rose
John.Rose at Sun.COM
Fri May 23 10:18:40 PDT 2008
On May 23, 2008, at 5:02 AM, Jeroen Frijters wrote:
> I hope it is appropriate to ask a question here about the
> invokedynamic EDR.
Yes. There are three actually places where comments can be sent:
1. A JCP comments alias which is merely a one-way pipe to the EG.
2. This list mlvm-dev, which is set up for Da Vinci Machine
implementation conversations.
3. The jvm-languages group, on which many interested people will
interact with your comment.
The third venue seems to work the best, and I have cross-posted
there; let's follow up there.
> Rémi Forax inspired me to actually try to implement my
> invokedynamic PoC in IKVM and while doing that I realized that I
> don't understand how the receiver object is typed.
Thanks! That exercises the spec. the way it needs to be exercised.
> When the VM calls the bootstrap method, what should it pass as
> CallSite.staticContext().type().parameterType()[0]?
If the type descriptor of the invocation is of the form (TUV...)W,
then type[0] is T. The receiver (formally typed as Dynamic) is
always typed as Object, but that type does not appear in the
descriptor. In your POC example, the type descriptor would be (II)V,
and the value 'obj' is typed as Object, even though the verifier can
prove it is in fact a string.
> I assume it's the type that the verifier computed for the receiver
> object on the stack, but I would like to be sure.
No, that type is always Object, and implicitly assumed.
This is a great question about the EDR, because it points out a need
in the spec. for clarification.
Best wishes,
-- John
More information about the mlvm-dev
mailing list