RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v4]

Adam Sotona asotona at openjdk.org
Thu May 9 09:50:57 UTC 2024


On Tue, 7 May 2024 18:47:34 GMT, Chen Liang <liach at openjdk.org> wrote:

>> Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 28 commits:
>> 
>>  - Merge branch 'master' into JDK-8320396-verifier-extension
>>  - added references to jvms
>>  - Merge remote-tracking branch 'openjdk/master' into JDK-8320396-verifier-extension
>>  - work in progress
>>  - work in progress
>>  - work in progress
>>  - work in progress
>>  - work in progress
>>  - removed string templates from test
>>  - work in progress
>>  - ... and 18 more: https://git.openjdk.org/jdk/compare/ae82405f...3ebc780a
>
> src/java.base/share/classes/jdk/internal/classfile/impl/verifier/ParserVerifier.java line 167:
> 
>> 165:             }
>> 166:             if (m.methodName().equalsString(CLASS_INIT_NAME)
>> 167:                     && !m.flags().has(AccessFlag.STATIC)) {
> 
> Do we verify it has void return and (since class file version JAVA 7) takes no args? The static requirement is since JAVA 7 too.

This is a first round of transcription from `classFileParser.cpp` and I most probably missed many verifications applied there. Feel free to point to a specific verification code in the `classFileParser.cpp` I missed, however to avoid very complex synchronization I preferred to do not invent a custom list of verifications. Relevant parts are widely spread across the specifications and collecting and tracking them would be very complex task.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16809#discussion_r1595228471


More information about the compiler-dev mailing list