summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei Wang <wangw@codeaurora.org>2013-07-18 10:42:52 -0700
committerSteve Kondik <shade@chemlab.org>2013-12-20 15:32:48 -0800
commit5d5dba430192d3e56077eb3788deaf7e2e420998 (patch)
tree86cbec9108111b7ce1eac38c5ca53a9a46059856
parent7600b1d84126704718606fec82865a98f24922ee (diff)
downloadandroid_dalvik-5d5dba430192d3e56077eb3788deaf7e2e420998.tar.gz
android_dalvik-5d5dba430192d3e56077eb3788deaf7e2e420998.tar.bz2
android_dalvik-5d5dba430192d3e56077eb3788deaf7e2e420998.zip
dalvik: use bioinc memmove
use memmove from bioinc if it is halfword atomic. Change-Id: I81c38c2b504483b69b0b1c1e4ffb63cb81d347d5
-rw-r--r--vm/Dvm.mk1
-rw-r--r--vm/native/java_lang_System.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/vm/Dvm.mk b/vm/Dvm.mk
index e47b6662d..63090dae7 100644
--- a/vm/Dvm.mk
+++ b/vm/Dvm.mk
@@ -269,6 +269,7 @@ ifeq ($(dvm_arch),arm)
LOCAL_SHARED_LIBRARIES += libqc-opt
LOCAL_CFLAGS += -DWITH_QC_PERF
endif
+ LOCAL_CFLAGS += -DHAVE_HALFWORD_ATOMIC_MEMMOVE
endif
endif
diff --git a/vm/native/java_lang_System.cpp b/vm/native/java_lang_System.cpp
index 1b07f85ad..4485a9217 100644
--- a/vm/native/java_lang_System.cpp
+++ b/vm/native/java_lang_System.cpp
@@ -62,6 +62,10 @@
* TODO: use __builtin_prefetch
* TODO: write an ARM-optimized version
*/
+#if defined(HAVE_HALFWORD_ATOMIC_MEMMOVE)
+#define move16 memmove
+#define move32 memmove
+#else
static void memmove_words(void* dest, const void* src, size_t n) {
assert((((uintptr_t) dest | (uintptr_t) src | n) & 0x01) == 0);
@@ -177,6 +181,7 @@ static void memmove_words(void* dest, const void* src, size_t n) {
#define move16 memmove_words
#define move32 memmove_words
+#endif
/*
* public static void arraycopy(Object src, int srcPos, Object dest,