RFR: 8304915: Create jdk.internal.util.Architecture enum and apply [v4]

ExE Boss duke at openjdk.org
Thu Apr 6 03:27:18 UTC 2023


On Wed, 5 Apr 2023 19:20:08 GMT, Roger Riggs <rriggs at openjdk.org> wrote:

>> Define an internal jdk.internal.util.Architecture enumeration and static methods to replace uses of the system property `os.arch`.
>> The enumeration values are defined to match those used in the build.
>> The initial values are: `X64, X86, IA64, ARM, AARCH64, RISCV64, S390X, PPC64LE`
>> Note that `amd64` and `x86_64` in the build are represented by `X64`.
>> The values of the system property `os.arch` is unchanged.
>> 
>> The API is similar to the jdk.internal.util.OperatingSystem enum created by #[12931](https://git.openjdk.org/jdk/pull/12931).
>> Uses in `java.base` and a few others are included but other modules will be done in separate PRs.
>
> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Correct spelling of isAARCH64 in WIndows AttachProviderImpl

Per @Glavo’s [comment][GH‑13357#r1159047360]:

[GH‑13357#r1159047360]: https://github.com/openjdk/jdk/pull/13357#discussion_r1159047360

src/java.base/share/classes/jdk/internal/util/Architecture.java line 37:

> 35: public enum Architecture {
> 36:     X64(),        // Represents AMD64 and X86_64
> 37:     X86(),

Suggestion:

    X86_64(),        // Represents AMD64 and X86_64
    X86_32(),

src/java.base/share/classes/jdk/internal/util/Architecture.java line 39:

> 37:     X86(),
> 38:     IA64(),
> 39:     ARM(),

Suggestion:

    ARM32(),

src/java.base/share/classes/jdk/internal/util/Architecture.java line 53:

> 51:      */
> 52:     @ForceInline
> 53:     public static boolean isX64() {

Suggestion:

    public static boolean isX86_64() {

src/java.base/share/classes/jdk/internal/util/Architecture.java line 61:

> 59:      */
> 60:     @ForceInline
> 61:     public static boolean isX86() {

Suggestion:

    public static boolean isX86_32() {

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

PR Review: https://git.openjdk.org/jdk/pull/13357#pullrequestreview-1373996601
PR Review Comment: https://git.openjdk.org/jdk/pull/13357#discussion_r1159242846
PR Review Comment: https://git.openjdk.org/jdk/pull/13357#discussion_r1159242963
PR Review Comment: https://git.openjdk.org/jdk/pull/13357#discussion_r1159245067
PR Review Comment: https://git.openjdk.org/jdk/pull/13357#discussion_r1159245163



More information about the client-libs-dev mailing list