From 92a72e2d517464b89a81391206519fda49428087 Mon Sep 17 00:00:00 2001 From: Vyacheslav Barinov Date: Tue, 19 Aug 2014 12:28:24 +0400 Subject: [PATCH] AArch64 support Imported patch from Fedora community to support cacheFlush on AArch64. Switched off jit because there is no support yet Change-Id: Ia741a05949f07df65acf5faaef6d629b1124ea0b Signed-off-by: Vyacheslav Barinov --- js/src/Makefile.in | 2 +- js/src/assembler/jit/ExecutableAllocator.h | 6 ++++++ js/src/assembler/wtf/Platform.h | 4 ++++ js/src/configure.in | 4 ++++ packaging/js.spec | 7 ++++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/js/src/Makefile.in b/js/src/Makefile.in index 7ead392..60fb926 100644 --- a/js/src/Makefile.in +++ b/js/src/Makefile.in @@ -382,7 +382,7 @@ CPPSRCS += checks.cc \ # END enclude sources for V8 dtoa ############################################# -ifeq (,$(filter-out powerpc powerpc64 s390 s390x,$(TARGET_CPU))) +ifeq (,$(filter-out aarch64 powerpc powerpc64 s390 s390x,$(TARGET_CPU))) VPATH += $(srcdir)/assembler \ $(srcdir)/assembler/wtf \ diff --git a/js/src/assembler/jit/ExecutableAllocator.h b/js/src/assembler/jit/ExecutableAllocator.h index 511aebf..f17af9b 100644 --- a/js/src/assembler/jit/ExecutableAllocator.h +++ b/js/src/assembler/jit/ExecutableAllocator.h @@ -391,6 +391,12 @@ public: { CacheRangeFlush(code, size, CACHE_SYNC_ALL); } +#elif WTF_CPU_AARCH64 && WTF_PLATFORM_LINUX + static void cacheFlush(void* code, size_t size) + { + intptr_t end = reinterpret_cast(code) + size; + __builtin___clear_cache(reinterpret_cast(code), reinterpret_cast(end)); + } #else #error "The cacheFlush support is missing on this platform." #endif diff --git a/js/src/assembler/wtf/Platform.h b/js/src/assembler/wtf/Platform.h index 3dfad2a..3d1d031 100644 --- a/js/src/assembler/wtf/Platform.h +++ b/js/src/assembler/wtf/Platform.h @@ -292,6 +292,10 @@ #endif /* ARM */ +/* CPU(AArch64) - 64-bit ARM */ +#if defined(__aarch64__) +#define WTF_CPU_AARCH64 1 +#endif /* Operating systems - low-level dependencies */ diff --git a/js/src/configure.in b/js/src/configure.in index e9f3bb1..711ce06 100644 --- a/js/src/configure.in +++ b/js/src/configure.in @@ -1534,6 +1534,10 @@ arm*) CPU_ARCH=arm ;; +aarch64) + CPU_ARCH=aarch64 + ;; + mips|mipsel) CPU_ARCH="mips" ;; diff --git a/packaging/js.spec b/packaging/js.spec index c9083df..4c2995c 100644 --- a/packaging/js.spec +++ b/packaging/js.spec @@ -52,7 +52,12 @@ you will need to install %{name}-devel. export MOZILLA_VERSION=%{version} cd js pushd src -%configure --with-system-nspr --enable-threadsafe +%ifarch aarch64 +export CPPFLAGS+=" -DENABLE_JIT=0 " +export JIT_CONFIG_OPT="--disable-tracejit --disable-methodjit" +%endif +%configure --with-system-nspr --enable-threadsafe $JIT_CONFIG_OPT + popd export BUILD_OPT=1 %{__make} %{?_smp_mflags} -C src \ -- 2.7.4