On Wed, 2 Nov 2022 22:23:57 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:

>> Use identity_hash for objects in the JVMTI TagMap table.  If the object has 
>> no hashcode, it's not in the table.
>> Tested with tier1-6.
>
> Coleen Phillimore has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Remove now-unused function that I missed.

I love the use of identity hash code instead of address bits. There might be an 
issue with displaced markWords though where we need to be careful.

src/hotspot/share/prims/jvmtiTagMapTable.cpp line 116:

> 114: 
> 115: JvmtiTagMapEntry* JvmtiTagMapTable::find(oop obj) {
> 116:   if (obj->has_no_hash()) {

This new function you added checks if the markWord has a hashCode. If there is 
a displaced markWord, then it very well might be that there is a hashCode, but 
it is in the displaced markWord - either in a stack lock or an ObjectMonitor. 
Bailing here does not seem correct, as it might actually be in the table even 
if there is no hashCode in the markWord. Is this an optimization?

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

Changes requested by eosterlund (Reviewer).

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

Reply via email to