Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8297539

Use PrimitiveConversions::cast for local uses of the int<->float union conversion trick

XMLWordPrintable

    • b17

      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.

            azafari Afshin Zafari
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: