RFR: 8271569: Rename cdsoffsets.cpp to cdsConstants.cpp [v2]

Ioi Lam iklam at openjdk.java.net
Mon Sep 13 20:42:58 UTC 2021


On Mon, 13 Sep 2021 20:25:46 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> Changed cdsOffsets.cpp to cdsConstants.cpp, now the offsets and constants are initialized static and searched separately.
>> The offsets array could not use 'constexpr' since g++ on MacOs and VSC++ on Windows complained reinterpret_cast in 'offset_of' should not be used in constexpr initialization. Changed some field access for forming global list first.
>> 
>> Note with 'git mv' to rename cdsoffset.cpp to cdsConstants.cpp, same for cdsoffsets.hpp to cdsConstants.hpp, due to the contents changed more than 50% so git will not think cdsConstants.cpp is renamed from cdsoffsets.cpp. Instead, it is regarded as a new file.
>> 
>> Tests: ter1-4
>> 
>> Thanks
>> Yumin
>
> Yumin Qi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make array of offsets and constants member of class CDSConstants and made CDSConstants a friend class of accessed classes

Changes requested by iklam (Reviewer).

src/hotspot/share/cds/cdsConstants.cpp line 49:

> 47:   { "dynamic_magic",                (int)CDS_DYNAMIC_ARCHIVE_MAGIC },
> 48:   { "int_size",                     sizeof(int)                    },
> 49:   { "CDSFileMapRegion_size",        sizeof(CDSFileMapRegion)       },

Should be `(int)sizeof(int)` because the type of `sizeof(...)` is implementation-defined. See https://en.cppreference.com/w/cpp/types/size_t

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

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


More information about the hotspot-runtime-dev mailing list