[lworld] RFR: 8280164: [lworld] Generate Preload attribute to enumerate value classes encountered
Aggelos Biboudis
duke at openjdk.java.net
Wed Jan 19 13:45:53 UTC 2022
On Tue, 18 Jan 2022 18:45:18 GMT, Srikanth Adayapalam <sadayapalam at openjdk.org> wrote:
> Modelled after InnerClasses attribute generation, we may be generating more information than necessary/useful but this is initial cut
I would expect all V* classes to be part of the `Preload`'s, `classes` field. Maybe my understanding is wrong. I checked with `javap` and it reports only one:
Classes to be preloaded:
#14; // value class PreloadAttributeTest$X
In any case, even if my understanding is wrong, can we use the same style as in `test/langtools/tools/javac/valhalla/value-objects/ValueCreationTest.java` to assert that the contents of the `Preload` attribute are the expected ones? (in this case 1).
What do you think? Otherwise it looks good.
src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/PoolWriter.java line 98:
> 96: LinkedHashSet<ClassSymbol> innerClasses = new LinkedHashSet<>();
> 97:
> 98: HashSet<ClassSymbol> valueClasses = new HashSet<>();
nitpicking:`Set` instead of `HashSet` for the type definition? (hm, the interface is used below in line 101 but not in the line 96 above)
-------------
PR: https://git.openjdk.java.net/valhalla/pull/605
More information about the valhalla-dev
mailing list