RFR: 8374149: [bworld] Define and use new null checking API [v4]

Vicente Romero vromero at openjdk.org
Wed Jan 7 14:37:03 UTC 2026


On Wed, 7 Jan 2026 12:20:56 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

>> Vicente Romero has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains nine additional commits since the last revision:
>> 
>>  - Merge branch 'bworld' into JDK-8374149
>>  - adding a flag
>>  - additional changes
>>  - minor changes
>>  - additional changes to Checks
>>  - Merge branch 'bworld' into JDK-8374149
>>  - additional changes
>>  - Merge branch 'bworld' into JDK-8374149
>>  - 8374149: [bworld] Define and use new null checking API
>
> src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java line 145:
> 
>> 143:         allowValueClasses = (!preview.isPreview(Source.Feature.VALUE_CLASSES) || preview.isEnabled()) &&
>> 144:                 Source.Feature.VALUE_CLASSES.allowedInSource(source);
>> 145:         String opt = Options.instance(context).get("useRuntimeChecks");
> 
> In principle this could be simplified to:
> 
> 
> hasRuntimeChecks = target.hasRuntimeChecks() && options.getBoolean("useRuntimeChecks", true);
> 
> 
> Right? E.g. emitting an error for the case where `useRuntimeChecks` is set, but the target is not compatible doesn't seem super important? (Also, how is this hidden flag used? Do we really need it?)

I don't think we super need it but could be useful for testing, but I can remove it

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1859#discussion_r2668691648


More information about the valhalla-dev mailing list