[foreign-jextract] RFR: 8253307: Simplify code in RuntimeHelper::lookupGlobalVariable

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Sep 17 20:43:01 UTC 2020


Earlier today, I added a workaround on RuntimeHelper when I tweaked it to use the new
MemoryAddress::asSegmentRestricted API. The old code was adding the lookup symbol as an attachment to the returned
segment, so I did a workaround to do just that under the new API.

Turns out that the workaround wasn't needed (I think). Upon more thinking, I realized that we always store an array of
LibraryLookup inside the very constant holder class - either as a static field, or as a dynamically loaded constant.

I think in both cases that should be enough to prevent the lookup object from going unreachable.

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

Commit messages:
 - Remove SymbolHolder from template class
 - Remove SymbolHolder workaround

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

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


More information about the panama-dev mailing list