Skip to content

Commit

Permalink
Merge pull request #20642 from theresa-m/vt_lockword
Browse files Browse the repository at this point in the history
Don't assume lockword of class is at index 0
  • Loading branch information
hangshao0 authored Nov 26, 2024
2 parents fc778d6 + c7c6a13 commit c44f0de
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions runtime/jcl/common/java_lang_invoke_MethodHandleNatives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,8 +1368,15 @@ Java_java_lang_invoke_MethodHandleNatives_resolve(
target = (jlong)offset;
}
}

if ((0 != target) && ((0 != vmindex) || J9_ARE_ANY_BITS_SET(flags, MN_IS_METHOD | MN_IS_CONSTRUCTOR))) {
if (
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
/* In project Valhalla fields may start at offset 0. */
(NULL != new_clazz)
#else /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
(0 != target)
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
&& ((0 != vmindex) || J9_ARE_ANY_BITS_SET(flags, MN_IS_METHOD | MN_IS_CONSTRUCTOR))
) {
/* Refetch reference after GC point */
membernameObject = J9_JNI_UNWRAP_REFERENCE(self);
if (addMemberNameToClass(currentThread, membernameObject, new_clazz)) {
Expand Down

0 comments on commit c44f0de

Please sign in to comment.