From 9fce8800c4a127c2a08a9d7bdf373d6b81dac068 Mon Sep 17 00:00:00 2001 From: knn-k Date: Fri, 25 Jan 2019 14:50:48 +0900 Subject: [PATCH] AArch64: Add support for AArch64 in JIT-related files This commit adds support for AArch64 in JIT-related files. Signed-off-by: knn-k --- runtime/codert_vm/cnathelp.cpp | 7 +++ runtime/compiler/module.xml | 4 +- runtime/compiler/runtime/MethodMetaData.c | 5 +- runtime/ddr/jitflagsddr.c | 9 ++- runtime/ddr/module.xml | 9 ++- runtime/jilgen/jilconsts.c | 8 ++- runtime/jilgen/module.xml | 9 ++- runtime/oti/JITInterface.hpp | 23 ++++++- runtime/oti/j9nonbuilder.h | 64 ++++++++++++++++--- runtime/oti/stackwalk.h | 29 ++++++++- runtime/util/jitregs.c | 76 ++++++++++++++++++++++- 11 files changed, 226 insertions(+), 17 deletions(-) diff --git a/runtime/codert_vm/cnathelp.cpp b/runtime/codert_vm/cnathelp.cpp index f2ac8a1b39..713748d2a8 100644 --- a/runtime/codert_vm/cnathelp.cpp +++ b/runtime/codert_vm/cnathelp.cpp @@ -247,6 +247,13 @@ J9_EXTERN_BUILDER_SYMBOL(icallVMprJavaSendStatic1); #define JIT_LO_U64_RETURN_REGISTER gpr.numbered[0] #define JIT_HI_U64_RETURN_REGISTER gpr.numbered[1] +#elif defined(J9VM_ARCH_AARCH64) + +#define JIT_STACK_OVERFLOW_SIZE_REGISTER gpr.numbered[18] // TODO: determine which register to use +#define JIT_UDATA_RETURN_VALUE_REGISTER gpr.numbered[0] +#define JIT_RETURN_ADDRESS_REGISTER gpr.numbered[30] +#define JIT_J2I_METHOD_REGISTER gpr.numbered[0] + #else #error UNKNOWN PROCESSOR #endif diff --git a/runtime/compiler/module.xml b/runtime/compiler/module.xml index a9c7802268..f3c159db8b 100644 --- a/runtime/compiler/module.xml +++ b/runtime/compiler/module.xml @@ -1,6 +1,6 @@ + jit j2se diff --git a/runtime/compiler/runtime/MethodMetaData.c b/runtime/compiler/runtime/MethodMetaData.c index 40795c4367..0f8e663566 100644 --- a/runtime/compiler/runtime/MethodMetaData.c +++ b/runtime/compiler/runtime/MethodMetaData.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2018 IBM Corp. and others + * Copyright (c) 2000, 2019 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -1746,6 +1746,9 @@ void jitAddSpilledRegisters(J9StackWalkState * walkState, void * stackMap) } while (savedGPRs != 0); } +#elif defined(TR_HOST_ARM64) + // TODO: Implement this + assert(0); #else #error Unknown TR_HOST type #endif diff --git a/runtime/ddr/jitflagsddr.c b/runtime/ddr/jitflagsddr.c index 740670cdc4..4099cd5636 100644 --- a/runtime/ddr/jitflagsddr.c +++ b/runtime/ddr/jitflagsddr.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1991, 2018 IBM Corp. and others + * Copyright (c) 1991, 2019 IBM Corp. and others * * This program and the accompanying materials are made available under * the terms of the Eclipse Public License 2.0 which accompanies this @@ -36,6 +36,13 @@ J9DDRConstantTableBegin(TRBuildFlags) #endif J9DDRConstantTableEntryWithValue("host_ARM", host_ARM) +#if defined(TR_HOST_AARCH64) + #define host_AARCH64 1 +#else + #define host_AARCH64 0 +#endif +J9DDRConstantTableEntryWithValue("host_AARCH64", host_AARCH64) + #if defined(TR_HOST_IA32) #define host_IA32 1 #else diff --git a/runtime/ddr/module.xml b/runtime/ddr/module.xml index 5236a69615..0be5f097bf 100644 --- a/runtime/ddr/module.xml +++ b/runtime/ddr/module.xml @@ -1,6 +1,6 @@