[foreign-memaccess] RFR: 8257075: MemoryAcccess methods are missing @ForceInline annotations

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Nov 25 12:43:18 UTC 2020


This patch adds missing `@ForceInline` annotations to the various accessors in the `MemoryAccess` class. The lack of said annotations causes performance to deteriorate when many calls to the static accessors are packed into a single hot method.
I've also added a new benchmark to verify that unrolled loops using memory access API (whether usingVH directly, or statics in `MemoryAccess`) are on par with unsafe access. This benchmark is heavily borrowed from a benchmark submitted
by Antoine Chambille (thanks!):

https://mail.openjdk.java.net/pipermail/panama-dev/2020-November/011444.html

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

Commit messages:
 - Add @ForceInline annotations to MemoryAccess methods

Changes: https://git.openjdk.java.net/panama-foreign/pull/401/files
 Webrev: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=401&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8257075
  Stats: 194 lines in 2 files changed: 194 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/401.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/401/head:pull/401

PR: https://git.openjdk.java.net/panama-foreign/pull/401


More information about the panama-dev mailing list