RFR: 8292741: Convert JvmtiTagMapTable to ResourceHashtable [v7]
Afshin Zafari
duke at openjdk.org
Wed Dec 14 15:13:56 UTC 2022
On Mon, 12 Dec 2022 00:50:27 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Afshin Zafari has updated the pull request incrementally with one additional commit since the last revision:
>>
>> 8292741: Convert JvmtiTagMapTable to ResourceHashtable
>
> src/hotspot/share/prims/jvmtiTagMapTable.cpp line 114:
>
>> 112: JvmtiTagMapKey new_entry(obj);
>> 113: bool is_updated = _table.put(new_entry, tag) == false;
>> 114: assert(is_updated, "should be updated and not added");
>
> This API is confusing. You have `add` and `replace` but in product mode an `add` can `replace` and a `replace` can `add`. It isn't clear if these should be allowed rare conditions or fatal errors.
I agree that this is ambigious. The `jvmtiTagMap` calls `add/update` methods of `jvmtiTagMapTable` which in turn calls `resourceHashTable` methods `put` and `put_if_absent`.
`put` and `put_if_absent` can be used for both adding and updating and reporting it in returned values.
`jvmtiTagMap` calls to `jvmtiTagMapTable` add/update DO NOT CARE about the returned values. For these calls, it doesn't mater if an add (update) method resulted in an update (add).
So which one of the following cases would be correct?
- Based on the `jvmtiTagMap` calls, let the add/update be void and ignore the differences of what really happens in the table. Or
- Based on the `resourceHashTable` bool-valued `put` and `put_if_absent` methods, let the add/update be bool-values and leave the decision on "what really happened in the table" to the callers in `jvmtiTagMap`. (current implementation)
-------------
PR: https://git.openjdk.org/jdk/pull/11288
More information about the serviceability-dev
mailing list