RFR: 8365558: Fix stub entry init and blob creation on Zero [v2]

Vladimir Kozlov kvn at openjdk.org
Fri Aug 15 11:02:26 UTC 2025


On Fri, 15 Aug 2025 11:00:01 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> Fix two problems with Zero blob/stub entry initialization:
>> 1. Stop Zero allocating AdapterBlobs for the default set of i2c2i adapters even though it cannot ever use them.
>> 2. Allow Zero to execute its stubgen init functions even though it is not generating code into a code buffer (i.e when blob size is declared as zero). This still allows it initialize entries to point to C functions. n.b. yhis was broken when [JDK-8359373](https://bugs.openjdk.org/browse/JDK-8359373) introduced the preuniverse Stubgen stub group.
>
> Andrew Dinn has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:
> 
>  - set zero stubgen blob sizes to zero
>  - restore error traps for zero adapter handle c2i entries
>  - Merge branch 'master' into JDK-8365558
>  - avoid  creating AdpaterBlobs on Zero where we cannto use them
>  - Execute stubgen stub create functions even on Zero when no code expected

src/hotspot/share/runtime/sharedRuntime.cpp line 2806:

> 2804:   // on Zero the blob may be null
> 2805:   handler->print_adapter_on(tty);
> 2806:   if (adapter_blob == nullptr) {

Should we move `handler->print_adapter_on(tty);` too after check?

src/hotspot/share/runtime/stubRoutines.cpp line 198:

> 196:       ls.print_cr("%s\t not generated", buffer_name);
> 197:       return nullptr;
> 198:     }

Wrong placement of `return nullptr;`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26787#discussion_r2277537337
PR Review Comment: https://git.openjdk.org/jdk/pull/26787#discussion_r2277539209


More information about the hotspot-dev mailing list