On Mon, 28 Nov 2022 22:14:06 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> add() is supposed to add a new object with tag. There is an assert() in its 
>> body that checks it. By removing the assert, add() can be used for updating 
>> as well.
>
> Are you suggesting that `add`  can also act as a `replace` operation? I would 
> think we would want a separate method for that.

Yes, this could have a replace operation that does below which would be better:

void JvmtiTagMapTable::replace(oop o, jlong tag) {
    JvmtiTagMapEntry key(o);
      bool is_added = _rrht_table.put(new_entry, tag);
      assert(!is_added, "should not be added");
}

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

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

Reply via email to