The fix for JDK-8295351 reemployed the basic union trick for converting int<->float in sharedRuntime.cpp. But we also have the the existing JavaValue type which is also a union and can be used for the same conversion trick. And then we also have the cast function in metaprogramming/primitiveConversions.hpp. There may be other cases too.
It would be good if we could standardise on the use of this technique so that we don't duplicate it in numerous places.
Note this RFE is to fix the int<->float union conversion tricks found in various bits of code to use PrimitiveConversions::cast() and not to change JavaValue. Changing JavaValue (if there's a reason to do this) needs to be explored in another RFE.
This RFE moves in the direction of consolidation towards calling PrimitiveConversions::cast.
It would be good if we could standardise on the use of this technique so that we don't duplicate it in numerous places.
Note this RFE is to fix the int<->float union conversion tricks found in various bits of code to use PrimitiveConversions::cast() and not to change JavaValue. Changing JavaValue (if there's a reason to do this) needs to be explored in another RFE.
This RFE moves in the direction of consolidation towards calling PrimitiveConversions::cast.
- relates to
-
JDK-8293117 Add atomic bitset functions
- Resolved
-
JDK-8247909 Improve PrimitiveConversions::cast using C++14
- Resolved
-
JDK-8299688 Adopt C++14 compatible std::bit_cast introduced in C++20
- Closed
-
JDK-8279143 Undefined behaviours in globalDefinitions.hpp
- In Progress
(2 links to)