RFR[9]:Fix java/lang/invoke/MethodHandleImpl's use of Unsafe.defineAnonymousClass()

Michael Haupt michael.haupt at oracle.com
Thu May 12 09:38:25 UTC 2016


... yes.

Best,

Michael

> Am 12.05.2016 um 06:44 schrieb Sundararajan Athijegannathan <sundararajan.athijegannathan at oracle.com>:
> 
> +1
> 
> -Sundar
> 
> 
> On 5/11/2016 10:01 PM, shilpi.rastogi at oracle.com wrote:
>> Hi All,
>> 
>> Please review the updated webrev-
>> http://cr.openjdk.java.net/~srastogi/8149574/webrev.07/
>> 
>> Changed the anonymous class package with no package name.
>> 
>> Regards,
>> Shilpi
>> 
>> On 5/11/2016 8:22 PM, Paul Sandoz wrote:
>>> Hi Shilpi,
>>> 
>>> What makes me slightly queasy about the constant pool patching of T
>>> is it’s quite fragile and it produces a class with a slightly
>>> inconsistent state regarding the InnerClasses structures. It’s
>>> probably mostly harmless but still bothers me.
>>> 
>>> One solution is to combine ASM with constant pool patching. Use ASM
>>> to generate the class bytes, and query the constant pool in the
>>> ClassWriter, then remember the class bytes, the pool size, and index
>>> to patch (a cursory glance at ClassWriter suggests this is possible).
>>> 
>>> But i think Michael raises an important point about simplification
>>> using the default package, if that is possible. However, if the
>>> default package is to be used ASM is still required to generate class
>>> bytes and define the class anonymously within the scope of the host
>>> class. Thus in this approach the addition of patching should not add
>>> much more complexity and i think would be more in sync with that of
>>> the host class.
>>> 
>>> Paul.
>>> 
>>>> On 11 May 2016, at 13:24, shilpi.rastogi at oracle.com wrote:
>>>> 
>>>> Hi All,
>>>> 
>>>> Please review the following-
>>>> 
>>>> https://bugs.openjdk.java.net/browse/JDK-8149574
>>>> 
>>>> Solution: Changed anonymous class package name with the package name
>>>> of its host class.
>>>> 
>>>> Two approaches to solve this-
>>>> 1.  Parse .class and get the class name index form constant pool and
>>>> patch it with new name
>>>> http://cr.openjdk.java.net/~srastogi/8149574/webrev.05/
>>>> 
>>>> 2. Create class with new name (With ASM)
>>>> http://cr.openjdk.java.net/~srastogi/8149574/webrev.06/
>>>> 
>>>> Which approach is better?
>>>> 
>>>> Thanks,
>>>> Shilpi
>>>> 
>>>> 
>>>> 
>> 
> 

-- 

 <http://www.oracle.com/>
Dr. Michael Haupt | Principal Member of Technical Staff
Phone: +49 331 200 7277 | Fax: +49 331 200 7561
Oracle Java Platform Group | LangTools Team | Nashorn
Oracle Deutschland B.V. & Co. KG | Schiffbauergasse 14 | 14467 Potsdam, Germany

ORACLE Deutschland B.V. & Co. KG | Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V. | Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher
 <http://www.oracle.com/commitment>	Oracle is committed to developing practices and products that help protect the environment




More information about the core-libs-dev mailing list