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

Jiangli Zhou jiangli at openjdk.org
Wed Jul 24 19:32:02 UTC 2024


On Wed, 24 Jul 2024 03:01:31 GMT, Man Cao <manc at openjdk.org> wrote:

>> Jiangli Zhou has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Sort moves for overlapping case only.
>
> src/hotspot/share/tsan/tsanOopMapTable.hpp line 74:
> 
>> 72:   static unsigned get_hash(const TsanOopMapTableKey& entry) {
>> 73:     assert(entry._obj != nullptr, "sanity");
>> 74:     return (unsigned int)entry._obj->identity_hash();
> 
> In theory `entry._obj` could be an invalid object (old object that is moved or freed), so `identity_hash()` may misbehave. In practice, this probably never happens due to the way we process the hash table in a GC pause. This may deserve a comment, or may be an assert such as `Metaspace::contains(entry._obj->klass())`. But feel free to do nothing.

I added an `assert(entry._obj == entry.object_no_keepalive(), "sanity")` instead.

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

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


More information about the tsan-dev mailing list