[lworld] RFR: 8372515: [lworld] Plumb in javac flags for compiling with preview mode [v2]
David Beaumont
duke at openjdk.org
Tue Dec 16 12:00:14 UTC 2025
On Wed, 10 Dec 2025 10:28:59 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> David Beaumont has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove note about StableValue (not possible)
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java line 1587:
>
>> 1585: } else if (proxy.type.tsym == syms.valueBasedType.tsym && sym.kind == TYP) {
>> 1586: sym.flags_field |= VALUE_BASED;
>> 1587: } else if (!DISABLE_PREVIEW_PATCHING
>
> Currently, the migrated value classes are marked with `@jdk.internal.MigratedValueClass` (or the corresponding javac-internal annotation). And this code will mark such classes as value-based, even if the original classfile is not the preview classfile. This has a similar real-world effect as reading the appropriate preview class, but this annotation is AFAIK only temporary. So if the new approach is enabled, we disable the special handling of the annotation, and rely on reading the appropriate preview class. This is to see the eventual effect of enabling the support for preview classes inside JRT FS, and abandoning migrated value class.
I think I get it. I'll try to sum it up in a comment since this is so subtle.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1761#discussion_r2622550524
More information about the valhalla-dev
mailing list