RFR: 8330851: C2: More efficient TypeFunc creation

Vladimir Ivanov vlivanov at openjdk.org
Mon Nov 18 20:03:53 UTC 2024


On Sat, 16 Nov 2024 04:59:54 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:

>> src/hotspot/share/opto/type.cpp line 716:
>> 
>>> 714: 
>>> 715:   LockNode::lock_type_init();
>>> 716:   OptoRuntime::new_instance_Type_init();
>> 
>> I suggest to move the initialization code into `OptoRuntime`. As a benefit, you'll be able to directly access fields from there, so some trivial `init` methods won't be needed anymore.
>
> "first" call is made from here because of shared space. Otherwise the object-allocation will deleted and VM will crash. That's what I observed. And again that was the reason why the initialization call is made from `Type::Initialize_shared`.

My suggestion is about refactoring the code, so initialization is performed in `OptoRuntime` code (e.g., in `OptoRuntime::initialize_types()`). Then you call it from here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21782#discussion_r1847179850


More information about the hotspot-compiler-dev mailing list