Skip to content

Commit 83c096d

Browse files
author
Boris Ulasevich
committed
8308270: ARM32 build broken after JDK-8304913
Reviewed-by: stuefe, rriggs
1 parent 902585b commit 83c096d

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/java.base/share/classes/jdk/internal/util/Architecture.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public enum Architecture {
3737
X64, // Represents AMD64 and X86_64
3838
X86,
3939
AARCH64,
40+
ARM,
4041
RISCV64,
4142
S390,
4243
PPC64,
@@ -85,6 +86,14 @@ public static boolean isPPC64() {
8586
return PlatformProps.TARGET_ARCH_IS_PPC64;
8687
}
8788

89+
/**
90+
* {@return {@code true} if the current architecture is ARM}
91+
*/
92+
@ForceInline
93+
public static boolean isARM() {
94+
return PlatformProps.TARGET_ARCH_IS_ARM;
95+
}
96+
8897
/**
8998
* {@return {@code true} if the current architecture is AARCH64}
9099
*/

src/java.base/share/classes/jdk/internal/util/PlatformProps.java.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class PlatformProps {
5353
static final boolean TARGET_ARCH_IS_X64 = "@@OPENJDK_TARGET_CPU@@" == "x64";
5454
static final boolean TARGET_ARCH_IS_X86 = "@@OPENJDK_TARGET_CPU@@" == "x86";
5555
static final boolean TARGET_ARCH_IS_AARCH64 = "@@OPENJDK_TARGET_CPU@@" == "aarch64";
56+
static final boolean TARGET_ARCH_IS_ARM = "@@OPENJDK_TARGET_CPU@@" == "arm";
5657
static final boolean TARGET_ARCH_IS_RISCV64 = "@@OPENJDK_TARGET_CPU@@" == "riscv64";
5758
static final boolean TARGET_ARCH_IS_S390 = "@@OPENJDK_TARGET_CPU@@" == "s390";
5859
static final boolean TARGET_ARCH_IS_PPC64 = "@@OPENJDK_TARGET_CPU@@" == "ppc64";

test/jdk/jdk/internal/util/ArchTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
import static jdk.internal.util.Architecture.OTHER;
3030
import static jdk.internal.util.Architecture.AARCH64;
31+
import static jdk.internal.util.Architecture.ARM;
3132
import static jdk.internal.util.Architecture.PPC64;
3233
import static jdk.internal.util.Architecture.RISCV64;
3334
import static jdk.internal.util.Architecture.S390;
@@ -67,6 +68,7 @@ public void nameVsCurrent() {
6768
case "x86_64", "amd64" -> X64;
6869
case "x86", "i386" -> X86;
6970
case "aarch64" -> AARCH64;
71+
case "arm" -> ARM;
7072
case "riscv64" -> RISCV64;
7173
case "s390x", "s390" -> S390;
7274
case "ppc64", "ppc64le" -> PPC64;
@@ -84,6 +86,7 @@ private static Stream<Arguments> archParams() {
8486
Arguments.of(X64, Architecture.isX64()),
8587
Arguments.of(X86, Architecture.isX86()),
8688
Arguments.of(AARCH64, Architecture.isAARCH64()),
89+
Arguments.of(ARM, Architecture.isARM()),
8790
Arguments.of(RISCV64, Architecture.isRISCV64()),
8891
Arguments.of(S390, Architecture.isS390()),
8992
Arguments.of(PPC64, Architecture.isPPC64())

0 commit comments

Comments
 (0)