RFR: 8369742: Link AOT-linked classes at JVM bootstrap [v3]

Ioi Lam iklam at openjdk.org
Thu Oct 16 03:56:49 UTC 2025


On Wed, 15 Oct 2025 18:06:00 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> src/hotspot/share/cds/aotLinkedClassBulkLoader.cpp line 350:
>> 
>>> 348: // With AOT-linked classes, we could compile nmethods before the ServiceThread
>>> 349: // has been started, so we must delay the events to be posted later.
>>> 350: void AOTLinkedClassBulkLoader::add_delayed_compiled_method_load_event(nmethod* nm) {
>> 
>> I don't think it should be done in `AOTLinkedClassBulkLoader`.  Please move it to `nmethod.*` files
>
> This only affects native wrappers as I understand which are generated by Shared runtime. JIT compilers are not initialized yet.  May be update comment to be clear: "With AOT-linked classes, we could compile wrappers for native methods before the ServiceThread"

I moved the code into nmethod.cpp. I originally thought that there might be other events that need to be handled similarly, so aotLinkedClassBulkLoader.cpp seemed to be a good central place to do that.

However, after looking at all uses of `ServiceThread::enqueue_deferred_event()`, this seems to be the only cases that needs special handling. So nmethod.cpp is a good place.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27783#discussion_r2434485324


More information about the hotspot-dev mailing list