On Wed, 19 Jan 2022 05:44:10 GMT, Ioi Lam <ik...@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