RFR: Restore Method pointer for every AOTCodeEntry [v4]

Ashutosh Mehra asmehra at openjdk.org
Tue Aug 12 03:39:05 UTC 2025


> There was a recent commit [0] that included code to invalidate preload entry when invalidating a normal `AOTCodeEntry`. This is done by reaching out to the preload entry through the normal `AOTCodeEntry::_method`:
> 
> https://github.com/openjdk/leyden/blob/7b7648a4c9f67be509c6fccbcbc0502648388fdc/src/hotspot/share/code/aotCodeCache.cpp#L1056-L1070
> 
> But unfortunately `AOTCodeEntry::_method` is restored only for the entries marked for preload:
> https://github.com/openjdk/leyden/blob/7b7648a4c9f67be509c6fccbcbc0502648388fdc/src/hotspot/share/code/aotCodeCache.cpp#L1938-L1939
> 
> This PR fixes this bug by restoring `AOTCodeEntry::_method` for all AOTCodeEntry-s. This is achieved by using AOTCache's pointer bitmap to track `AOTCodeEntry::_method`. It removes the need to store method offset separately in the AOTCodeEntry.
> It also fixes a couple of related bugs:
> 1. In `AOTCodeCache::finish_write()` it is possible that the AOTCodeEntry array is not properly aligned.
> 2. When invalidating a preload entry, it is possible that the entry has not been loaded. This triggers the assert that expects an entry to be invalidated is always loaded.
> 
> [0] https://github.com/openjdk/leyden/commit/392fbbb1859cd71521cb915b601a65cf59ba495b

Ashutosh Mehra has updated the pull request incrementally with one additional commit since the last revision:

  Modify cpu feature name iteration code to avoid subtle bug like missing
  i++ in get_missing_features_name()
  
  Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>

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

Changes:
  - all: https://git.openjdk.org/leyden/pull/90/files
  - new: https://git.openjdk.org/leyden/pull/90/files/a8fdf977..29fd346c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=leyden&pr=90&range=03
 - incr: https://webrevs.openjdk.org/?repo=leyden&pr=90&range=02-03

  Stats: 16 lines in 2 files changed: 4 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/leyden/pull/90.diff
  Fetch: git fetch https://git.openjdk.org/leyden.git pull/90/head:pull/90

PR: https://git.openjdk.org/leyden/pull/90


More information about the leyden-dev mailing list