RFR: 8313785: Fix -Wconversion warnings in prims code
Dean Long
dlong at openjdk.org
Fri Aug 4 22:04:29 UTC 2023
On Fri, 4 Aug 2023 14:37:07 GMT, Coleen Phillimore <coleenp at 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/jvm.cpp line 612:
> 610: // as implemented in the classic virtual machine; return 0 if object is null
> 611: return handle == nullptr ? 0 :
> 612: checked_cast<jint>(ObjectSynchronizer::FastHashCode (THREAD, JNIHandles::resolve_non_null(handle)));
What about making FastHashCode return jint?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15160#discussion_r1284876719
More information about the serviceability-dev
mailing list