Hang Shao

Results 66 comments of Hang Shao

This is related to https://github.com/eclipse-openj9/openj9/pull/15497. JCL has a private helper in class `PrimitiveObjectMethods` that calculates the VT hash code: ` private static int primitiveObjectHashCode(Object o)`

@ehrenjulzert will be look at this.

Doing call-in inside existing native method `convertValueToHash()` is not an option, see the discussions here: https://github.com/eclipse-openj9/openj9/pull/15741.

> Can objects referenced by a valid value type be forwarded pointers? I guess it is only possible if it is inside the GC code. If it is in the...

I believe the recursive call issue also applies to `VM_ValueTypeHelpers::isSubstitutable()`: https://github.com/eclipse-openj9/openj9/blob/df2f3a3524957ff9e59c6861992f8195beb24aa6/runtime/vm/ValueTypeHelpers.hpp#L69 @ehrenjulzert What is the behaviour of RI if there is a circularity in the value type ? i.e. A...

I agree that we don't have to worry about the possible stackoverflow issue for the time being. We have the same behaviour as RI and users may not really hit...

> If we still want to have suboptimal but working VT hashcodes right now I could instead just use reflection to call the existing PrimitiveObjectMethods.primitiveObjectHashCode method (as we discussed a...

There is a DDR version of `hashcode()` implementation, it needs to be updated to check value type as well: https://github.com/eclipse-openj9/openj9/blob/f6383e2713197f77acb78c717bebce32d68ab27d/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/j9/gc/GCObjectModel_V1.java#L325

There is a DDR command that returns the hashcode given an object address: https://github.com/eclipse-openj9/openj9/blob/master/debugtools/DDR_VM/src/com/ibm/j9ddr/vm29/tools/ddrinteractive/commands/HashCodeCommand.java#L41 The passed in object by the user could be either an identity object or a value...

You may want to add some testing code for this.