RFR: 8263771: Refactor javaClasses initialization code to isolate dumping code

David Holmes dholmes at openjdk.java.net
Thu Mar 18 13:07:45 UTC 2021


On Thu, 18 Mar 2021 11:45:59 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> There is code in javaClasses that has a regular path and a CDS dump path. The latter is executed by the VMThread and can never throw exceptions, while the former can. If we refactor this we can simplify the exception management code. 
>> 
>> Testing: 
>>  - runtime/cds locally
>>  - tiers 1-3
>> 
>> Thanks,
>> David
>
> src/hotspot/share/classfile/javaClasses.cpp line 897:
> 
>> 895:     if (fd->field_type() != T_OBJECT) {
>> 896:       initialize_static_primitive_field(fd, mirror);
>> 897:     } else {
> 
> This is a bit unnerving that there's no T_ARRAY here. Can you add an assert(!T_ARRAY, "unexpected");  Static field types cannot be T_ARRAY really?

This code is not as generic as the naming might make it might appear, you can either have a primitive or a String as this relates to ConstantValue attributes.

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

PR: https://git.openjdk.java.net/jdk/pull/3066


More information about the hotspot-runtime-dev mailing list