RFR: 8202631: JVM_Clone to throw CloneNotSupportException for Reference object

Kim Barrett kim.barrett at oracle.com
Tue May 8 02:25:34 UTC 2018


> On May 7, 2018, at 10:19 PM, mandy chung <mandy.chung at oracle.com> wrote:
> 
> 
> 
> On 5/7/18 6:02 PM, Kim Barrett wrote:
>> Please review this change to JVM_Clone to throw
>> CloneNotSupportedException for instances of java.lang.ref.Reference.
>> 
>> Per JDK-8201793, Reference and classes derived from it should not
>> support copying via Object.clone.  This is a belt-and-suspenders
>> augmentation of that change.
>> 
>> This change also reverts most of the earlier attempt to support
>> cloning references.  The check for Reference in Klass::set_is_cloneable
>> to prevent setting its JVM_ACC_IS_CLONEABLE_FAST flag has been retained,
>> to further ensure a call can't be intrinsified.
>> 
>> This change also removes sun_misc_Cleaner_signature; see JDK-8194804.
>> 
>> CRs:
>> 
>> https://bugs.openjdk.java.net/browse/JDK-8202631
>> https://bugs.openjdk.java.net/browse/JDK-8194804
>> 
>> 
>> Webrev:
>> 
>> http://cr.openjdk.java.net/~kbarrett/8202631/open.00/
>> 
>> 
>> 
> 
> Looks good.
> 
> Mandy

Thanks.



More information about the hotspot-dev mailing list