RFR: Restore Method pointer for every AOTCodeEntry
Vladimir Kozlov
kvn at openjdk.org
Thu Aug 7 18:47:20 UTC 2025
On Thu, 7 Aug 2025 18:16:55 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
> There was a recent commit 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.
This is very nice. Thank you, @ashu-mehra. I will test it before approval.
I assume using `_method` instead of signature hash in `find_code_entry()` will be separate change. Right?
-------------
PR Review: https://git.openjdk.org/leyden/pull/90#pullrequestreview-3098374762
More information about the leyden-dev
mailing list