RFR: 8292741: Convert JvmtiTagMapTable to ResourceHashtable [v7]
    David Holmes 
    dholmes at openjdk.org
       
    Mon Jan 16 23:21:23 UTC 2023
    
    
  
On Wed, 11 Jan 2023 10:01:57 GMT, Afshin Zafari <duke at 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
    
    
More information about the hotspot-dev
mailing list