From ebf83497762e0f29f2cf2a2629e0cde6a66aee0a Mon Sep 17 00:00:00 2001 From: Elmi Ahmadov Date: Mon, 11 Jul 2022 20:10:38 +0200 Subject: [PATCH] Upgrade V8 to v10.3.174.14 * Bump version to 6.2.2 --- .github/workflows/build_and_release.yml | 4 +- .github/workflows/build_and_test.yml | 10 ++--- CMakeLists.txt | 4 +- build_system/build_settings.py | 2 +- docker/linux/Dockerfile | 2 +- jni/com_eclipsesource_v8_V8Impl.cpp | 2 +- .../java/com/eclipsesource/v8/V8Test.java | 2 +- v8/Dockerfile | 38 +++++++++++-------- 8 files changed, 35 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml index 2951e189a..1a9321043 100644 --- a/.github/workflows/build_and_release.yml +++ b/.github/workflows/build_and_release.yml @@ -13,9 +13,9 @@ jobs: - name: Download monolithic libraries and extract to v8.out run: | - curl -k -O http://download.eclipsesource.com/j2v8/v8/libv8_9.3.345.11_monolith.zip + curl -k -O http://download.eclipsesource.com/j2v8/v8/libv8_10.3.174.14_monolith.zip mkdir -p v8.out - unzip libv8_9.3.345.11_monolith.zip -d v8.out + unzip libv8_10.3.174.14_monolith.zip -d v8.out - name: Start J2V8 build run: | diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 494929f08..21a345090 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -13,9 +13,9 @@ jobs: - name: Download monolithic libraries and extract to v8.out run: | - curl -k -O http://download.eclipsesource.com/j2v8/v8/libv8_9.3.345.11_monolith.zip + curl -k -O http://download.eclipsesource.com/j2v8/v8/libv8_10.3.174.14_monolith.zip mkdir -p v8.out - unzip libv8_9.3.345.11_monolith.zip -d v8.out + unzip libv8_10.3.174.14_monolith.zip -d v8.out - name: Start J2V8 build run: python2 build.py -t linux -a x64 --docker j2v8cmake j2v8jni j2v8cpp j2v8optimize j2v8java j2v8test @@ -24,7 +24,7 @@ jobs: uses: actions/upload-artifact@v1.0.0 with: name: j2v8-linux-x86_64 - path: build.out/j2v8_linux_x86_64-6.2.1.jar + path: build.out/j2v8_linux_x86_64-6.2.2.jar build_j2v8_android: name: Build J2V8 for Android @@ -36,9 +36,9 @@ jobs: - name: Download monolithic libraries and extract to v8.out run: | - curl -k -O http://download.eclipsesource.com/j2v8/v8/libv8_9.3.345.11_monolith.zip + curl -k -O http://download.eclipsesource.com/j2v8/v8/libv8_10.3.174.14_monolith.zip mkdir -p v8.out - unzip libv8_9.3.345.11_monolith.zip -d v8.out + unzip libv8_10.3.174.14_monolith.zip -d v8.out - name: Start J2V8 build run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 4510337bf..6389adc4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,8 +166,8 @@ source_group("" FILES ${src_files}) # BUILD SETTINGS & COMPILATION #----------------------------------------------------------------------- -# tell gcc/clang to use the c++14 standard -set(CMAKE_CXX_STANDARD 14) +# tell gcc/clang to use the c++17 standard +set(CMAKE_CXX_STANDARD 17) if(CMAKE_SYSTEM_NAME STREQUAL "Android") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-function -Wno-unused-variable -O3 -funroll-loops -ftree-vectorize -ffast-math -fpermissive -fPIC ") diff --git a/build_system/build_settings.py b/build_system/build_settings.py index 621a21007..b67cf54d0 100644 --- a/build_system/build_settings.py +++ b/build_system/build_settings.py @@ -16,7 +16,7 @@ # J2V8 settings #----------------------------------------------------------------------- -J2V8_VERSION_MAJOR, J2V8_VERSION_MINOR, J2V8_VERSION_PATCH = 6, 2, 1 +J2V8_VERSION_MAJOR, J2V8_VERSION_MINOR, J2V8_VERSION_PATCH = 6, 2, 2 # J2V8_VERSION_SUFFIX = "-SNAPSHOT" J2V8_VERSION_SUFFIX = "" diff --git a/docker/linux/Dockerfile b/docker/linux/Dockerfile index 349bcad1f..ee89ecaa4 100644 --- a/docker/linux/Dockerfile +++ b/docker/linux/Dockerfile @@ -1,5 +1,5 @@ # sys_image can be overridden from the CLI -ARG sys_image=debian:stable +ARG sys_image=debian:buster FROM $sys_image diff --git a/jni/com_eclipsesource_v8_V8Impl.cpp b/jni/com_eclipsesource_v8_V8Impl.cpp index 58e748bbe..1b21bd55d 100644 --- a/jni/com_eclipsesource_v8_V8Impl.cpp +++ b/jni/com_eclipsesource_v8_V8Impl.cpp @@ -1868,7 +1868,7 @@ JNIEXPORT void JNICALL Java_com_eclipsesource_v8_V8__1setWeak jobject v8 = reinterpret_cast(wrd->v8RuntimePtr)->v8; env->CallVoidMethod(v8, v8WeakReferenceReleased, wrd->objectHandle); delete(wrd); - }, WeakCallbackType::kFinalizer); + }, WeakCallbackType::kParameter); } JNIEXPORT void JNICALL Java_com_eclipsesource_v8_V8__1clearWeak diff --git a/src/test/java/com/eclipsesource/v8/V8Test.java b/src/test/java/com/eclipsesource/v8/V8Test.java index bbdacbc81..577c4f1cc 100644 --- a/src/test/java/com/eclipsesource/v8/V8Test.java +++ b/src/test/java/com/eclipsesource/v8/V8Test.java @@ -74,7 +74,7 @@ public void testLowMemoryNotification() { public void testGetVersion_StartsWith9() { String v8version = V8.getV8Version(); - assertTrue(v8version.startsWith("9.")); + assertTrue(v8version.startsWith("10.")); } @Test diff --git a/v8/Dockerfile b/v8/Dockerfile index 694f3ef0b..b27387dc3 100644 --- a/v8/Dockerfile +++ b/v8/Dockerfile @@ -1,4 +1,4 @@ -ARG sys_image=debian:10 +ARG sys_image=ubuntu:20.04 FROM $sys_image @@ -9,18 +9,24 @@ ARG target_cpu=x64 # Update depedency of V8 RUN apt-get -qq update && \ - DEBIAN_FRONTEND=noninteractive apt-get -qq install -y \ - lsb-release \ - sudo \ - apt-utils \ + DEBIAN_FRONTEND=noninteractive apt-get install --upgrade -qq -y --no-install-recommends \ git \ + curl \ + wget \ + build-essential \ + software-properties-common \ + patchelf \ + sudo \ + zip \ + unzip \ + gcc gcc-multilib \ + g++ g++-multilib \ + execstack \ + python3 \ python \ - lbzip2 \ - curl \ - wget \ - xz-utils \ - g++-8-arm-linux-gnueabihf \ - gcc-arm-linux-gnueabihf + python3-pip \ + python3-distutils \ + python3-testresources RUN mkdir -p /v8build WORKDIR /v8build @@ -33,21 +39,21 @@ RUN echo $PATH # Fetch V8 code RUN fetch v8 WORKDIR /v8build/v8 -RUN git checkout 9.3.345.11 +RUN git checkout 10.3.174.14 +RUN sed -i 's/snapcraft/nosnapcraft/g' ./build/install-build-deps.sh +RUN ./build/install-build-deps.sh +RUN sed -i 's/nosnapcraft/snapcraft/g' ./build/install-build-deps.sh WORKDIR /v8build ENV target_os ${target_os} RUN echo "target_os= ['${target_os}']" >> .gclient RUN gclient sync -WORKDIR /v8build/v8 -COPY install-deps.sh . -RUN echo y | sh install-deps.sh - ENV target_cpu ${target_cpu} ENV build_platform ${target_cpu}.release ENV path_to_args ${target_os}-${target_cpu}/args.gn +WORKDIR /v8build/v8 RUN ./tools/dev/v8gen.py ${build_platform} -vv RUN rm out.gn/${build_platform}/args.gn