invokedynamics call information

42 views
Skip to first unread message

Sarika Sinha

unread,
Jan 23, 2014, 1:18:09 AM1/23/14
to jvm-la...@googlegroups.com
Hi,
I wanted to know, if there is a way to know that a method will be invoked using invokeDynamics . This is to aid the the debugging for Java8 , where Lambda expressions are generated as invokedynamics call. Any info to know if a class was generated by LambdaMetaFactory to generate the synthetic class using MethodHandle ?

Thanks,
Sarika

Remi Forax

unread,
Jan 23, 2014, 3:09:58 AM1/23/14
to jvm-la...@googlegroups.com
On 01/23/2014 07:18 AM, Sarika Sinha wrote:
> Hi,
> I wanted to know, if there is a way to know that a method will be
> invoked using invokeDynamics .

No, apart if you crawle the whole bytecodes but you can not access to
the whole bytecodes.

> This is to aid the the debugging for Java8 , where Lambda expressions
> are generated as invokedynamics call. Any info to know if a class was
> generated by LambdaMetaFactory to generate the synthetic class using
> MethodHandle ?

You can only do that for serializable lambdas, because only serializable
lambdas keep the link between the lambda and the method corresponding to
the body of the lambda.
Otherwise, it's not specified and relying on hacks is not a good idea
because the way it works now will likely to change in an update of jdk8.

But maybe you can describe what you want to do exactly .

>
> Thanks,
> Sarika

cheers,
Rémi

Sarika Sinha

unread,
Jan 23, 2014, 3:17:56 AM1/23/14
to jvm-la...@googlegroups.com
Hi,
So basically I am looking for the information which can tell me that the synthetic class generated is for lambda Expression. I want to ignore few exceptions in such scenario which might be valid for a normal Synthetic class like line nos etc.
I am aware of only one hint which is the name of the class which has "$$Lambda$" .
Thanks,
Sarika

Remi Forax

unread,
Jan 23, 2014, 4:03:36 AM1/23/14
to jvm-la...@googlegroups.com
On 01/23/2014 09:17 AM, Sarika Sinha wrote:
> Hi,
> So basically I am looking for the information which can tell me that
> the synthetic class generated is for lambda Expression. I want to
> ignore few exceptions in such scenario which might be valid for a
> normal Synthetic class like line nos etc.
> I am aware of only one hint which is the name of the class which has
> "$$Lambda$" .
> Thanks,
> Sarika

One reason to use invokedynamic when compiling the creation of a lambda
is that it allows to change the way the lambda proxy object is created
for each update of the jdk.
So any hints you will find may be true only for a specific version for a
specific vendor.

cheers,
Rémi

>
> On Thursday, 23 January 2014 11:48:09 UTC+5:30, Sarika Sinha wrote:
>
> Hi,
> I wanted to know, if there is a way to know that a method will be
> invoked using invokeDynamics . This is to aid the the debugging
> for Java8 , where Lambda expressions are generated as
> invokedynamics call. Any info to know if a class was generated by
> LambdaMetaFactory to generate the synthetic class using MethodHandle ?
>
> Thanks,
> Sarika
>
> --
> You received this message because you are subscribed to the Google
> Groups "JVM Languages" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jvm-language...@googlegroups.com.
> To post to this group, send email to jvm-la...@googlegroups.com.
> Visit this group at http://groups.google.com/group/jvm-languages.
> For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages