Hook for all newly created objects

Roman Kennke rkennke at redhat.com
Thu Mar 30 06:37:46 UTC 2017



Am 30. März 2017 02:13:34 MESZ schrieb Christian Hagedorn <ch-hagedorn at hispeed.ch>:
>I have added a private field to the oopDesc class inside
>share/vm/oops/oop.hpp. Now I wanted to initialize it properly. How can
>I do
>that?
>
>I tried to do it inside the share/vm/runtime/InterpreterRuntime.cpp
>_new,
>newarray, anewarray and multianewarray. But then I miss some objects. 
>
>So I looked further and found
>share/vm/gc_interface/collectedHeap.inline.hpp
>and additionally tried to initialize it inside post_allocation_notify.
>But I
>think I still miss some objects.
>
>What can I do to catch all new objects and initialize my field only
>once?

You need to implementiert the same hook in the interpreter, c1 and c2. There are fast inlined allocation routines ... Alternatively, disable TLABs -XX:-UseTLAB, but this will make allocations *much* slower.

Roman

>
> 
>
>- Christian

-- 
Sent from my FairPhone


More information about the hotspot-dev mailing list