Hook for all newly created objects (original) (raw)

Christian Hagedorn ch-hagedorn at hispeed.ch
Thu Mar 30 15:30:26 UTC 2017


Alright, thank you.

-- Christian

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/gcinterface/collectedHeap.inline.hpp and additionally tried to initialize it inside postallocationnotify. 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