RFR: 8364269: Simplify code cache API by storing adapter entry offsets in blob [v2]

Andrew Dinn adinn at openjdk.org
Thu Aug 7 13:57:52 UTC 2025


On Wed, 30 Jul 2025 16:36:13 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

>> Andrew Dinn has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:
>> 
>>  - Merge branch 'master' into JDK-8364269
>>  - simplify code cache API by storing adapter entry offsets in blob
>
> If the entry offsets are stored in `AdapterBlob`, `AdapterHandlerEntry` can then just store a pointer to the blob and get rid of the offsets. `SharedRuntime::generate_i2c2i_adapters` can be updated to return the AdapterBlob. And when storing the AdapterHandlerEntry, pointer to the blob can be cleared and restored in `AdapterHandlerLibrary::lookup_aot_cache`.
> This assumes the AdapterBlob won't be moved around in the code cache.
> @adinn does this make sense?

@ashu-mehra 
> If the entry offsets are stored in AdapterBlob, AdapterHandlerEntry can then just store a pointer to the blob and get rid of the offsets.

I planned that originally but it doesn't work because of one special case. Method `AdapterHandlerLibrary::create_abstract_method_handler` does this:

  address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
  _abstract_method_handler = AdapterHandlerLibrary::new_entry(AdapterFingerPrint::allocate(0, nullptr));
  _abstract_method_handler->set_entry_points(SharedRuntime::throw_AbstractMethodError_entry(),
                                             wrong_method_abstract,
                                             wrong_method_abstract,
                                             nullptr);

So, in this one case we have a Frankenstein handler assembled from 3 disparate entry  points (+ nullptr) which are not derived from an associated adapter blob.

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

PR Comment: https://git.openjdk.org/jdk/pull/26532#issuecomment-3139109309


More information about the hotspot-dev mailing list