RFR: 8218969: Free JVMCI native structures in nmethod::flush

Erik Osterlund erik.osterlund at oracle.com
Thu Feb 14 19:22:19 UTC 2019

Hi Nils,

Thanks for the review!


> On 14 Feb 2019, at 14:48, Nils Eliasson <nils.eliasson at oracle.com> wrote:
> Hi Erik,
> Looks good!
> // Nils
>> On 2019-02-14 12:08, Erik Österlund wrote:
>> Hi,
>> An nmethod goes from being is_alive() to being !is_alive() and eventually being freed in nmethod::flush. Native structures for nmethods are freed in nmethod::flush when we free the nmethod. Except for a few things, including JVMCI handles, that are freed already when becoming !is_alive (and some logic to deal with this potentially happening twice for a given nmethod), and finally asserting during flush that it was already cleared.
>> This enhancement proposes to treat these JVMCI handles like we treat any other native structure and simply free it in nmethod::flush, when we free the nmethod, so that the nmethod and handles have a 1:1 mapping for their life cycles.
>> Bug:
>> https://bugs.openjdk.java.net/browse/JDK-8218969
>> Webrev:
>> http://cr.openjdk.java.net/~eosterlund/8218969/webrev.00/
>> Thanks,
>> /Erik

More information about the hotspot-compiler-dev mailing list