RFR: 8360707: Globally enumerate all blobs, stubs and entries [v7]

Vladimir Kozlov kvn at openjdk.org
Mon Jul 7 21:14:53 UTC 2025


On Sun, 6 Jul 2025 16:57:12 GMT, Andrew Dinn <adinn at openjdk.org> wrote:

>> Use the blob, stub and entry declarations to generate a single global enumeration for all blobs, likewise for all stubs and all entries. Modify stub generators in shared runtime, c1 runtime, c2 runtime and stub generator subsystems and their clients to use those enumerations consistently.
>
> 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 18 additional commits since the last revision:
> 
>  - Merge branch 'master' into enumerate_entries
>  - store stub id for opto stub Compile instances as a StubId
>  - save blobs using blob ids
>  - make arg in declaration consistent with definition
>  - fix format for copyright
>  - update copyrights
>  - fix inconsistent stub declarations
>  - fix formatting issues
>  - remove redundant doc comments
>  - fix copy paste errors in riscv
>  - ... and 8 more: https://git.openjdk.org/jdk/compare/266fd59e...dbc8394a

I found the cause of my local testing failure. I built with ubsan and hit [JDK-8360942](https://bugs.openjdk.org/browse/JDK-8360942) which I am working on. After applying the fix the test passed. Here other changes you may consider to include because they fix stack overflow stub generation:


diff --git a/src/hotspot/share/code/aotCodeCache.cpp b/src/hotspot/share/code/aotCodeCache.cpp
index 08cd05a64ed..4c080b90acc 100644
--- a/src/hotspot/share/code/aotCodeCache.cpp
+++ b/src/hotspot/share/code/aotCodeCache.cpp
@@ -1298,6 +1314,7 @@ void AOTCodeAddressTable::init_extrs() {
     SET_ADDRESS(_extrs, SharedRuntime::resolve_opt_virtual_call_C);
     SET_ADDRESS(_extrs, SharedRuntime::resolve_virtual_call_C);
     SET_ADDRESS(_extrs, SharedRuntime::resolve_static_call_C);
+    SET_ADDRESS(_extrs, SharedRuntime::throw_StackOverflowError);
     SET_ADDRESS(_extrs, SharedRuntime::throw_delayed_StackOverflowError);
     SET_ADDRESS(_extrs, SharedRuntime::throw_AbstractMethodError);
     SET_ADDRESS(_extrs, SharedRuntime::throw_IncompatibleClassChangeError);
diff --git a/src/hotspot/share/runtime/init.cpp b/src/hotspot/share/runtime/init.cpp
index b54afd9f735..37c13d90e04 100644
--- a/src/hotspot/share/runtime/init.cpp
+++ b/src/hotspot/share/runtime/init.cpp
@@ -147,9 +150,9 @@ jint init_globals() {
   AsyncLogWriter::initialize();

   initial_stubs_init();      // initial stub routines
+  AOTCodeCache::init_early_stubs_table();  // need this after initial_stubs and before generate_initial_stub
   // stack overflow exception blob is referenced by the interpreter
   SharedRuntime::generate_initial_stubs();
-  AOTCodeCache::init_early_stubs_table();  // need this after initial_stubs
   gc_barrier_stubs_init();   // depends on universe_init, must be before interpreter_init
   continuations_init();      // must precede continuation stub generation
   continuation_stubs_init(); // depends on continuations_init

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

PR Comment: https://git.openjdk.org/jdk/pull/26004#issuecomment-3046535698


More information about the shenandoah-dev mailing list