RFR: 8010992: Remove calls to global ::operator new[] and new

Coleen Phillimore coleen.phillimore at oracle.com
Fri Apr 12 21:48:52 UTC 2013


Yumin,  I think this looks really good.   One comment:

thread.cpp

You allocate the HandleMark with mtThread and free it with mtInternal.

There are some other mtInternal's that you added that maybe Zhengyu has 
a better idea about.

Thanks,
Coleen


On 4/12/2013 5:07 PM, Yumin Qi wrote:
> After take feedback and modify, new webrev
>
> http://cr.openjdk.java.net/~minqi/8010992/webrev1 
> <http://cr.openjdk.java.net/%7Eminqi/8010992/webrev1>
>
>
>
> Thanks
> Yumin
>
> On 4/12/2013 10:45 AM, Zhengyu Gu wrote:
>> .
>>>> cardTableModRefBS.cpp
>>>>   #87 and #88, why set_start(NULL) are needed?
>>>>
>>> This is default constructor does, here just copy that code. Since we 
>>> did not call constructor by using this MACRO. It is a _ValueObj, 
>>> should not call new, but I think we can use NEW_C_HEAP_OBJ3, which 
>>> will call ctors.
>> NEW_C_HEAP_OBJECT_ARRAY macro does invoke ctor ... that is what 
>> allocation.hpp #618 does.
>>
>> Thanks,
>>
>> -Zhengyu
>>
>>
>>>> carTableRS.cpp
>>>>   #70, why it is commented out? If so, you don't need the dstor
>>>>
>>>>
>>> See reply to David H.
>>>
>>>
>>> Thanks
>>> Yumin
>>>> -Zhengyu
>>>>
>>>>
>>>>
>>>>
>>>> On 4/12/2013 2:12 AM, Yumin Qi wrote:
>>>>> Hi,
>>>>>
>>>>>   Can I have your inputs for the fix?
>>>>>   webrev:
>>>>>
>>>>>  http://cr.openjdk.java.net/~minqi/8010992/webrev/ 
>>>>> <http://cr.openjdk.java.net/%7Eminqi/8010992/webrev/>
>>>>>
>>>>>   Bug:  8010992: Remove calls to global ::operator new[] and new
>>>>> https://jbs.oracle.com/bugs/browse/JDK-8010992
>>>>>
>>>>> Problem description:  Remove the usage of global operator ::new[] 
>>>>> and ::new. In hotspot debug build, disable the usage of global 
>>>>> new[] and new.  Hotspot does not throw c++ exceptions, but it 
>>>>> cannot prevent third party code to catch such exceptions.  By 
>>>>> disabling use of global operator new[] and new, we constrain the 
>>>>> exception disposal within hotspot. C++ classes (as same for 
>>>>> structs) in hotspot have to either extends from CHeapObj or 
>>>>> ResourceObj unless they are stack objects or values which have to 
>>>>> be from StackObj or _ValueObj respectively.  Or they have to 
>>>>> implement their own operator new[] or new.
>>>>>
>>>>> Thanks
>>>>> Yumin
>>>>>
>>>>>
>>>>
>>>
>>
>




More information about the hotspot-gc-dev mailing list