Skip to content
Permalink
Browse files
8248238: Implementation: JEP 388: Windows AArch64 Support
Co-authored-by: Monica Beckwith <mbeckwit@openjdk.org>
Co-authored-by: Ludovic Henry <luhenry@openjdk.org>
Co-authored-by: Bernhard Urban-Forster <burban@openjdk.org>
Reviewed-by: dholmes, cjplummer, aph, ihse
  • Loading branch information
3 people authored and David Holmes committed Oct 5, 2020
1 parent 1c2754b commit 9604ee82690f89320614b37bfef4178abc869777
Showing with 2,440 additions and 358 deletions.
  1. +10 −0 make/autoconf/basic.m4
  2. +3 −1 make/autoconf/flags-cflags.m4
  3. +5 −6 make/autoconf/flags-ldflags.m4
  4. +9 −6 make/autoconf/jvm-features.m4
  5. +54 −11 make/autoconf/toolchain.m4
  6. +88 −67 make/autoconf/toolchain_windows.m4
  7. +16 −1 make/devkit/createWindowsDevkit2017.sh
  8. +16 −0 make/devkit/createWindowsDevkit2019.sh
  9. +7 −0 make/hotspot/gensrc/GensrcAdlc.gmk
  10. +7 −1 make/modules/java.base/gensrc/GensrcMisc.gmk
  11. +7 −1 src/hotspot/cpu/aarch64/aarch64-asmtest.py
  12. +11 −3 src/hotspot/cpu/aarch64/aarch64.ad
  13. +102 −98 src/hotspot/cpu/aarch64/assembler_aarch64.cpp
  14. +21 −1 src/hotspot/cpu/aarch64/assembler_aarch64.hpp
  15. +6 −6 src/hotspot/cpu/aarch64/c1_Defs_aarch64.hpp
  16. +1 −0 src/hotspot/cpu/aarch64/c1_FpuStackSim_aarch64.cpp
  17. +13 −2 src/hotspot/cpu/aarch64/c1_FrameMap_aarch64.cpp
  18. +5 −5 src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp
  19. +1 −0 src/hotspot/cpu/aarch64/gc/shenandoah/shenandoah_aarch64.ad
  20. +9 −0 src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp
  21. +1 −14 src/hotspot/cpu/aarch64/icache_aarch64.hpp
  22. +7 −1 src/hotspot/cpu/aarch64/immediate_aarch64.cpp
  23. +10 −2 src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
  24. +14 −4 src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
  25. +13 −5 src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp
  26. +1 −1 src/hotspot/cpu/aarch64/register_aarch64.cpp
  27. +58 −1 src/hotspot/cpu/aarch64/register_aarch64.hpp
  28. +1 −1 src/hotspot/cpu/aarch64/register_definitions_aarch64.cpp
  29. +48 −45 src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp
  30. +1 −0 src/hotspot/cpu/aarch64/vm_version_ext_aarch64.cpp
  31. +135 −66 src/hotspot/os/windows/os_windows.cpp
  32. +44 −0 src/hotspot/os_cpu/linux_aarch64/icache_linux_aarch64.hpp
  33. +26 −0 src/hotspot/os_cpu/windows_aarch64/assembler_windows_aarch64.cpp
  34. +111 −0 src/hotspot/os_cpu/windows_aarch64/atomic_windows_aarch64.hpp
  35. +46 −0 src/hotspot/os_cpu/windows_aarch64/bytes_windows_aarch64.inline.hpp
  36. +158 −0 src/hotspot/os_cpu/windows_aarch64/copy_windows_aarch64.inline.hpp
  37. +50 −0 src/hotspot/os_cpu/windows_aarch64/globals_windows_aarch64.hpp
  38. +44 −0 src/hotspot/os_cpu/windows_aarch64/icache_windows_aarch64.hpp
  39. +60 −0 src/hotspot/os_cpu/windows_aarch64/orderAccess_windows_aarch64.hpp
  40. +311 −0 src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.cpp
  41. +36 −0 src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.hpp
  42. +30 −0 src/hotspot/os_cpu/windows_aarch64/os_windows_aarch64.inline.hpp
  43. +37 −0 src/hotspot/os_cpu/windows_aarch64/prefetch_windows_aarch64.inline.hpp
  44. +100 −0 src/hotspot/os_cpu/windows_aarch64/thread_windows_aarch64.cpp
  45. +63 −0 src/hotspot/os_cpu/windows_aarch64/thread_windows_aarch64.hpp
  46. +102 −0 src/hotspot/os_cpu/windows_aarch64/unwind_windows_aarch64.hpp
  47. +49 −0 src/hotspot/os_cpu/windows_aarch64/vmStructs_windows_aarch64.hpp
  48. +99 −0 src/hotspot/os_cpu/windows_aarch64/vm_version_windows_aarch64.cpp
  49. +35 −0 src/hotspot/os_cpu/windows_x86/os_windows_x86.cpp
  50. +6 −0 src/hotspot/share/gc/g1/g1HeapRegionAttr.hpp
  51. +5 −5 src/hotspot/share/prims/jni.cpp
  52. +4 −0 src/hotspot/share/utilities/globalDefinitions_visCPP.hpp
  53. +2 −0 src/java.base/windows/native/libjava/java_props_md.c
  54. +2 −2 src/jdk.attach/windows/classes/sun/tools/attach/AttachProviderImpl.java
  55. +3 −1 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotAgent.java
  56. +4 −0 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
  57. +94 −0 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/aarch64/WindbgAARCH64Thread.java
  58. +47 −0 ...tspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/aarch64/WindbgAARCH64ThreadContext.java
  59. +45 −0 ...tspot.agent/share/classes/sun/jvm/hotspot/debugger/windbg/aarch64/WindbgAARCH64ThreadFactory.java
  60. +4 −1 src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/runtime/Threads.java
  61. +140 −0 ...pot.agent/share/classes/sun/jvm/hotspot/runtime/win32_aarch64/Win32AARCH64JavaThreadPDAccess.java
  62. +3 −0 src/jdk.hotspot.agent/windows/native/libsaproc/sawindbg.cpp
@@ -117,6 +117,16 @@ AC_DEFUN([BASIC_EVAL_DEVKIT_VARIABLE],
fi
])

###############################################################################
# Evaluates platform specific overrides for build devkit variables.
# $1: Name of variable
AC_DEFUN([BASIC_EVAL_BUILD_DEVKIT_VARIABLE],
[
if test "x[$]$1" = x; then
eval $1="\${$1_${OPENJDK_BUILD_CPU}}"
fi
])

###############################################################################
AC_DEFUN_ONCE([BASIC_SETUP_DEVKIT],
[
@@ -666,7 +666,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
# toolchain dependend, per-cpu
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
if test "x$FLAGS_CPU" = xx86_64; then
if test "x$FLAGS_CPU" = xaarch64; then
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_ARM64_ -Darm64"
elif test "x$FLAGS_CPU" = xx86_64; then
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_AMD64_ -Damd64"
else
$1_DEFINES_CPU_JDK="${$1_DEFINES_CPU_JDK} -D_X86_ -Dx86"
@@ -165,15 +165,14 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_CPU_DEP],
fi
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
if test "x${OPENJDK_$1_CPU}" = "xx86"; then
$1_CPU_LDFLAGS="-safeseh"
# NOTE: Old build added -machine. Probably not needed.
$1_CPU_LDFLAGS_JVM_ONLY="-machine:I386"
if test "x${OPENJDK_$1_CPU_BITS}" = "x32"; then
$1_CPU_EXECUTABLE_LDFLAGS="-stack:327680"
else
$1_CPU_LDFLAGS_JVM_ONLY="-machine:AMD64"
elif test "x${OPENJDK_$1_CPU_BITS}" = "x64"; then
$1_CPU_EXECUTABLE_LDFLAGS="-stack:1048576"
fi
if test "x${OPENJDK_$1_CPU}" = "xx86"; then
$1_CPU_LDFLAGS="-safeseh"
fi
fi
# JVM_VARIANT_PATH depends on if this is build or target...
@@ -237,8 +237,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_AOT],
JVM_FEATURES_CHECK_AVAILABILITY(aot, [
AC_MSG_CHECKING([if platform is supported by AOT])
# AOT is only available where JVMCI is available since it requires JVMCI.
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
AC_MSG_RESULT([yes])
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
@@ -303,8 +304,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_GRAAL],
JVM_FEATURES_CHECK_AVAILABILITY(graal, [
AC_MSG_CHECKING([if platform is supported by Graal])
# Graal is only available where JVMCI is available since it requires JVMCI.
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
AC_MSG_RESULT([yes])
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
@@ -336,8 +338,9 @@ AC_DEFUN_ONCE([JVM_FEATURES_CHECK_JVMCI],
[
JVM_FEATURES_CHECK_AVAILABILITY(jvmci, [
AC_MSG_CHECKING([if platform is supported by JVMCI])
if test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64" ; then
if test "x$OPENJDK_TARGET_CPU" = "xx86_64"; then
AC_MSG_RESULT([yes])
elif test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-aarch64"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no, $OPENJDK_TARGET_CPU])
@@ -872,14 +872,18 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
. $CONFIGURESUPPORT_OUTPUTDIR/build-devkit.info
# This potentially sets the following:
# A descriptive name of the devkit
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_NAME])
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_NAME])
# Corresponds to --with-extra-path
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_EXTRA_PATH])
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_EXTRA_PATH])
# Corresponds to --with-toolchain-path
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_TOOLCHAIN_PATH])
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_TOOLCHAIN_PATH])
# Corresponds to --with-sysroot
BASIC_EVAL_DEVKIT_VARIABLE([BUILD_DEVKIT_SYSROOT])
# Skip the Window specific parts
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_SYSROOT])
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_VS_INCLUDE])
BASIC_EVAL_BUILD_DEVKIT_VARIABLE([BUILD_DEVKIT_VS_LIB])
fi
fi
AC_MSG_CHECKING([for build platform devkit])
@@ -889,13 +893,20 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
AC_MSG_RESULT([$BUILD_DEVKIT_ROOT])
fi
BUILD_SYSROOT="$BUILD_DEVKIT_SYSROOT"
# Fallback default of just /bin if DEVKIT_PATH is not defined
# Fallback default of just /bin if DEVKIT_PATH is not defined
if test "x$BUILD_DEVKIT_TOOLCHAIN_PATH" = x; then
BUILD_DEVKIT_TOOLCHAIN_PATH="$BUILD_DEVKIT_ROOT/bin"
fi
PATH="$BUILD_DEVKIT_TOOLCHAIN_PATH:$BUILD_DEVKIT_EXTRA_PATH"
BUILD_SYSROOT="$BUILD_DEVKIT_SYSROOT"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
BUILD_VS_INCLUDE="$BUILD_DEVKIT_VS_INCLUDE"
BUILD_VS_LIB="$BUILD_DEVKIT_VS_LIB"
TOOLCHAIN_SETUP_VISUAL_STUDIO_SYSROOT_FLAGS([BUILD_])
fi
fi
fi
@@ -921,9 +932,37 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
UTIL_FIXUP_EXECUTABLE(BUILD_STRIP)
# Assume the C compiler is the assembler
BUILD_AS="$BUILD_CC -c"
# Just like for the target compiler, use the compiler as linker
BUILD_LD="$BUILD_CC"
BUILD_LDCXX="$BUILD_CXX"
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
# In the Microsoft toolchain we have a separate LD command "link".
# Make sure we reject /usr/bin/link (as determined in CYGWIN_LINK), which is
# a cygwin program for something completely different.
AC_CHECK_PROG([BUILD_LD], [link$EXE_SUFFIX],[link$EXE_SUFFIX],,, [$CYGWIN_LINK])
UTIL_FIXUP_EXECUTABLE(BUILD_LD)
# Verify that we indeed succeeded with this trick.
AC_MSG_CHECKING([if the found link.exe is actually the Visual Studio linker])
# Reset PATH since it can contain a mix of WSL/linux paths and Windows paths from VS,
# which, in combination with WSLENV, will make the WSL layer complain
old_path="$PATH"
PATH=
"$BUILD_LD" --version > /dev/null
if test $? -eq 0 ; then
AC_MSG_RESULT([no])
AC_MSG_ERROR([This is the Cygwin link tool. Please check your PATH and rerun configure.])
else
AC_MSG_RESULT([yes])
fi
PATH="$old_path"
BUILD_LDCXX="$BUILD_LD"
else
# Just like for the target compiler, use the compiler as linker
BUILD_LD="$BUILD_CC"
BUILD_LDCXX="$BUILD_CXX"
fi
PATH="$OLDPATH"
@@ -974,6 +1013,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
if test "x$COMPILER_CPU_TEST" != "xx64"; then
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "x64".])
fi
elif test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then
if test "x$COMPILER_CPU_TEST" != "xARM64"; then
AC_MSG_ERROR([Target CPU mismatch. We are building for $OPENJDK_TARGET_CPU but CL is for "$COMPILER_CPU_TEST"; expected "arm64".])
fi
fi
fi

1 comment on commit 9604ee8

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on 9604ee8 Oct 5, 2020

Please sign in to comment.