diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-24 22:28:51 +0100 |
---|---|---|
committer | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2013-07-24 22:28:51 +0100 |
commit | 6f2b68ab11d564d25eeba36b6e8bdb44ab5b1ba4 (patch) | |
tree | 58c5c0c83fd997ff172dd47fc7d148fc3baa2e1b | |
parent | eaf99024ae65895f4d843fbdd46702432d65d821 (diff) | |
parent | 8c7c06b5cdac575f2288290cbad8c757ca078635 (diff) | |
download | android_external_v8-6f2b68ab11d564d25eeba36b6e8bdb44ab5b1ba4.tar.gz android_external_v8-6f2b68ab11d564d25eeba36b6e8bdb44ab5b1ba4.tar.bz2 android_external_v8-6f2b68ab11d564d25eeba36b6e8bdb44ab5b1ba4.zip |
Merge tag 'android-4.3_r2.1' into cm-10.2cm-10.2-M1
Android 4.3 release 2.1
-rw-r--r-- | Android.libv8.mk | 3 | ||||
-rw-r--r-- | src/mips/cpu-mips.cc | 21 | ||||
-rw-r--r-- | src/platform-linux.cc | 71 |
3 files changed, 50 insertions, 45 deletions
diff --git a/Android.libv8.mk b/Android.libv8.mk index 35e5e5f1..4b99a137 100644 --- a/Android.libv8.mk +++ b/Android.libv8.mk @@ -15,9 +15,6 @@ LOCAL_MODULE := libv8 LOCAL_MODULE_CLASS := STATIC_LIBRARIES intermediates := $(call local-intermediates-dir) -PRIVATE_CLEAN_FILES := $(HOST_OUT)/bin/mksnapshot.$(TARGET_ARCH) \ - $(HOST_OUT)/obj/EXECUTABLES/mksnapshot.$(TARGET_ARCH)_intermediates - # Android.v8common.mk defines common V8_LOCAL_SRC_FILES # and V8_LOCAL_JS_LIBRARY_FILES V8_LOCAL_SRC_FILES := diff --git a/src/mips/cpu-mips.cc b/src/mips/cpu-mips.cc index 93ebeda8..b8200007 100644 --- a/src/mips/cpu-mips.cc +++ b/src/mips/cpu-mips.cc @@ -65,10 +65,23 @@ void CPU::FlushICache(void* start, size_t size) { #if !defined (USE_SIMULATOR) #if defined(ANDROID) - // Bionic cacheflush can typically run in userland, avoiding kernel call. - char *end = reinterpret_cast<char *>(start) + size; - cacheflush( - reinterpret_cast<intptr_t>(start), reinterpret_cast<intptr_t>(end), 0); + // Workaround for a deserializer bug. Bionic usermode cacheflush + // fails in deserializer for a size of Page::kPageSize (1MB), + // because that region contains protected pages. Switch to kernel + // cacheflush in this case. + if (size >= static_cast<size_t>(Page::kPageSize)) { + int res; + // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. + res = syscall(__NR_cacheflush, start, size, ICACHE); + if (res) { + V8_Fatal(__FILE__, __LINE__, "Failed to flush the instruction cache"); + } + } else { + // Bionic cacheflush can typically run in userland, avoiding kernel call. + char *end = reinterpret_cast<char *>(start) + size; + cacheflush( + reinterpret_cast<intptr_t>(start), reinterpret_cast<intptr_t>(end), 0); + } #else // ANDROID int res; // See http://www.linux-mips.org/wiki/Cacheflush_Syscall. diff --git a/src/platform-linux.cc b/src/platform-linux.cc index 9781407e..6c4a549c 100644 --- a/src/platform-linux.cc +++ b/src/platform-linux.cc @@ -190,48 +190,43 @@ bool OS::ArmCpuHasFeature(CpuFeature feature) { } -// Simple helper function to detect whether the C code is compiled with -// option -mfloat-abi=hard. The register d0 is loaded with 1.0 and the register -// pair r0, r1 is loaded with 0.0. If -mfloat-abi=hard is pased to GCC then -// calling this will return 1.0 and otherwise 0.0. -static void ArmUsingHardFloatHelper() { - asm("mov r0, #0":::"r0"); -#if defined(__VFP_FP__) && !defined(__SOFTFP__) - // Load 0x3ff00000 into r1 using instructions available in both ARM - // and Thumb mode. - asm("mov r1, #3":::"r1"); - asm("mov r2, #255":::"r2"); - asm("lsl r1, r1, #8":::"r1"); - asm("orr r1, r1, r2":::"r1"); - asm("lsl r1, r1, #20":::"r1"); - // For vmov d0, r0, r1 use ARM mode. -#ifdef __thumb__ - asm volatile( - "@ Enter ARM Mode \n\t" - " adr r3, 1f \n\t" - " bx r3 \n\t" - " .ALIGN 4 \n\t" - " .ARM \n" - "1: vmov d0, r0, r1 \n\t" - "@ Enter THUMB Mode\n\t" - " adr r3, 2f+1 \n\t" - " bx r3 \n\t" - " .THUMB \n" - "2: \n\t":::"r3"); +bool OS::ArmUsingHardFloat() { + // GCC versions 4.6 and above define __ARM_PCS or __ARM_PCS_VFP to specify + // the Floating Point ABI used (PCS stands for Procedure Call Standard). + // We use these as well as a couple of other defines to statically determine + // what FP ABI used. + // GCC versions 4.4 and below don't support hard-fp. + // GCC versions 4.5 may support hard-fp without defining __ARM_PCS or + // __ARM_PCS_VFP. + +#define GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +#if GCC_VERSION >= 40600 +#if defined(__ARM_PCS_VFP) + return true; #else - asm("vmov d0, r0, r1"); -#endif // __thumb__ -#endif // defined(__VFP_FP__) && !defined(__SOFTFP__) - asm("mov r1, #0":::"r1"); -} + return false; +#endif +#elif GCC_VERSION < 40500 + return false; -bool OS::ArmUsingHardFloat() { - // Cast helper function from returning void to returning double. - typedef double (*F)(); - F f = FUNCTION_CAST<F>(FUNCTION_ADDR(ArmUsingHardFloatHelper)); - return f() == 1.0; +#else +#if defined(__ARM_PCS_VFP) + return true; +#elif defined(__ARM_PCS) || defined(__SOFTFP) || !defined(__VFP_FP__) + return false; +#else +#error "Your version of GCC does not report the FP ABI compiled for." \ + "Please report it on this issue" \ + "http://code.google.com/p/v8/issues/detail?id=2140" + +#endif +#endif +#undef GCC_VERSION } + #endif // def __arm__ |