RFR: 8012902: remove use of global operator new - take 2
David Holmes
david.holmes at oracle.com
Mon Apr 29 06:00:55 PDT 2013
Hi Yumin,
I think we need to pull back on this until we can address the broader
issues:
a) there are a number of classes that don't obey the rules about
extending one of the allocation types
b) adding additional operator new/new[] for explicit C-Heap usage
conflicts with the use of the existing macros/functions documented in
allocation.hpp (I still think I prefer NEW_C_HEAP_OBJ + global placement
new to invoke the correct constructor). If you stick with your approach
then the documentation in allocation.hpp needs rewriting.
c) there seem to be other global array allocations still lurking
d) the effect of the hotspot global operator new on the other libraries
needs to be better understood and dealt with. If I understand your fix
as it stands you will abort in product mode, and warn in debug - yet we
know this problem exists so this will simply force an abort. I would not
expect to see the ShouldNotReachHere() variants.
This is without a doubt quite a mess, so I think we need to proceed very
cautiously.
David
PS. I'm going to be on vacation from about 18 hours from now. Back next
week - no email.
On 26/04/2013 4:48 PM, Yumin Qi wrote:
> HI, all
>
> This bug is filed after this bug
> 8010992: Remove calls to global ::operator new[] and new
> was anti-delta'ed due to testing failure on JVMTI. Now it takes both.
>
> http://cr.openjdk.java.net/~minqi/8012902/webrev/
>
> ObjectMonitor is an class which should not inherit from any class,
> but is has subclass in Jvmti, JvmtiRawMonitor. In previous changeset,
> ObjectMonitor is created through NEW_C_HEAP_OBJ/ARRAY macros, but
> JvmtiRawMonitor was missed. This is why when it is 'new'ed failed on
> disabled global operator new in debug mode. To prevent using more
> complex form of marco NEW_C_HEAP_OBJ/ARRAY operator new and new[] added
> to ObjectMonitor so JvmtiRawMonitor will inherit for them.
>
> HandleMark should be a StackObj but we create the first one in Thread
> ctor in heap, so it did not have StackObj as parent. Added oerator new
> and new [] to it though in fact it is used as StackObj. Same treatment
> for MemRegion too, it is an _ValueObj (in Linux, it did not inherit from
> any). Adding operator new and new[] is mainly avoid using macro
> involving alloc/dealloc and ctor/dtor complexity.
>
> The make files, vm.make and fastdebug.make changed under BSD is for
> one problem which is not clear: jdk code called operator new in hotspot
> library. This only happens on Darwin. Exposure of
> CATCH_OPERATOR_NEW_USAGE giving an warning when first time global
> operator new and new [] called.
>
> Tested with JPRT, vm.quick, jtreg.
>
> Thanks
> Yumin
More information about the serviceability-dev
mailing list