Bytecode transformation investigation

forax at univ-mlv.fr forax at univ-mlv.fr
Fri Aug 5 17:35:51 UTC 2022


----- Original Message -----
> From: "Brian Goetz" <brian.goetz at oracle.com>
> To: "Remi Forax" <forax at univ-mlv.fr>, "Dan Heidinga" <heidinga at redhat.com>
> Cc: "leyden-dev" <leyden-dev at openjdk.java.net>
> Sent: Thursday, August 4, 2022 1:26:38 AM
> Subject: Re: Bytecode transformation investigation

>> isHidden() returning false is a compatibility issue because i've seen it used
>> has an equivalent of isALambda() (like isAnonymous() was used before
>> isHidden()), GraalVM emulates isHidden() for this reason.
> 
> I'm not very sympathetic here.  Code that interprets isHidden in this
> way is just wrong.  There were extensive discussions about "how do I
> detect whether an object is a lambda" and the answer has consistently
> been "don't try, you don't need to know, and none of the mechanisms
> answer the question you are asking."
> 
>> For me, instead of trying to emulate those differences, i think it's easier here
>> to provide a method Class.isLambdaProxy() and adds an empty classfile attribute
>> LambdaProxy in the VM spec so both the lambda proxy generated using
>> invokedynamic or pre-generated will mostly behave the same way.
> 
> We made a very clear decision in the JSR 335 EG -- that at runtime,
> lambdas are not a thing.  The question of "are you a lambda proxy" is no
> more interesting than "was it a tuesday when the source file for this
> class was last changed", and it was a deliberate choice to not provide
> any sort of reflection support here.  So I would not want to expose
> this; it's an implementation detail.

Okay, i was wrong here.

Rémi


More information about the leyden-dev mailing list