RFR: 8275731: CDS archived enums objects are recreated at runtime [v3]

Coleen Phillimore coleenp at openjdk.java.net
Fri Feb 25 15:01:54 UTC 2022


On Wed, 19 Jan 2022 05:44:10 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> src/hotspot/share/cds/heapShared.cpp line 433:
>> 
>>> 431:   oop mirror = k->java_mirror();
>>> 432:   int i = 0;
>>> 433:   for (JavaFieldStream fs(k); !fs.done(); fs.next()) {
>> 
>> This seems like it should also use InstanceKlass::do_local_static_fields.
>
> Converting this to InstanceKlass::do_nonstatic_fields() is difficult because the loop body references 7 different variables declared outside of the loop. 
> 
> One thing I tried is to add a new version of do_nonstatic_fields2() that supports C++ lambdas. You can see my experiment from here: 
> 
> https://github.com/openjdk/jdk/compare/master...iklam:lambda-for-instanceklass-do_local_static_fields2?expand=1
> 
> I changed all my new code to use the do_nonstatic_fields2() function with lambda.

Ok, if it requires lambdas and additional change, never mind then.

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

PR: https://git.openjdk.java.net/jdk/pull/6653


More information about the core-libs-dev mailing list