RFR: JDK-8303166: Disable RTTI for Hotspot when building with MSVC [v3]
Kim Barrett
kbarrett at openjdk.org
Sat Feb 25 11:08:04 UTC 2023
On Fri, 24 Feb 2023 19:56:39 GMT, Justin King <jcking at openjdk.org> wrote:
>> Disable RTTI `-GR-` for Hotspot when building with MSVC. This drops the size of `jvm.dll` by roughly 1 MB. Hotspot does not rely on RTTI and it is disabled for both GCC/Clang and Open XL C/C++ already. This change disables it for MSVC, ensuring we do not accidently rely on RTTI for Windows-specific code while also decreasing the resulting binary size.
>>
>> Cheers to @alexmenkov for finding the tricky root cause of why disabling RTTI was causing a subset of serviceability agent tests to fail.
>
> Justin King has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - Merge remote-tracking branch 'upstream/master' into msvc-rtti
> - Update src/hotspot/share/runtime/notificationThread.hpp
>
> Co-authored-by: Chris Plummer <chris.plummer at oracle.com>
> - Force MSVC to emit unique vtable for NotificationThread
>
> Signed-off-by: Justin King <jcking at google.com>
> - Disable RTTI with MSVC
>
> Signed-off-by: Justin King <jcking at google.com>
src/hotspot/share/runtime/notificationThread.hpp line 50:
> 48: // to the same address, and Serviceability Agent thinking all JavaThreads are NotificationThreads. So
> 49: // while this method is not directly used anywhere, it must exist.
> 50: bool is_Notification_thread() const override { return true; }
Rather than adding this method, would it be sufficient to explicitly define `~NotificationThread()`?
Might require making it non-trivial. The comment would still be needed.
-------------
PR: https://git.openjdk.org/jdk/pull/12743
More information about the build-dev
mailing list