On Wed, 11 Jan 2023 10:01:57 GMT, Afshin Zafari <d...@openjdk.org> wrote:
>> The JvmtiTagMap code adds/updates and removes the entries like below in two >> places which could probably be simplified, but I think that's outside the >> scope of this RFE. I suggest removing the bool return from add, remove and >> update, and add the assert(true) in the remove case. There's already an >> assert that add/update happened in the other cases. >> >> ``` // if the object is not already tagged then we tag it >> if (found_tag == 0) { >> if (tag != 0) { >> hashmap->add(o, tag); >> } else { >> // no-op >> } >> } else { >> // if the object is already tagged then we either update >> // the tag (if a new tag value has been provided) >> // or remove the object if the new tag value is 0. >> if (tag == 0) { >> hashmap->remove(o); >> } else { >> hashmap->update(o, tag); >> } >> } > > The methods of HashmapTable are void and have assert to verify the expected > function (add/update/remove) is done. I'm still somewhat concerned about the use of this API and how it will behave in product mode, but okay ... ------------- PR: https://git.openjdk.org/jdk/pull/11288