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

Lois Foltan lfoltan at openjdk.java.net
Thu Mar 18 14:37:40 UTC 2021


On Thu, 18 Mar 2021 13:04:50 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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.

I would rather have line #895 check for "if (is_java_primitive(fd->field_type())"  that ensures that future value type support will be handled correctly.

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

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


More information about the hotspot-runtime-dev mailing list