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

Afshin Zafari duke at openjdk.org
Mon Mar 27 13:26:29 UTC 2023


**Only** the instances of using `union` for converting `int` to `float` are replaced with call to `PrimitiveConversions::cast<To>(From)` method. Some few cases with conversion of `long` <->`double` are also replaced with `PrimitiveConversions::cast<To>(From)`. The other instances where the union contains other types of fields than `int` and `float` are left unchanged.

### Test
local hotspot:tier1
mach5 tiers 1-5

-------------

Commit messages:
 - 8297539: Use PrimitiveConversions::cast for local uses of the int<->float union conversion trick
 - some more conversions are replaced with PrimitiveConversions::Cast
 - 8297539: Use PrimitiveConversions::cast for local uses of the int<->float union conversion trick
 - 8297539: Use PrimitiveConversions::cast for local uses of the int<->float union conversion trick

Changes: https://git.openjdk.org/jdk/pull/13136/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13136&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297539
  Stats: 51 lines in 5 files changed: 5 ins; 19 del; 27 mod
  Patch: https://git.openjdk.org/jdk/pull/13136.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13136/head:pull/13136

PR: https://git.openjdk.org/jdk/pull/13136


More information about the hotspot-dev mailing list