RFR: 8295475: Move non-resource allocation strategies out of ResourceObj [v3]

Stefan Karlsson stefank at openjdk.org
Tue Nov 8 13:44:25 UTC 2022


On Fri, 21 Oct 2022 13:19:40 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> Seems like the riscv port uses virtual destructors on classes that inherits from ResourceObj. This requires the delete operator to be defined. [C++ Standard](https://eel.is/c++draft/class.dtor#16)
> 
> It occurs in the Assembler, MacroAssembler and InterpreterMacroAssembler which all have empty virtual destructors. And in SignatureHandlerGenerator which NULLs an internal field. Any of the RISCV porters that know why virtual destructors are used in this way, and if they are necessary.
> 
> I can compile `make CONF=riscv hotspot` with the virtual destructors removed.

@RealFYang could you take a look at the proposed patch to remove these destructors?:
https://github.com/openjdk/jdk/commit/3ebe35bff744dbee6bcc509e2ce0a7aafaf0f1ea

Currently, those destructors are blocking the progress of this patch. An alternative would be to reinstate `ResourceObj::operator delete` but I think we'd prefer not to do that.

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

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


More information about the hotspot-dev mailing list