RFR: 8160404: RelocationHolder constructors have bugs [v2]

Kim Barrett kbarrett at openjdk.org
Fri Dec 16 04:48:46 UTC 2022


On Thu, 15 Dec 2022 12:00:32 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Kim Barrett has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   blank lines in include blocks
>
> src/hotspot/share/code/relocInfo.hpp line 859:
> 
>> 857:   // We never heap allocate a Relocation, so never delete through a base pointer.
>> 858:   // RelocationHolder depends on (and verifies) the destructor for all relocation
>> 859:   // types is trivial, so can't be virtual.
> 
> Should this be:
> Suggestion:
> 
>   // types is trivial, so can be non-virtual.
> 
> ?

We have a requirement that the derived classes have trivial destructors (so we know it's safe to just construct over the storage without first destructing the old object).  Hence this destructor must *not* be virtual, as that would make it and destructors for derived classes not trivial.  I expanded the comment a bit to clarify that.

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

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


More information about the hotspot-compiler-dev mailing list