RFR: 8313708: NMT: cleanup _mst_marker

Gerard Ziemski gziemski at openjdk.org
Fri Aug 11 00:35:01 UTC 2023


While learning the NMT code I came across _mst_marker and I don't really like how it combines 16bit index and 16bit position into single 32bit mst_marker using bit sizzling.

Consequently, right now we need the following 3 APIs: build_marker(), bucket_idx_from_marker(), pos_idx_from_marker() to support this. They are really not adding any value, in my opinion, and in fact obfuscate the code.

I'd like to propose that we simplify the code and pass a struct value (as suggested by Thomas) which hides away the 2 individual fields that are implementation detail.

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

Commit messages:
 - fix whitespaces
 - rename ASSERT_MALLOCSITE_TABLE_BUCKET
 - use struct to hide the 2 bucket fields
 - cleanup _mst_marker

Changes: https://git.openjdk.org/jdk/pull/15145/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15145&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8313708
  Stats: 117 lines in 6 files changed: 48 ins; 17 del; 52 mod
  Patch: https://git.openjdk.org/jdk/pull/15145.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15145/head:pull/15145

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


More information about the hotspot-runtime-dev mailing list