RFR: Reimplement TsanOopMap support using WeakHandle and ResizeableResourceHashtable [v11]
Jiangli Zhou
jiangli at openjdk.org
Mon Jul 29 19:18:45 UTC 2024
On Sat, 27 Jul 2024 03:24:05 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 80:
>
>> 78: } else {
>> 79: size_t* v = _table.put_if_absent(new_entry, size, &added);
>> 80: *v = size;
>
> This can be an assert: `assert(*v == size, "same oop should have same size")`.
> This corresponds to `assert(s == bucket->get_oop_size())` in `TsanOopSizeMap::put()`.
I followed the example of `JvmtiTagMapTable::add` when initially implemented this. In the initial version, I made oop as the entry value and later changed to oop use size when finalizing the implementation. It's true that the oop size should never change until an entry is removed. So `*v = size` is not needed. Changing to an assert sounds good to me.
-------------
PR Review Comment: https://git.openjdk.org/tsan/pull/19#discussion_r1695745413
More information about the tsan-dev
mailing list