RFR: 8364187: Make getClassAccessFlagsRaw non-native [v2]

Roger Riggs rriggs at openjdk.org
Wed Jul 30 20:27:55 UTC 2025


On Tue, 29 Jul 2025 19:42:42 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Fields are initialized by injection in javaClasses instead of through this constructor, so it's easy for us to accidentally forget to inject a field.
>
> For IDENTITY, I didn't have to inject that one because the Java code knew when to set it, not the JVM code reading the data out of the classfile.  And the logic belongs in the Java code, not the JVM. This one comes from the classfile, there isn't another way to get the information to the java.lang.Class.

The VM and Java use the same logic for the value of isIdentity(). 
It is computed from as many a 5 fields/flags. At present, it has to be computed on each call to Class.isIdentity().
It would be reasonable to compute the value once in the constructor, but the code in the constructor is not run.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26517#discussion_r2243785633


More information about the core-libs-dev mailing list