On Fri, 29 Jul 2022 21:05:19 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> Please review this change to fix JDK-8291360.  This fix adds entry points 
>> getClassFileVersion() and getClassAccessFlagsRaw() to class java.lang.Class. 
>>  The new entry points return the current class's class file version and its 
>> raw access flags.
>> 
>> The fix was tested by running Mach5 tiers 1-2 on Linux, Mac OS, and Windows, 
>> and Mach5 tiers 1-3 on Linux x64.  Additionally, the JCK lang, vm, and api 
>> tests and new regression tests were run locally on Linux x64.
>> 
>> Thanks, Harold
>
> src/hotspot/share/prims/jvm.cpp line 4059:
> 
>> 4057:     return JVM_CLASSFILE_MAJOR_VERSION;
>> 4058:   }
>> 4059:   assert(!java_lang_Class::as_Klass(mirror)->is_array_klass(), 
>> "unexpected array class");
> 
> Can this throw IllegalArgumentException instead.
> Asserts only report problems when built with debug (Right?)

Or, Can the VM do this traversal as/more efficiently than doing at the java 
level?

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

PR: https://git.openjdk.org/jdk/pull/9688

Reply via email to