RFR: 8365661: oops/resolvedMethodEntry.hpp could use default copy constructor

Francesco Andreuzzi duke at openjdk.org
Mon Aug 18 08:38:34 UTC 2025


We may replace the non-default copy constructor and assignment with the default ones. It seems that all we have to do is a member-wise shallow copy. This would also make the class `TriviallyCopiable`.

This change fixes a build failure I'm getting with clang20: [`memset(this, 0, sizeof(*this))`](https://github.com/openjdk/jdk/blob/master/src/hotspot/share/oops/resolvedMethodEntry.cpp#L43) is not acceptable unless the class is trivially copyable (`-Wtrivial-copy`).

Testing:
- [x] tier1 fast-debug
- [x] tier2 fast-debug

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

Commit messages:
 - use copy ctor

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

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


More information about the hotspot-dev mailing list