Integrated: 8256254: Convert vmIntrinsics::ID to enum class
Ioi Lam
iklam at openjdk.java.net
Tue Dec 1 05:38:59 UTC 2020
On Mon, 16 Nov 2020 20:46:46 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> This PR is follows the same style as https://github.com/openjdk/jdk/pull/276, except this time I am converting `vmIntrinsics::ID` to `vmIntrinsicID`:
>
> * Convert `vmIntrinsics::SID` to `enum class` to provide better type safety.
> * Also, put this enum class in the top level, so it can be forward-declared. I.e., `enum class vmIntrinsicID : int;`. This avoids excessive inclusion of vmIntrinsics.hpp and vmSymbols.hpp (which were included indirectly by almost every hotspot source files).
> * vmIntrinsics.hpp: was included 805 times, now included 414 times
> * vmSymbols.hpp: was included 805 times, now include 394 times
> * Note: more #include reduction will be done in [JDK-8256424](https://bugs.openjdk.java.net/browse/JDK-8256424)
>
> Many files are changed, but most of them are minor
> * Added missing dependencies of vmSymbols.hpp and/or vmIntrinsics.hpp
> * safe conversion between vmIntrinsicID and integer types (see comments around `vmIntrinsics::as_int()`)
>
> Since we have a lot of references like `vmIntrinsics::_invokeGeneric`, I added aliases like
>
> static const vmIntrinsicID vmIntrinsics::_invokeGeneric = vmIntrinsicID::_invokeGeneric
>
> so we don't need to change over a thousand `vmIntrinsics::XXX` to `vmIntrinsicID::XXX`.
This pull request has now been integrated.
Changeset: f48737c7
Author: Ioi Lam <iklam at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/f48737c7
Stats: 216 lines in 52 files changed: 92 ins; 17 del; 107 mod
8256254: Convert vmIntrinsics::ID to enum class
Reviewed-by: redestad, kvn
-------------
PR: https://git.openjdk.java.net/jdk/pull/1237
More information about the hotspot-dev
mailing list