On Wed, 3 Apr 2024 16:29:03 GMT, Vladimir Kozlov <k...@openjdk.org> wrote:

>> src/hotspot/share/code/codeBlob.hpp line 409:
>> 
>>> 407: 
>>> 408:   // GC/Verification support
>>> 409:   virtual void preserve_callee_argument_oops(frame fr, const 
>>> RegisterMap *reg_map, OopClosure* f) override { /* nothing to do */ }
>> 
>> In the GC code we usually have either virtual OR override, but not both. 
>> Could we skip `virtual` here? Or does the compiler code usually use both?
>
> No special rules here. I simply want to see all `virtual` methods explicitly 
> and `override` is required by C++.
> I would like to keep it this way in these changes. I am investigating 
> possibility to convert all these virtual methods to normal one to remove 
> virtual table and virtual pointer (8 bytes) from CodeBlob class.

`override` is not required by C++. You do however mark all virtual methods with 
`override` if any of the functions are marked with `override`. I think it would 
be good to have a HotSpot code style discussion about this (but not in this 
RFE).

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18554#discussion_r1550206804

Reply via email to