hg: lambda/lambda/langtools: Add support for creating lambda/method references through indy calls

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Tue Aug 9 06:35:42 PDT 2011


On 09/08/11 14:05, Rémi Forax wrote:
> Hi Maurizio,
> there is a simple way to avoid to create a supplementary bridge by
> method reference
> (which is not a bridge BTW), the adaptation of a method reference to a
> SAM descriptor
> can be done easily by sending the SAM descriptor to the BSM (encoded a
> method type*).
>
> Then at runtime, in the BSM, the constant method handle corresponding to
> the method
> reference can be converted to the SAM descriptor using asType().
Yeah, I know that - our goal is to start with a simple BSM factory which 
assumes that the signature generated by the compiler matches the one of 
the target SAM descriptor, and then try to remove the need for the 
compiler synthetized bridges in a second step.


Thanks
Maurizio
> Rémi
> * you also forget that a method type is a valid constant for a bootstrap
> argument in your patch).
>
> On 08/08/2011 02:43 PM, maurizio.cimadamore at oracle.com wrote:
>> Changeset: 95ae37c3d0cf
>> Author:    mcimadamore
>> Date:      2011-08-08 13:42 +0100
>> URL:       http://hg.openjdk.java.net/lambda/lambda/langtools/rev/95ae37c3d0cf
>>
>> Add support for creating lambda/method references through indy calls
>> *) Added code-generation support for BootstrapMethods attribute
>> *) Added code-generation support for CONSTANT_InvokeDynamic CP entry
>> *) Added simple bootstrap method used to create SAM instances (simply links to the old method using dynamic proxies)
>> *) Added desugaring support for generating invokedynamic calls
>>
>> ! src/share/classes/com/sun/runtime/ProxyHelper.java
>> ! src/share/classes/com/sun/tools/javac/code/Symbol.java
>> ! src/share/classes/com/sun/tools/javac/code/Symtab.java
>> ! src/share/classes/com/sun/tools/javac/comp/Attr.java
>> ! src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
>> ! src/share/classes/com/sun/tools/javac/comp/LambdaTranslator.java
>> ! src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
>> ! src/share/classes/com/sun/tools/javac/jvm/Gen.java
>> ! src/share/classes/com/sun/tools/javac/jvm/Items.java
>> ! src/share/classes/com/sun/tools/javac/jvm/Pool.java
>> ! src/share/classes/com/sun/tools/javac/tree/JCTree.java
>> ! src/share/classes/com/sun/tools/javac/tree/Pretty.java
>> ! src/share/classes/com/sun/tools/javac/util/Names.java
>>
>>
>



More information about the lambda-dev mailing list