git: openjdk/leyden: created branch premain based on the branch computed-constants containing 1 unique commit

Ioi Lam ioi.lam at oracle.com
Tue Aug 8 21:21:46 UTC 2023


Hi Dan, thanks for looking into this. The comment is definitely wrong about MethodTypes. In fact in the premain branch, CDS caches all the MethodTypes::internTable in the because they are tested for equality.

The comment should probably be changed to something like:

MethodTypes does not have a public constructor. All MethodTypes are created by factory methods and are stored in MethodType::internTable. Therefore, any MethodTypes in static fields can be safely archived as long as internTable is archived.

Ioi
________________________________
From: leyden-dev <leyden-dev-retn at openjdk.org> on behalf of Dan Heidinga <heidinga at redhat.com>
Sent: Tuesday, August 8, 2023 1:17 PM
To: leyden-dev at openjdk.org <leyden-dev at openjdk.org>
Subject: Re: git: openjdk/leyden: created branch premain based on the branch computed-constants containing 1 unique commit

I'm reading through the code in the premain branch (which looks very cool though I'm still wrapping my head around it) and had an early question about the cdsHeapVerifier.cpp:

> void CDSHeapVerifier::add_static_obj_field(InstanceKlass* ik, oop field, Symbol* name) {
>   if (field->klass() == vmClasses::MethodType_klass() ||
>       field->klass() == vmClasses::LambdaForm_klass()) {
>     // LambdaForm and MethodType are non-modifiable and are not tested for object equality, so
>     // it's OK if the static fields are reinitialized at runtime with alternative instances.
>     // (TODO: double check is this is correct)
>     return;
>   }

I can't speak to LambdaForms but MethodTypes definitely rely on equality for correct behaviour when invoking - see Invokers.java::checkExactType which is part of every MethodHandles.invokeExact call.  Is this kind of equality test something this code should be concerned about?

I may be looking at this in the wrong way but thought I'd chime in as I read the diff in case this helps.

--Dan

On Tue, Aug 8, 2023 at 2:30 PM duke <duke at openjdk.org<mailto:duke at openjdk.org>> wrote:
The following commits are unique to the premain branch:
========================================================
626b62aa: Initial commit

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20230808/3ddb1576/attachment.htm>


More information about the leyden-dev mailing list