From ab86d23adfa968a180de67199119fc392e9695c2 Mon Sep 17 00:00:00 2001 From: Julian Waters Date: Tue, 22 Aug 2023 06:12:28 +0000 Subject: [PATCH] 8250269: Replace ATTRIBUTE_ALIGNED with alignas Reviewed-by: rkennke, kbarrett --- src/hotspot/share/utilities/globalDefinitions.hpp | 2 +- src/hotspot/share/utilities/globalDefinitions_gcc.hpp | 6 +----- src/hotspot/share/utilities/globalDefinitions_visCPP.hpp | 3 --- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/hotspot/share/utilities/globalDefinitions.hpp b/src/hotspot/share/utilities/globalDefinitions.hpp index a374b9cdc93..f6c4199a1e3 100644 --- a/src/hotspot/share/utilities/globalDefinitions.hpp +++ b/src/hotspot/share/utilities/globalDefinitions.hpp @@ -50,7 +50,7 @@ class oopDesc; #endif #ifndef ATTRIBUTE_ALIGNED -#define ATTRIBUTE_ALIGNED(x) +#define ATTRIBUTE_ALIGNED(x) alignas(x) #endif #ifndef ATTRIBUTE_FLATTEN diff --git a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp index 0d7b1164a6d..7ea877062d8 100644 --- a/src/hotspot/share/utilities/globalDefinitions_gcc.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_gcc.hpp @@ -141,7 +141,7 @@ inline int g_isfinite(jdouble f) { return isfinite(f); } // temporarily disabled. #define offset_of(klass,field) \ ([]() { \ - char space[sizeof (klass)] ATTRIBUTE_ALIGNED(16); \ + alignas(16) char space[sizeof (klass)]; \ klass* dummyObj = (klass*)space; \ char* c = (char*)(void*)&dummyObj->field; \ return (size_t)(c - space); \ @@ -160,8 +160,4 @@ inline int g_isfinite(jdouble f) { return isfinite(f); } #define ALWAYSINLINE inline __attribute__ ((always_inline)) #define ATTRIBUTE_FLATTEN __attribute__ ((flatten)) -// Alignment -// -#define ATTRIBUTE_ALIGNED(x) __attribute__((aligned(x))) - #endif // SHARE_UTILITIES_GLOBALDEFINITIONS_GCC_HPP diff --git a/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp b/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp index 25f3ec8cbaf..3b28328d7dd 100644 --- a/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp +++ b/src/hotspot/share/utilities/globalDefinitions_visCPP.hpp @@ -115,9 +115,6 @@ inline int g_isfinite(jdouble f) { return _finite(f); } #define NOINLINE __declspec(noinline) #define ALWAYSINLINE __forceinline -// Alignment -#define ATTRIBUTE_ALIGNED(x) __declspec(align(x)) - #ifdef _M_ARM64 #define USE_VECTORED_EXCEPTION_HANDLING #endif