RFR: 8295124: Atomic::add to pointer type may return wrong value [v3]

Kim Barrett kbarrett at openjdk.org
Thu Oct 20 22:29:04 UTC 2022


> Please review this change to the handling of Atomic pointer arithmetic. When
> the value being modified is a pointer `P*`, the type of the value in the
> destination passed to the platform operation is `const char*`, so a pointer
> type whose pointee is size 1. This allows the platform operation to just treat
> the arithmetic as a simple byte adjustment.
> 
> To demonstrate the problem described in the bug (possible incorrect result for
> Atomic pointer arithmetic) and show that it is now fixed, this change also
> includes some gtests for Atomic operations, including pointer arithmetic which
> fails before the change and succeeds after.
> 
> Testing: mach5 tier1-3

Kim Barrett has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:

 - Merge branch 'master' into test-atomic
 - conditionalize 64bit tests on 64bit platform
 - shared conversion of pointer type
 - add more gtests of Atomic

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10667/files
  - new: https://git.openjdk.org/jdk/pull/10667/files/e44e81cd..87d98eee

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10667&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10667&range=01-02

  Stats: 29786 lines in 1219 files changed: 16401 ins; 8377 del; 5008 mod
  Patch: https://git.openjdk.org/jdk/pull/10667.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10667/head:pull/10667

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


More information about the hotspot-runtime-dev mailing list