From abdce96b7ce833d0d33078b4b8a772b6593d7a3f Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Tue, 25 Jun 2019 20:28:30 +0800 Subject: [PATCH] =?UTF-8?q?Upgrade=20to=20WebkitGTK=202.24.2=20and=20worka?= =?UTF-8?q?round=20=5F=5Fclear=5Fcache=20issue=20o=E2=80=A6=20(#114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Summary This PR includes three major changes: 1. Enable JIT back Community reported sensible performance drop from the no-JIT version, so I'd like to enable JIT back. 2. Upgrade to WebKitGTK 2.24.2. This seems to fix previous JSC crashes on Samsung S7 Edge. This version includes JIT new bytecode format as described from WebKit blog: https://webkit.org/blog/9329/a-new-bytecode-format-for-javascriptcore/ After the major change, x86 JIT is not supported and arm32 support was contributed by WebKit community (Thanks to Igalia). From my understanding, original JSC crashes happen at `operationLinkDirectCall()`. After the new bytecode format, there is no direct link call from Baseline JIT. Since we've disabled DFG JIT and FTL JIT, there's no call flow that will hit to `operationLinkDirectCall()`. That is why no more similar crash happens. 3. Workaround for ARM Cortex-A53 cache flush instruction issue: This is from V8's workaround and I believe it is worth to apply into JSC Android as well. https://codereview.chromium.org/1921173004 ARM Cortex-A53 had some errata for original "cvau" instruction, and officially recommended to use "civac" instruction instead. LLVM compiler-rt's `__clear_cache` still uses "cvau" and my patch replaced to "civac". ## Test Plan 1. Run measure scripts on my Samsung Note 5. 2. Provide an [experimented version](https://www.npmjs.com/package/@kudo-ci/jsc-android/v/245459.9000.0) for community who previously reported JSC crash and seems no more crashes happened. ## Measurement Added "@kudo-ci/jsc-android@245459-no-dfg-jit" to previous measurement result. The new result could compared to 241213-no-dfg-jit version. There are some performance improvement from the comparison. https://docs.google.com/spreadsheets/d/1hqX3ai-NCpN_J6YQDTKnKNBctWnMFA6EyOdVhPvwUas/edit#gid=193471288 Screen Shot 2019-06-24 at 11 46 00 PM Screen Shot 2019-06-24 at 11 45 16 PM Screen Shot 2019-06-24 at 11 45 08 PM Screen Shot 2019-06-24 at 11 45 00 PM Screen Shot 2019-06-24 at 11 44 56 PM --- package.json | 4 +- patches/jsc.patch | 2 +- patches/jsc_disable_icu.patch | 2 +- patches/jsc_features.patch | 4 +- patches/jsc_fix_arm64_jit_crash.patch | 41 +++++++++++ patches/jsc_fix_build_error_disable_dfg.patch | 71 ------------------- patches/jsc_fix_build_error_getline.patch | 11 +-- patches/jsc_fix_build_error_log2.patch | 2 +- .../jsc_fix_build_error_miss_headers.patch | 14 ++++ patches/jsc_fix_build_error_mulodi4.patch | 29 ++++---- patches/jsc_fix_build_error_statvfs.patch | 15 ++++ patches/jsc_fix_build_error_stringview.patch | 6 +- patches/jsc_icu_integrate.patch | 2 +- patches/jsc_startup_log_version.patch | 2 +- scripts/compile/jsc.sh | 16 ++++- scripts/patch.sh | 11 ++- 16 files changed, 126 insertions(+), 106 deletions(-) create mode 100644 patches/jsc_fix_arm64_jit_crash.patch delete mode 100644 patches/jsc_fix_build_error_disable_dfg.patch create mode 100644 patches/jsc_fix_build_error_miss_headers.patch create mode 100644 patches/jsc_fix_build_error_statvfs.patch diff --git a/package.json b/package.json index e0f3ed962..620192fdf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jsc-android", - "version": "241213.2.0", + "version": "245459.0.0", "description": "Pre-build version of JavaScriptCore to be used by React Native apps", "repository": { "type": "git", @@ -26,7 +26,7 @@ "start": "./scripts/start.sh" }, "config": { - "webkitGTK": "2.22.6", + "webkitGTK": "2.24.2", "chromiumICUCommit": "b34251f8b762f8e2112a89c587855ca4297fed96" } } diff --git a/patches/jsc.patch b/patches/jsc.patch index 854dd343a..00475e129 100644 --- a/patches/jsc.patch +++ b/patches/jsc.patch @@ -1,6 +1,6 @@ --- target-org/webkit/Source/JavaScriptCore/CMakeLists.txt 2019-04-27 00:04:34.000000000 +0800 +++ target/webkit/Source/JavaScriptCore/CMakeLists.txt 2019-04-27 00:06:00.000000000 +0800 -@@ -1234,6 +1234,7 @@ +@@ -1304,6 +1304,7 @@ install(TARGETS JavaScriptCore DESTINATION "${LIB_INSTALL_DIR}") endif () endif () diff --git a/patches/jsc_disable_icu.patch b/patches/jsc_disable_icu.patch index 1c77dbe6b..0bc0f4f1e 100644 --- a/patches/jsc_disable_icu.patch +++ b/patches/jsc_disable_icu.patch @@ -1,7 +1,7 @@ diff -aur target-org/webkit/Source/WTF/wtf/CMakeLists.txt target/webkit/Source/WTF/wtf/CMakeLists.txt --- target-org/webkit/Source/WTF/wtf/CMakeLists.txt 2019-04-27 00:04:50.000000000 +0800 +++ target/webkit/Source/WTF/wtf/CMakeLists.txt 2019-04-27 00:14:29.000000000 +0800 -@@ -475,7 +475,6 @@ +@@ -482,7 +482,6 @@ list(APPEND WTF_SOURCES unicode/CollatorDefault.cpp diff --git a/patches/jsc_features.patch b/patches/jsc_features.patch index b1d4e9bd9..23adc4680 100644 --- a/patches/jsc_features.patch +++ b/patches/jsc_features.patch @@ -1,7 +1,7 @@ diff -aur target-org/webkit/CMakeLists.txt target/webkit/CMakeLists.txt --- target-org/webkit/CMakeLists.txt 2017-12-22 19:18:43.000000000 +0200 +++ target/webkit/CMakeLists.txt 2018-06-14 15:41:59.000000000 +0300 -@@ -174,13 +174,13 @@ +@@ -177,13 +177,13 @@ add_subdirectory(Tools) endif () @@ -42,7 +42,7 @@ diff -aur target-org/webkit/Source/cmake/OptionsJSCOnly.cmake target/webkit/Sour diff -aur target-org/webkit/Source/JavaScriptCore/CMakeLists.txt target/webkit/Source/JavaScriptCore/CMakeLists.txt --- target-org/webkit/Source/JavaScriptCore/CMakeLists.txt 2017-05-02 21:13:03.000000000 +0200 +++ target/webkit/Source/JavaScriptCore/CMakeLists.txt 2017-07-11 11:34:55.962374878 +0200 -@@ -1221,7 +1225,7 @@ +@@ -1291,7 +1291,7 @@ ) target_include_directories(LLIntOffsetsExtractor SYSTEM PRIVATE ${JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES}) diff --git a/patches/jsc_fix_arm64_jit_crash.patch b/patches/jsc_fix_arm64_jit_crash.patch new file mode 100644 index 000000000..8938d1c71 --- /dev/null +++ b/patches/jsc_fix_arm64_jit_crash.patch @@ -0,0 +1,41 @@ +diff -aur target-org/webkit/Source/JavaScriptCore/assembler/ARM64Assembler.h target/webkit/Source/JavaScriptCore/assembler/ARM64Assembler.h +--- target-org/webkit/Source/JavaScriptCore/assembler/ARM64Assembler.h 2019-06-18 21:49:21.000000000 +0800 ++++ target/webkit/Source/JavaScriptCore/assembler/ARM64Assembler.h 2019-06-19 15:14:46.000000000 +0800 +@@ -2863,7 +2863,36 @@ + + unsigned debugOffset() { return m_buffer.debugOffset(); } + +-#if OS(LINUX) && COMPILER(GCC_COMPATIBLE) ++#if defined(CUSTOMIZE_REACT_NATIVE) && CPU(ARM64) ++ static inline void linuxPageFlush(uintptr_t start, uintptr_t end) ++ { ++ // NOTE(CUSTOMIZE_REACT_NATIVE): The code mostly copied from LLVM compiler-rt ++ // https://github.com/llvm-mirror/compiler-rt/blob/ff75f2a0260b1940436a483413091c5770427c04/lib/builtins/clear_cache.c#L142 ++ // But only to modify "dc cvau" to "dc civac" ++ ++ uint64_t xstart = (uint64_t)(uintptr_t)start; ++ uint64_t xend = (uint64_t)(uintptr_t)end; ++ uint64_t addr; ++ ++ // Get Cache Type Info ++ uint64_t ctr_el0; ++ __asm __volatile("mrs %0, ctr_el0" : "=r"(ctr_el0)); ++ ++ // dc & ic instructions must use 64bit registers so we don't use ++ // uintptr_t in case this runs in an IPL32 environment. ++ const size_t dcache_line_size = 4 << ((ctr_el0 >> 16) & 15); ++ for (addr = xstart & ~(dcache_line_size - 1); addr < xend; ++ addr += dcache_line_size) ++ __asm __volatile("dc civac, %0" ::"r"(addr)); ++ __asm __volatile("dsb ish"); ++ ++ const size_t icache_line_size = 4 << ((ctr_el0 >> 0) & 15); ++ for (addr = xstart & ~(icache_line_size - 1); addr < xend; ++ addr += icache_line_size) ++ __asm __volatile("ic ivau, %0" ::"r"(addr)); ++ __asm __volatile("isb sy"); ++ } ++#elif OS(LINUX) && COMPILER(GCC_COMPATIBLE) + static inline void linuxPageFlush(uintptr_t begin, uintptr_t end) + { + __builtin___clear_cache(reinterpret_cast(begin), reinterpret_cast(end)); diff --git a/patches/jsc_fix_build_error_disable_dfg.patch b/patches/jsc_fix_build_error_disable_dfg.patch deleted file mode 100644 index 8f4ea8de4..000000000 --- a/patches/jsc_fix_build_error_disable_dfg.patch +++ /dev/null @@ -1,71 +0,0 @@ -diff -aru target-org/webkit/Source/JavaScriptCore/bytecode/CodeBlock.cpp target/webkit/Source/JavaScriptCore/bytecode/CodeBlock.cpp ---- target-org/webkit/Source/JavaScriptCore/bytecode/CodeBlock.cpp 2019-03-26 11:25:13.000000000 +0800 -+++ target/webkit/Source/JavaScriptCore/bytecode/CodeBlock.cpp 2019-03-26 16:41:18.000000000 +0800 -@@ -1437,6 +1437,7 @@ - result.add(callLinkInfo->codeOrigin(), ICStatus()).iterator->value.callLinkInfo = callLinkInfo; - for (ByValInfo* byValInfo : m_byValInfos) - result.add(CodeOrigin(byValInfo->bytecodeIndex), ICStatus()).iterator->value.byValInfo = byValInfo; -+#if ENABLE(DFG_JIT) || ENABLE(FTL_JIT) - if (JITCode::isOptimizingJIT(jitType())) { - DFG::CommonData* dfgCommon = m_jitCode->dfgCommon(); - for (auto& pair : dfgCommon->recordedStatuses.calls) -@@ -1448,6 +1449,7 @@ - for (auto& pair : dfgCommon->recordedStatuses.ins) - result.add(pair.first, ICStatus()).iterator->value.inStatus = pair.second.get(); - } -+#endif // ENABLE(DFG_JIT) || ENABLE(FTL_JIT) - } - #else - UNUSED_PARAM(result); -diff -aru target-org/webkit/Source/JavaScriptCore/bytecode/InByIdStatus.cpp target/webkit/Source/JavaScriptCore/bytecode/InByIdStatus.cpp ---- target-org/webkit/Source/JavaScriptCore/bytecode/InByIdStatus.cpp 2019-03-26 11:25:13.000000000 +0800 -+++ target/webkit/Source/JavaScriptCore/bytecode/InByIdStatus.cpp 2019-03-26 16:41:18.000000000 +0800 -@@ -72,6 +72,7 @@ - CodeBlock* profiledBlock, ICStatusMap& baselineMap, - ICStatusContextStack& contextStack, CodeOrigin codeOrigin, UniquedStringImpl* uid) - { -+#if ENABLE(DFG_JIT) - ExitFlag didExit = hasBadCacheExitSite(profiledBlock, codeOrigin.bytecodeIndex); - - for (ICStatusContext* context : contextStack) { -@@ -104,6 +105,10 @@ - } - - return computeFor(profiledBlock, baselineMap, codeOrigin.bytecodeIndex, uid, didExit); -+#else // ENABLE(DFG_JIT) -+ InByIdStatus result; -+ return result; -+#endif - } - #endif // ENABLE(JIT) - -diff -aru target-org/webkit/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp target/webkit/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp ---- target-org/webkit/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp 2019-03-26 11:25:14.000000000 +0800 -+++ target/webkit/Source/JavaScriptCore/bytecode/PutByIdStatus.cpp 2019-03-26 16:46:07.000000000 +0800 -@@ -118,7 +118,7 @@ - return computeFromLLInt(profiledBlock, bytecodeIndex, uid); - - return result; --#else // ENABLE(JIT) -+#else // ENABLE(DFG_JIT) - UNUSED_PARAM(map); - return PutByIdStatus(NoInformation); - #endif // ENABLE(JIT) -@@ -244,6 +244,7 @@ - - PutByIdStatus PutByIdStatus::computeFor(CodeBlock* baselineBlock, ICStatusMap& baselineMap, ICStatusContextStack& contextStack, CodeOrigin codeOrigin, UniquedStringImpl* uid) - { -+#if ENABLE(DFG_JIT) - CallLinkStatus::ExitSiteData callExitSiteData = - CallLinkStatus::computeExitSiteData(baselineBlock, codeOrigin.bytecodeIndex); - ExitFlag didExit = hasExitSite(baselineBlock, codeOrigin.bytecodeIndex); -@@ -280,6 +281,9 @@ - } - - return computeFor(baselineBlock, baselineMap, codeOrigin.bytecodeIndex, uid, didExit, callExitSiteData); -+#else // ENABLE(DFG_JIT) -+ return PutByIdStatus(NoInformation); -+#endif // ENABLE(DFG_JIT) - } - - PutByIdStatus PutByIdStatus::computeFor(JSGlobalObject* globalObject, const StructureSet& set, UniquedStringImpl* uid, bool isDirect) diff --git a/patches/jsc_fix_build_error_getline.patch b/patches/jsc_fix_build_error_getline.patch index bf34e05c0..35a695de7 100644 --- a/patches/jsc_fix_build_error_getline.patch +++ b/patches/jsc_fix_build_error_getline.patch @@ -1,6 +1,6 @@ diff -aur target-org/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp target/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp ---- target-org/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp 2018-11-11 23:05:48.000000000 +0800 -+++ target/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp 2018-11-12 23:39:22.000000000 +0800 +--- target-org/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp 2019-06-18 21:49:53.000000000 +0800 ++++ target/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp 2019-06-18 22:44:39.000000000 +0800 @@ -23,6 +23,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ @@ -10,10 +10,11 @@ diff -aur target-org/webkit/Source/WTF/wtf/linux/MemoryFootprintLinux.cpp target +#if !defined(CUSTOMIZE_REACT_NATIVE) + #include "config.h" - #include "MemoryFootprint.h" + #include -@@ -107,3 +111,4 @@ +@@ -100,3 +104,5 @@ } - } + } // namespace WTF ++ +#endif // !defined(CUSTOMIZE_REACT_NATIVE) diff --git a/patches/jsc_fix_build_error_log2.patch b/patches/jsc_fix_build_error_log2.patch index 29c8239c8..37644fd31 100644 --- a/patches/jsc_fix_build_error_log2.patch +++ b/patches/jsc_fix_build_error_log2.patch @@ -1,7 +1,7 @@ diff -aur target-org/webkit/Source/JavaScriptCore/Sources.txt target/webkit/Source/JavaScriptCore/Sources.txt --- target-org/webkit/Source/JavaScriptCore/Sources.txt 2018-11-11 23:05:40.000000000 +0800 +++ target/webkit/Source/JavaScriptCore/Sources.txt 2018-11-12 00:03:26.000000000 +0800 -@@ -1045,3 +1045,6 @@ +@@ -1053,3 +1053,6 @@ // Derived Sources yarr/YarrCanonicalizeUnicode.cpp diff --git a/patches/jsc_fix_build_error_miss_headers.patch b/patches/jsc_fix_build_error_miss_headers.patch new file mode 100644 index 000000000..7d076b857 --- /dev/null +++ b/patches/jsc_fix_build_error_miss_headers.patch @@ -0,0 +1,14 @@ +diff -aur target-org/webkit/Source/JavaScriptCore/assembler/PerfLog.cpp target/webkit/Source/JavaScriptCore/assembler/PerfLog.cpp +--- target-org/webkit/Source/JavaScriptCore/assembler/PerfLog.cpp 2019-06-18 21:49:21.000000000 +0800 ++++ target/webkit/Source/JavaScriptCore/assembler/PerfLog.cpp 2019-06-18 23:12:38.000000000 +0800 +@@ -41,6 +41,10 @@ + #include + #include + ++#if defined(CUSTOMIZE_REACT_NATIVE) ++#include ++#endif // defined(CUSTOMIZE_REACT_NATIVE) ++ + namespace JSC { + + namespace PerfLogInternal { diff --git a/patches/jsc_fix_build_error_mulodi4.patch b/patches/jsc_fix_build_error_mulodi4.patch index f3430a32d..5a92e05b3 100644 --- a/patches/jsc_fix_build_error_mulodi4.patch +++ b/patches/jsc_fix_build_error_mulodi4.patch @@ -1,30 +1,29 @@ -diff -aur target-org/webkit/Source/WTF/wtf/CheckedArithmetic.h target/webkit/Source/WTF/wtf/CheckedArithmetic.h ---- target-org/webkit/Source/WTF/wtf/CheckedArithmetic.h 2018-07-26 17:00:09.000000000 +0800 -+++ target/webkit/Source/WTF/wtf/CheckedArithmetic.h 2019-04-12 12:03:55.000000000 +0800 -@@ -317,7 +317,7 @@ - +--- target-org/webkit/Source/WTF/wtf/CheckedArithmetic.h 2019-06-18 21:49:53.000000000 +0800 ++++ target/webkit/Source/WTF/wtf/CheckedArithmetic.h 2019-06-18 22:44:39.000000000 +0800 +@@ -360,7 +360,7 @@ + static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN { --#if COMPILER(GCC_OR_CLANG) -+#if COMPILER(GCC_OR_CLANG) && CPU(ARM_THUMB2) && defined(NDEBUG) +-#if COMPILER(GCC_COMPATIBLE) ++#if COMPILER(GCC_COMPATIBLE) && CPU(ARM_THUMB2) && defined(NDEBUG) ResultType temp; if (__builtin_mul_overflow(lhs, rhs, &temp)) return false; -@@ -390,7 +390,7 @@ - +@@ -433,7 +433,7 @@ + static inline bool multiply(LHS lhs, RHS rhs, ResultType& result) WARN_UNUSED_RETURN { --#if COMPILER(GCC_OR_CLANG) -+#if COMPILER(GCC_OR_CLANG) && CPU(ARM_THUMB2) && defined(NDEBUG) +-#if COMPILER(GCC_COMPATIBLE) ++#if COMPILER(GCC_COMPATIBLE) && CPU(ARM_THUMB2) && defined(NDEBUG) ResultType temp; if (__builtin_mul_overflow(lhs, rhs, &temp)) return false; -@@ -453,7 +453,7 @@ - +@@ -496,7 +496,7 @@ + static inline bool multiply(int64_t lhs, int64_t rhs, ResultType& result) { --#if COMPILER(GCC_OR_CLANG) -+#if COMPILER(GCC_OR_CLANG) && CPU(ARM_THUMB2) && defined(NDEBUG) +-#if COMPILER(GCC_COMPATIBLE) ++#if COMPILER(GCC_COMPATIBLE) && CPU(ARM_THUMB2) && defined(NDEBUG) ResultType temp; if (__builtin_mul_overflow(lhs, rhs, &temp)) return false; diff --git a/patches/jsc_fix_build_error_statvfs.patch b/patches/jsc_fix_build_error_statvfs.patch new file mode 100644 index 000000000..084a37bee --- /dev/null +++ b/patches/jsc_fix_build_error_statvfs.patch @@ -0,0 +1,15 @@ +diff -aur target-org/webkit/Source/WTF/wtf/posix/FileSystemPOSIX.cpp target/webkit/Source/WTF/wtf/posix/FileSystemPOSIX.cpp +--- target-org/webkit/Source/WTF/wtf/posix/FileSystemPOSIX.cpp 2019-06-18 21:49:52.000000000 +0800 ++++ target/webkit/Source/WTF/wtf/posix/FileSystemPOSIX.cpp 2019-06-18 22:58:46.000000000 +0800 +@@ -45,6 +45,11 @@ + #include + #include + ++#if defined(CUSTOMIZE_REACT_NATIVE) && defined(__ANDROID__) && __ANDROID_API__ < 19 ++#include ++#define statvfs statfs ++#endif // defined(CUSTOMIZE_REACT_NATIVE) && defined(__ANDROID__) && __ANDROID_API__ < 19 ++ + namespace WTF { + + namespace FileSystemImpl { diff --git a/patches/jsc_fix_build_error_stringview.patch b/patches/jsc_fix_build_error_stringview.patch index b3162413d..81892cd5b 100644 --- a/patches/jsc_fix_build_error_stringview.patch +++ b/patches/jsc_fix_build_error_stringview.patch @@ -1,10 +1,10 @@ diff -aur target-org/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp target/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp ---- target-org/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp 2014-03-15 05:08:27.000000000 +0100 -+++ target/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp 2017-07-11 11:36:01.845264855 +0200 +--- target-org/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp 2019-06-18 21:49:52.000000000 +0800 ++++ target/webkit/Source/WTF/wtf/unicode/CollatorDefault.cpp 2019-06-18 22:44:39.000000000 +0800 @@ -28,12 +28,13 @@ #include "config.h" - #include "Collator.h" + #include +#include #if UCONFIG_NO_COLLATION diff --git a/patches/jsc_icu_integrate.patch b/patches/jsc_icu_integrate.patch index 382111f11..dea1db4e5 100644 --- a/patches/jsc_icu_integrate.patch +++ b/patches/jsc_icu_integrate.patch @@ -53,7 +53,7 @@ diff -aur target-org/webkit/Source/cmake/FindICU.cmake target/webkit/Source/cmak diff -aur target-org/webkit/Source/JavaScriptCore/CMakeLists.txt target/webkit/Source/JavaScriptCore/CMakeLists.txt --- target-org/webkit/Source/JavaScriptCore/CMakeLists.txt 2018-07-25 09:56:23.662494914 +0200 +++ target/webkit/Source/JavaScriptCore/CMakeLists.txt 2018-07-18 12:55:24.726736260 +0200 -@@ -118,6 +118,8 @@ +@@ -120,6 +120,8 @@ set(JavaScriptCore_LIBRARIES WTF${DEBUG_SUFFIX} ${ICU_I18N_LIBRARIES} diff --git a/patches/jsc_startup_log_version.patch b/patches/jsc_startup_log_version.patch index 4b8143cfb..c9dd60ecd 100644 --- a/patches/jsc_startup_log_version.patch +++ b/patches/jsc_startup_log_version.patch @@ -13,7 +13,7 @@ diff -aur target-org/webkit/Source/JavaScriptCore/API/JSBase.cpp target/webkit/S +} --- target-org/webkit/Source/JavaScriptCore/CMakeLists.txt 2019-03-26 13:04:34.000000000 +0800 +++ target/webkit/Source/JavaScriptCore/CMakeLists.txt 2019-03-26 13:01:41.000000000 +0800 -@@ -120,7 +120,9 @@ +@@ -122,7 +122,9 @@ ${ICU_I18N_LIBRARIES} ${ICU_LIBRARIES} ${ICU_DATA_LIBRARIES} diff --git a/scripts/compile/jsc.sh b/scripts/compile/jsc.sh index d79326302..b51545f92 100755 --- a/scripts/compile/jsc.sh +++ b/scripts/compile/jsc.sh @@ -50,6 +50,19 @@ else BUILD_TYPE_FLAGS="-DDEBUG_FISSION=OFF" fi +if [[ "$ARCH_NAME" = "i686" ]] +then + JSC_FEATURE_FLAGS=" \ + -DENABLE_JIT=OFF \ + -DENABLE_C_LOOP=ON \ + " +else + JSC_FEATURE_FLAGS=" \ + -DENABLE_JIT=ON \ + -DENABLE_C_LOOP=OFF \ + " +fi + $TARGETDIR/webkit/Tools/Scripts/build-webkit \ --jsc-only \ $BUILD_TYPE_CONFIG \ @@ -79,10 +92,11 @@ $TARGETDIR/webkit/Tools/Scripts/build-webkit \ -DCMAKE_VERBOSE_MAKEFILE=on \ -DENABLE_API_TESTS=OFF \ -DENABLE_SAMPLING_PROFILER=OFF \ - -DENABLE_JIT=OFF \ -DENABLE_DFG_JIT=OFF \ -DENABLE_FTL_JIT=OFF \ + -DUSE_SYSTEM_MALLOC=OFF \ -DJSC_VERSION=\"${JSC_VERSION}\" \ + $JSC_FEATURE_FLAGS \ $BUILD_TYPE_FLAGS \ " diff --git a/scripts/patch.sh b/scripts/patch.sh index 32e586b61..8b806f52d 100755 --- a/scripts/patch.sh +++ b/scripts/patch.sh @@ -46,8 +46,15 @@ JSC_PATCHSET=( # (However, NDK r19 fixed this) "jsc_fix_build_error_mulodi4.patch" - # Fix build error if disabling DFG_JIT - "jsc_fix_build_error_disable_dfg.patch" + # statvfs is provided after NDK API level 19. + # Use statfs as fallback + "jsc_fix_build_error_statvfs.patch" + + # Misc errors + "jsc_fix_build_error_miss_headers.patch" + + # Workaround JIT crash on arm64, especially for Saumsung S7 Edge + "jsc_fix_arm64_jit_crash.patch" ) if [[ "$I18N" = false ]]