RFR: 8343837: Remove unnecessary reinterpret_cast from C2AccessValuePtr

theoweidmannoracle duke at openjdk.org
Fri Nov 8 13:31:20 UTC 2024


C2AccessValuePtr contains a reinterpret cast from TypePtr* to its base class Type*. This cast was added in [JDK-8202377](https://bugs.openjdk.org/browse/JDK-8202377), due to a circular dependency problem, which no longer exists. The code compiles fine without it and this cast was removed.

Furthermore, a downcast from Type* to TypePtr* exists in this class using reinterpret_cast. This is replaced with the less powerful and more safe static_cast.

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

Commit messages:
 - Remove reinterpret_cast

Changes: https://git.openjdk.org/jdk/pull/21977/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21977&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8343837
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/21977.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21977/head:pull/21977

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


More information about the hotspot-dev mailing list