[lworld] RFR: 8363846: [lworld] Make Class.isIdentityClass() non-native [v2]

Roger Riggs rriggs at openjdk.org
Wed Jul 23 14:15:06 UTC 2025


On Wed, 23 Jul 2025 11:59:49 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This moves isIdentityClass() implementation to Class.java, and checks within the JVM that is_identity_class() doesn't check the access flags for an ArrayKlass, since AccessFlags aren't initialized in ArrayKlasses.  The AccessFlags should be moved from Klass.hpp to InstanceKlass.cpp in mainline but that's a more complicated change and has several pieces.
>> Added a test.
>> Tested with tier1 locally.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add a test for not enable preview.

For new tests we use junit. 
See other tests like UseValueClassTest for imports and per test annotations.

test/jdk/valhalla/valuetypes/IsIdentityClassTest.java line 68:

> 66:             assertFalse(ValueClass.isFlatArray(array0));
> 67:         }
> 68:         assertFalse(Integer.class.isIdentity(), "Integer is not an IDENTITY type");

This test should be sensitive to whether enable-preview is true.
It should have failed in the second run. 
But due to the TEST.properties (enablePreview = true) it overrides the command line in the test.
Removing enablePreview in TEST.properties is the right fix for that but then another test needs a fix.
The RecursiveValueClass test will need to have @enablePreview added to each of its test runs.

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

PR Review: https://git.openjdk.org/valhalla/pull/1514#pullrequestreview-3047648355
PR Review Comment: https://git.openjdk.org/valhalla/pull/1514#discussion_r2225740147


More information about the valhalla-dev mailing list