RFR: Enable field access instrumentation for aarch64

eric.1iu github.com+10482586+erik1iu at openjdk.java.net
Tue May 26 14:50:16 UTC 2020


This patch enables field access instrumentation for aarch64.

According to the implementation of x86, this patch inserts TSAN
functions in interpreter (templateTable_aarch64.cpp) at three places
which can cover all field accesses:

  1. getfield_or_static
  2. putfield_or_static
  3. load_field_cp_cache_entry

This patch implements the annotation
'java.util.concurrent.annotation.LazyInit', which causes TSAN to ignore
races on that field. References that marked by @LazyInit are not simply
ignored, but a release/acquire is performed on them. This is so that any
following accesses to its member variables are not also reported as race.

This patch also moves some architecture independent code into common
files.

TODO:
  - Array access instrumentation will be updated in later patch.

[Tests]
test/hotspot/jtreg/tsan/RacyByteMemberLoopTest.java
test/hotspot/jtreg/tsan/RacyCharMemberLoopTest.java
test/hotspot/jtreg/tsan/RacyShortMemberLoopTest.java
test/hotspot/jtreg/tsan/RacyIntMemberLoopTest.java
test/hotspot/jtreg/tsan/RacyFloatMemberLoopTest.java
test/hotspot/jtreg/tsan/RacyLongMemberLoopTest.java
test/hotspot/jtreg/tsan/RacyDoubleMemberLoopTest.java
test/hotspot/jtreg/tsan/LazyInitLoopTest.java
test/hotspot/jtreg/tsan/LazyInitReferenceLoopTest.java

With this patch, those test cases above passed on aarch64.
No new failure found on x86.

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

Commit messages:
 - [TSAN] Enable field access instrumentation for aarch64

Changes: https://git.openjdk.java.net/tsan/pull/11/files
 Webrev: https://webrevs.openjdk.java.net/tsan/11/webrev.00
  Stats: 226 lines in 5 files changed: 168 ins; 52 del; 6 mod
  Patch: https://git.openjdk.java.net/tsan/pull/11.diff
  Fetch: git fetch https://git.openjdk.java.net/tsan pull/11/head:pull/11

PR: https://git.openjdk.java.net/tsan/pull/11


More information about the tsan-dev mailing list