RFR: 8313785: Fix -Wconversion warnings in prims code [v2]
David Holmes
dholmes at openjdk.org
Mon Aug 7 05:56:41 UTC 2023
On Fri, 4 Aug 2023 23:06:54 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> 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?
>
> I briefly had a look at that but that's a bit more fan-out from code in synchronizer.cpp and other callers.
I agree with Coleen, we use intptr_t all through the markWord code and we can't change all that (not that we would want to) so converting to jint before we leave the VM seems the best place to do it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/15160#discussion_r1285396390
More information about the hotspot-dev
mailing list