RFR: 8291736: find_method_handle_intrinsic leaks Method*

David Holmes dholmes at openjdk.org
Thu Aug 25 00:10:47 UTC 2022


On Tue, 23 Aug 2022 15:29:58 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> As part of the SymbolPropertyTable conversion, we noticed that threads could race to add the Method entry to the table, and the loser wasn't deleted.  This change locks the InvokeMethodTable_lock through the Method creation so that it's not leaked.  See bug for details, but this was performance tested with our general suite of performance tests to show no significant differences.
> Also tested with tier1-3, and previously 4-7 with SymbolPropertyTable conversion patch.

Changes requested by dholmes (Reviewer).

src/hotspot/share/classfile/systemDictionary.cpp line 2073:

> 2071:          "must be a known MH intrinsic iid=%d: %s", iid_as_int, vmIntrinsics::name_at(iid));
> 2072: 
> 2073:   MutexLocker ml(THREAD, InvokeMethodTable_lock);

I don't think you can hold the Mutex across the entire method as the exception code below will go to Java.

src/hotspot/share/classfile/systemDictionary.cpp line 2077:

> 2075:   Method** met = _invoke_method_intrinsic_table.get(key);
> 2076:   if (met != nullptr) {
> 2077:    return *met;

Indent appears off

-------------

PR: https://git.openjdk.org/jdk/pull/9983


More information about the hotspot-runtime-dev mailing list