Skip to content

Commit

Permalink
🐳 chore: Upgrade V8 to v13.1.201.8
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Nov 13, 2024
1 parent 250cf30 commit 038f6a3
Show file tree
Hide file tree
Showing 22 changed files with 31 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/android_v8_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_build_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_build_node_v8_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_arm64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/windows_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/caoccao/Javenode>`_
Expand Down
19 changes: 0 additions & 19 deletions cpp/jni/javet_jni_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 3 additions & 1 deletion cpp/jni/javet_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

#pragma once

#pragma warning(disable: 4018)
#pragma warning(disable: 4244)
#include <libplatform/libplatform.h>
#pragma warning(default: 4244)
#include <v8.h>
#include <v8-inspector.h>
#pragma warning(default: 4018)
#pragma warning(default: 4244)

#ifdef _WIN32
#pragma comment(lib, "DbgHelp.lib")
Expand Down
2 changes: 2 additions & 0 deletions cpp/jni/javet_v8_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

#pragma warning(disable: 4065)
#pragma warning(disable: 4018)
#pragma warning(disable: 4146)
#pragma warning(disable: 4244)
#pragma warning(disable: 4267)
Expand All @@ -48,6 +49,7 @@
#include <src/inspector/v8-inspector-impl.h>

#pragma warning(default: 4065)
#pragma warning(default: 4018)
#pragma warning(default: 4146)
#pragma warning(default: 4244)
#pragma warning(default: 4267)
Expand Down
2 changes: 1 addition & 1 deletion docker/android/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
2 changes: 1 addition & 1 deletion docker/linux-arm64/base_all_in_one.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 /
Expand Down
6 changes: 3 additions & 3 deletions docker/linux-arm64/base_v8.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker/linux-x86_64/base_all_in_one.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docker/linux-x86_64/base_v8.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion docker/linux-x86_64/build.env
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion docker/windows-x86_64/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docs/release_notes/release_notes_4_0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release Notes 4.0.x - 4.1.x
-----

* Upgraded Node.js to ``v22.11.0`` `(2024-10-29) <https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.11.0>`_
* Upgraded V8 to ``v13.1.201.8`` (2024-11-11)
* Switched to core dependency + individual native dependency
* Supported ``Float16Array``
* Added ``Float16``
Expand Down
2 changes: 1 addition & 1 deletion scripts/python/change_node_v8_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/caoccao/javet/enums/JSRuntimeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public enum JSRuntimeType {
V8(
"v8",
false,
"13.0.245.16",
"13.1.201.8",
V8RuntimeOptions::new,
o -> o instanceof V8RuntimeOptions),
/**
Expand All @@ -71,7 +71,7 @@ public enum JSRuntimeType {
V8I18n(
"v8",
true,
"13.0.245.16",
"13.1.201.8",
V8RuntimeOptions::new,
o -> o instanceof V8RuntimeOptions);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 038f6a3

Please sign in to comment.