diff --git a/.github/workflows/android_v8_build.yml b/.github/workflows/android_v8_build.yml index c44a49d7..950f3c1b 100644 --- a/.github/workflows/android_v8_build.yml +++ b/.github/workflows/android_v8_build.yml @@ -8,7 +8,7 @@ on: workflow_dispatch: env: - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 ROOT: /home/runner/work/Javet diff --git a/.github/workflows/linux_build_artifact.yml b/.github/workflows/linux_build_artifact.yml index 1251c866..45be2058 100644 --- a/.github/workflows/linux_build_artifact.yml +++ b/.github/workflows/linux_build_artifact.yml @@ -18,7 +18,7 @@ env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }} JAVET_NODE_VERSION: 22.11.0 - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 jobs: diff --git a/.github/workflows/linux_build_node_v8_image.yml b/.github/workflows/linux_build_node_v8_image.yml index 53e4b7b3..6a583f3c 100644 --- a/.github/workflows/linux_build_node_v8_image.yml +++ b/.github/workflows/linux_build_node_v8_image.yml @@ -22,7 +22,7 @@ env: DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }} JAVET_NODE_VERSION: 22.11.0 - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 # if we skip a job using a job level `if` condition, then any dependent jobs also don't run. diff --git a/.github/workflows/linux_x86_64_build.yml b/.github/workflows/linux_x86_64_build.yml index 41bff3cf..148154a6 100644 --- a/.github/workflows/linux_x86_64_build.yml +++ b/.github/workflows/linux_x86_64_build.yml @@ -8,7 +8,7 @@ on: env: JAVET_NODE_VERSION: 22.11.0 - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 ROOT: /home/runner/work/Javet diff --git a/.github/workflows/macos_arm64_build.yml b/.github/workflows/macos_arm64_build.yml index 3ccc6bff..65c4178f 100644 --- a/.github/workflows/macos_arm64_build.yml +++ b/.github/workflows/macos_arm64_build.yml @@ -8,7 +8,7 @@ on: env: JAVET_NODE_VERSION: 22.11.0 - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 ROOT: /Users/runner/work/Javet diff --git a/.github/workflows/macos_x86_64_build.yml b/.github/workflows/macos_x86_64_build.yml index 797b7ddb..813739ea 100644 --- a/.github/workflows/macos_x86_64_build.yml +++ b/.github/workflows/macos_x86_64_build.yml @@ -8,7 +8,7 @@ on: env: JAVET_NODE_VERSION: 22.11.0 - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 ROOT: /Users/runner/work/Javet diff --git a/.github/workflows/windows_x86_64_build.yml b/.github/workflows/windows_x86_64_build.yml index 05129078..4e0e47d0 100644 --- a/.github/workflows/windows_x86_64_build.yml +++ b/.github/workflows/windows_x86_64_build.yml @@ -8,7 +8,7 @@ on: env: JAVET_NODE_VERSION: 22.11.0 - JAVET_V8_VERSION: 13.0.245.16 + JAVET_V8_VERSION: 13.1.201.8 JAVET_VERSION: 4.1.0 ROOT: D:\a\Javet @@ -66,6 +66,7 @@ jobs: python3 tools\dev\v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false ${{ matrix.v8_flag }} v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false ..\depot_tools\gn.bat gen out.gn/x64.release python3 ${{ env.ROOT }}\Javet\scripts\python\patch_v8_build.py -p .\ + ..\depot_tools\ninja.bat -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}\Javet\scripts\python\patch_v8_build.py -p .\ ..\depot_tools\ninja.bat -C out.gn/x64.release v8_monolith move out.gn out.gn.${{ matrix.name }} diff --git a/README.rst b/README.rst index 51952f71..2d038c52 100644 --- a/README.rst +++ b/README.rst @@ -50,7 +50,7 @@ arm ✔️ ❌ ❌ ❌ arm64 ✔️ ✔️ ✔️ ❌ =========== ======= ======= ======= ======= -* Node.js ``v22.11.0`` + V8 ``v13.0.245.16`` +* Node.js ``v22.11.0`` + V8 ``v13.1.201.8`` * i18n and non-i18n * Dynamic switch between Node.js and V8 mode * Polyfill V8 mode with `Javenode `_ diff --git a/cpp/jni/javet_jni_function.cpp b/cpp/jni/javet_jni_function.cpp index d6b12860..478f2375 100644 --- a/cpp/jni/javet_jni_function.cpp +++ b/cpp/jni/javet_jni_function.cpp @@ -151,25 +151,6 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionCopyS // Clone the shared function info targetV8InternalShared = *v8InternalIsolate->factory()->CloneSharedFunctionInfo( v8::internal::handle(sourceV8InternalShared, v8InternalIsolate)); - // Clone the scope info -#ifdef ENABLE_NODE - auto sourceScopeInfo = sourceV8InternalShared->scope_info(); - auto emptyBlocklistHandle = V8InternalStringSet::New(v8InternalIsolate); - auto targetScopeInfo = *V8InternalScopeInfo::RecreateWithBlockList( - v8InternalIsolate, v8::internal::handle(sourceScopeInfo, v8InternalIsolate), emptyBlocklistHandle); - targetV8InternalShared->set_raw_scope_info(targetScopeInfo); -#else - auto sourceScopeInfo = sourceV8InternalShared->scope_info(); - const int length = (sourceScopeInfo->AllocatedSize() - V8InternalHeapObject::kHeaderSize) / v8::internal::kTaggedSize; - auto targetScopeInfo = v8InternalIsolate->factory()->NewScopeInfo(length); - v8InternalIsolate->heap()->CopyRange( - *targetScopeInfo, - targetScopeInfo->data_start(), - sourceScopeInfo->data_start(), - length, - V8InternalWriteBarrierMode::UPDATE_WRITE_BARRIER); - targetV8InternalShared->set_raw_scope_info(*targetScopeInfo); -#endif targetV8InternalFunction.set_shared(targetV8InternalShared, V8InternalWriteBarrierMode::UPDATE_WRITE_BARRIER); success = true; } diff --git a/cpp/jni/javet_v8.h b/cpp/jni/javet_v8.h index 7e64801c..742295f6 100644 --- a/cpp/jni/javet_v8.h +++ b/cpp/jni/javet_v8.h @@ -17,11 +17,13 @@ #pragma once +#pragma warning(disable: 4018) #pragma warning(disable: 4244) #include -#pragma warning(default: 4244) #include #include +#pragma warning(default: 4018) +#pragma warning(default: 4244) #ifdef _WIN32 #pragma comment(lib, "DbgHelp.lib") diff --git a/cpp/jni/javet_v8_internal.h b/cpp/jni/javet_v8_internal.h index 5b1aa4a4..3f6ea1b8 100644 --- a/cpp/jni/javet_v8_internal.h +++ b/cpp/jni/javet_v8_internal.h @@ -24,6 +24,7 @@ */ #pragma warning(disable: 4065) +#pragma warning(disable: 4018) #pragma warning(disable: 4146) #pragma warning(disable: 4244) #pragma warning(disable: 4267) @@ -48,6 +49,7 @@ #include #pragma warning(default: 4065) +#pragma warning(default: 4018) #pragma warning(default: 4146) #pragma warning(default: 4244) #pragma warning(default: 4267) diff --git a/docker/android/base.Dockerfile b/docker/android/base.Dockerfile index 061d6ad9..d0806b8d 100644 --- a/docker/android/base.Dockerfile +++ b/docker/android/base.Dockerfile @@ -15,7 +15,7 @@ # Usage: docker build -t sjtucaocao/javet-android:4.1.0 -f docker/android/base.Dockerfile . -ARG JAVET_V8_VERSION=13.0.245.16 +ARG JAVET_V8_VERSION=13.1.201.8 FROM ubuntu:20.04 WORKDIR / diff --git a/docker/linux-arm64/base_all_in_one.Dockerfile b/docker/linux-arm64/base_all_in_one.Dockerfile index 1ee3cf2a..98754838 100644 --- a/docker/linux-arm64/base_all_in_one.Dockerfile +++ b/docker/linux-arm64/base_all_in_one.Dockerfile @@ -16,7 +16,7 @@ # Usage: docker build -t sjtucaocao/javet-arm64:4.1.0 -f docker/linux-arm64/base_all_in_one.Dockerfile . ARG JAVET_NODE_VERSION=18.15.0 -ARG JAVET_V8_VERSION=13.0.245.16 +ARG JAVET_V8_VERSION=13.1.201.8 FROM ubuntu:20.04 WORKDIR / diff --git a/docker/linux-arm64/base_v8.Dockerfile b/docker/linux-arm64/base_v8.Dockerfile index 7c11d1a7..5b842a6f 100644 --- a/docker/linux-arm64/base_v8.Dockerfile +++ b/docker/linux-arm64/base_v8.Dockerfile @@ -14,13 +14,13 @@ # limitations under the License. # Usage: docker build \ -# -t sjtucaocao/javet:arm64-base-v8_13.0.245.16 \ +# -t sjtucaocao/javet:arm64-base-v8_13.1.201.8 \ # --build-arg JAVET_REPO=sjtucaocao/javet \ -# --build-arg JAVET_V8_VERSION=13.0.245.16 \ +# --build-arg JAVET_V8_VERSION=13.1.201.8 \ # -f docker/linux-arm64/base_v8.Dockerfile . ARG JAVET_REPO=sjtucaocao/javet -ARG JAVET_V8_VERSION=13.0.245.16 +ARG JAVET_V8_VERSION=13.1.201.8 FROM ${JAVET_REPO}:arm64-base-jvm diff --git a/docker/linux-x86_64/base_all_in_one.Dockerfile b/docker/linux-x86_64/base_all_in_one.Dockerfile index 24422c0f..460405db 100644 --- a/docker/linux-x86_64/base_all_in_one.Dockerfile +++ b/docker/linux-x86_64/base_all_in_one.Dockerfile @@ -19,7 +19,7 @@ FROM ubuntu:20.04 WORKDIR / ARG JAVET_NODE_VERSION=22.11.0 -ARG JAVET_V8_VERSION=13.0.245.16 +ARG JAVET_V8_VERSION=13.1.201.8 # Update Ubuntu ENV DEBIAN_FRONTEND=noninteractive diff --git a/docker/linux-x86_64/base_v8.Dockerfile b/docker/linux-x86_64/base_v8.Dockerfile index 7c8565a6..4efdebfb 100644 --- a/docker/linux-x86_64/base_v8.Dockerfile +++ b/docker/linux-x86_64/base_v8.Dockerfile @@ -14,13 +14,13 @@ # limitations under the License. # Usage: docker build \ -# -t sjtucaocao/javet:x86_64-base-v8_13.0.245.16 \ +# -t sjtucaocao/javet:x86_64-base-v8_13.1.201.8 \ # --build-arg JAVET_REPO=sjtucaocao/javet \ -# --build-arg JAVET_V8_VERSION=13.0.245.16 \ +# --build-arg JAVET_V8_VERSION=13.1.201.8 \ # -f docker/linux-x86_64/base_v8.Dockerfile . ARG JAVET_REPO=sjtucaocao/javet -ARG JAVET_V8_VERSION=13.0.245.16 +ARG JAVET_V8_VERSION=13.1.201.8 FROM ${JAVET_REPO}:x86_64-base-jvm diff --git a/docker/linux-x86_64/build.env b/docker/linux-x86_64/build.env index 14b2b5dd..b46235f2 100644 --- a/docker/linux-x86_64/build.env +++ b/docker/linux-x86_64/build.env @@ -1,4 +1,4 @@ JAVET_REPO=sjtucaocao/javet JAVET_VERSION=4.1.0 -JAVET_V8_VERSION=13.0.245.16 +JAVET_V8_VERSION=13.1.201.8 JAVET_NODE_VERSION=22.11.0 diff --git a/docker/windows-x86_64/base.Dockerfile b/docker/windows-x86_64/base.Dockerfile index 09b5bc37..066cc5a7 100644 --- a/docker/windows-x86_64/base.Dockerfile +++ b/docker/windows-x86_64/base.Dockerfile @@ -32,7 +32,7 @@ # Usage: docker build -t sjtucaocao/javet-windows:4.1.0 -m 4G -f docker/windows-x86_64/base.Dockerfile . ARG JAVET_NODE_VERSION=22.11.0 -ARG JAVET_V8_VERSION=13.0.245.16 +ARG JAVET_V8_VERSION=13.1.201.8 # https://hub.docker.com/_/microsoft-windows FROM mcr.microsoft.com/windows:20H2-amd64 diff --git a/docs/release_notes/release_notes_4_0.rst b/docs/release_notes/release_notes_4_0.rst index 9d7358e4..b7c6e533 100644 --- a/docs/release_notes/release_notes_4_0.rst +++ b/docs/release_notes/release_notes_4_0.rst @@ -6,6 +6,7 @@ Release Notes 4.0.x - 4.1.x ----- * Upgraded Node.js to ``v22.11.0`` `(2024-10-29) `_ +* Upgraded V8 to ``v13.1.201.8`` (2024-11-11) * Switched to core dependency + individual native dependency * Supported ``Float16Array`` * Added ``Float16`` diff --git a/scripts/python/change_node_v8_version.py b/scripts/python/change_node_v8_version.py index 14f91403..b5468fb1 100644 --- a/scripts/python/change_node_v8_version.py +++ b/scripts/python/change_node_v8_version.py @@ -172,7 +172,7 @@ def update(self) -> None: def main(): change_node_version = ChangeNodeVersion('22.11.0') change_node_version.update() - change_v8_version = ChangeV8Version('13.0.245.16') + change_v8_version = ChangeV8Version('13.1.201.8') change_v8_version.update() return 0 diff --git a/src/main/java/com/caoccao/javet/enums/JSRuntimeType.java b/src/main/java/com/caoccao/javet/enums/JSRuntimeType.java index ff5ccffc..206dd398 100644 --- a/src/main/java/com/caoccao/javet/enums/JSRuntimeType.java +++ b/src/main/java/com/caoccao/javet/enums/JSRuntimeType.java @@ -60,7 +60,7 @@ public enum JSRuntimeType { V8( "v8", false, - "13.0.245.16", + "13.1.201.8", V8RuntimeOptions::new, o -> o instanceof V8RuntimeOptions), /** @@ -71,7 +71,7 @@ public enum JSRuntimeType { V8I18n( "v8", true, - "13.0.245.16", + "13.1.201.8", V8RuntimeOptions::new, o -> o instanceof V8RuntimeOptions); diff --git a/src/test/java/com/caoccao/javet/values/reference/TestV8ValueFunction.java b/src/test/java/com/caoccao/javet/values/reference/TestV8ValueFunction.java index 9690d00a..161e2f47 100644 --- a/src/test/java/com/caoccao/javet/values/reference/TestV8ValueFunction.java +++ b/src/test/java/com/caoccao/javet/values/reference/TestV8ValueFunction.java @@ -1592,7 +1592,8 @@ public void testGetAndSetScriptSource() throws JavetException { crackedV8ValueFunction.canDiscardCompiled(), "The cracked function should support discard compiled."); assertEquals(2, originalV8ValueFunction.callInteger(null)); - assertEquals(originalScriptSource, originalV8ValueFunction.getScriptSource()); + assertEquals(originalScriptSource.getCode(), originalV8ValueFunction.getScriptSource().getCode()); + assertTrue(originalV8ValueFunction.setScriptSource(originalScriptSource)); assertFalse( originalV8ValueFunction.setScriptSource(originalScriptSource), "The original function remains unchanged.");