On Fri, 4 Aug 2023 14:37:07 GMT, Coleen Phillimore <cole...@openjdk.org> wrote:
> This patch fixes Wconversion in code in the src/hotspot/share/prims > directory. Most of the changes correct the types. jfieldID's are created > with the int offset returned by InstanceKlass::field_offset(). > int field_offset (int index) const { return > field(index).offset(); } > > So when we get the field offset back, it's an int. > > Also stackwalker passes jlong, so made that consistent. > > Tested with tier1 on Oracle supported platforms. src/hotspot/share/prims/methodHandles.cpp line 910: > 908: InstanceKlass* defc = > InstanceKlass::cast(java_lang_Class::as_Klass(clazz)); > 909: DEBUG_ONLY(clazz = nullptr); // safety > 910: intptr_t vmindex = java_lang_invoke_MemberName::vmindex(mname()); Why not do the checked_cast<int> here instead of below? Ideally, the vmindex field would be changed to int (field offsets, itable/vtable indexes are all int), but that's more work. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/15160#discussion_r1284883812