RFR: Reimplement TsanOopMap support using WeakHandle and ResizeableResourceHashtable [v11]

Jiangli Zhou jiangli at openjdk.org
Mon Jul 29 19:50:46 UTC 2024


On Sat, 27 Jul 2024 02:48:00 GMT, Man Cao <manc at openjdk.org> wrote:

>> Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   - Use cast_from_oop<T> in various places when coverting oop to different types.
>>   - Change TsanOopMapTableKey::_obj to 'oop'.
>>   - Change TsanOopMapTableKey::equals to just do `lhs._obj == rhs._obj`.
>
> src/hotspot/share/tsan/tsanOopMapTable.cpp line 150:
> 
>> 148:         *_dest_high = MAX2(*_dest_high, move.target_end());
>> 149:         if (*_dest_low < *_src_low) {
>> 150:           ++(*_n_downward_moves);
> 
> This seems incorrect. Increment to `_n_downward_moves` should be based on the current move, but `*_dest_low` and `*_src_low` are the minimum of all moves so far. It should be:
> `if (move.target_begin() < move.source_begin())`
> 
> An inaccurate value of  `_n_downward_moves` only affects the efficiency of `handle_overlapping_moves()`, but not correctness.

Good catch for the `_n_downward_moves`. It only affects which compare function (`TsanOopMapImpl::lessThan` or `TsanOopMapImpl::moreThan`) being used with `moves.sort`. It's still good to fix it.

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

PR Review Comment: https://git.openjdk.org/tsan/pull/19#discussion_r1695777018


More information about the tsan-dev mailing list