[lworld] RFR: 8364034: [lworld] Pre-register boxing classes in class loaders [v2]

Coleen Phillimore coleenp at openjdk.org
Fri Jul 25 13:01:36 UTC 2025


On Thu, 24 Jul 2025 17:00:47 GMT, Frederic Parain <fparain at openjdk.org> wrote:

>> Add pre-registration of boxing classes when a class loader is registered by the VM.
>
> Frederic Parain has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove comment

This came out quite nice by reusing the similar CDS code.

src/hotspot/share/classfile/systemDictionary.cpp line 210:

> 208:                                       ClassLoaderDataGraph::find_or_create(class_loader);
> 209:   }
> 210:   if (class_loader() != nullptr && cld->dictionary() != nullptr) {

I think this can just go in the 'else' statement and then you don't have to test if the dictionary is null.   Also, rather than ADD_WRAPPER_CLASS, can you make it function that takes the whole name with vmSymbols::java_lang_<name> since I think you anticipate adding other classes to this.

To this static function, pass JavaThread* current as the first parameter, so it doesn't have to call Thread::current() for each Handle.  It's not that bad for performance anymore but I still don't like that we have it.

Maybe:

static void add_wrapper_class(JavaThread* current, Symbol* classname).

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

PR Review: https://git.openjdk.org/valhalla/pull/1517#pullrequestreview-3055310489
PR Review Comment: https://git.openjdk.org/valhalla/pull/1517#discussion_r2231024374


More information about the valhalla-dev mailing list