On Mon, 12 Dec 2022 00:40:14 GMT, David Holmes <dhol...@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/jvmtiTagMap.cpp line 1262:
> 
>> 1260:   // and record the reference and tag value.
>> 1261:   //
>> 1262:   bool do_entry(JvmtiTagMapKey& key, jlong& value) {
> 
> I still see no point in this method returning a bool when it only ever 
> returns true.

In the `iterate` method of ResourceHashTable, in respurceHash.hpp lines 227-240 
copied here, requires a function that returns boolean. If returned false the 
iterate will break.

 template<typename Function>
  void iterate(Function function) const { // lambda enabled API
    Node* const* bucket = table();
    const unsigned sz = table_size();
    while (bucket < bucket_at(sz)) {
      Node* node = *bucket;
      while (node != NULL) {
        bool cont = function(node->_key, node->_value);    // 
<--------------******
        if (!cont) { return; }
        node = node->_next;
      }
      ++bucket;
    }
  }

The other `iterate` methods are wrappers around this one.
Always returning true means to continue iterating over all the existing items. 
The former base table for jvmtiTagMapTable needs the `do_entry` be `void`.

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

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

Reply via email to