Skip to content

Commit

Permalink
🐳 chore: Upgrade V8 to v12.7.224.16
Browse files Browse the repository at this point in the history
  • Loading branch information
caoccao committed Jul 18, 2024
1 parent 7b46a51 commit e741099
Show file tree
Hide file tree
Showing 30 changed files with 30 additions and 108 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: 12.6.228.13
JAVET_V8_VERSION: 12.7.224.16
JAVET_VERSION: 3.1.4
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: 20.15.1
JAVET_V8_VERSION: 12.6.228.13
JAVET_V8_VERSION: 12.7.224.16
JAVET_VERSION: 3.1.4

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: 20.15.1
JAVET_V8_VERSION: 12.6.228.13
JAVET_V8_VERSION: 12.7.224.16
JAVET_VERSION: 3.1.4

# 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: 20.15.1
JAVET_V8_VERSION: 12.6.228.13
JAVET_V8_VERSION: 12.7.224.16
JAVET_VERSION: 3.1.4
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: 20.15.1
JAVET_V8_VERSION: 12.6.228.13
JAVET_V8_VERSION: 12.7.224.16
JAVET_VERSION: 3.1.4
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: 20.15.1
JAVET_V8_VERSION: 12.6.228.13
JAVET_V8_VERSION: 12.7.224.16
JAVET_VERSION: 3.1.4
ROOT: /Users/runner/work/Javet

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ arm ✔️ ❌ ❌ ❌
arm64 ✔️ ✔️ ✔️ ❌
=========== ======= ======= ======= =======

* Node.js ``v20.15.1`` + V8 ``v12.6.228.13``
* Node.js ``v20.15.1`` + V8 ``v12.7.224.16``
* Dynamic switch between Node.js and V8 mode (`Which mode do you prefer? <https://github.com/caoccao/Javet/discussions/92>`_)
* Polyfill V8 mode with `Javenode <https://github.com/caoccao/Javenode>`_
* V8 API exposure in JVM
Expand Down
3 changes: 2 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(JAVET_LIB_ARCH x86_64)
set(JAVET_LIB_ARCH x86_64)
# Generate PDB file
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /MP /O2 /Ob2 /GS-")
# https://learn.microsoft.com/en-us/cpp/build/reference/zc-cplusplus
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /MP /O2 /Ob2 /GS- /Zc:__cplusplus")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_WIN32)
list(APPEND includeDirs $ENV{JAVA_HOME}/include/win32)
Expand Down
8 changes: 0 additions & 8 deletions cpp/jni/com_caoccao_javet_interop_V8Native.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cpp/jni/javet_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,9 @@ namespace Javet {
const jboolean mIsWASM,
const jboolean mIsModule) noexcept {
return std::make_unique<v8::ScriptOrigin>(
#ifdef ENABLE_NODE
v8Context->GetIsolate(),
#endif
ToV8String(jniEnv, v8Context, mResourceName),
(int)mResourceLineOffset,
(int)mResourceColumnOffset,
Expand Down
8 changes: 0 additions & 8 deletions cpp/jni/javet_jni_core_v8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,6 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_hasInternalTy
return false;
}

JNIEXPORT void JNICALL Java_com_caoccao_javet_interop_V8Native_idleNotificationDeadline
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle, jlong deadlineInMillis) {
if (deadlineInMillis > 0) {
RUNTIME_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle);
v8Context->GetIsolate()->IdleNotificationDeadline(((long)deadlineInMillis) / 1000.0);
}
}

JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_isDead
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle) {
auto v8Runtime = Javet::V8Runtime::FromHandle(v8RuntimeHandle);
Expand Down
3 changes: 3 additions & 0 deletions cpp/jni/javet_v8_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* otherwise compilation errors will take place.
*/

#pragma warning(disable: 4065)
#pragma warning(disable: 4146)
#pragma warning(disable: 4244)
#pragma warning(disable: 4267)
Expand All @@ -46,6 +47,8 @@
#include <src/inspector/v8-debugger.h>
#include <src/inspector/v8-inspector-impl.h>

#pragma warning(default: 4065)
#pragma warning(default: 4146)
#pragma warning(default: 4244)
#pragma warning(default: 4267)
#pragma warning(default: 4291)
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:3.1.4 -f docker/android/base.Dockerfile .

ARG JAVET_V8_VERSION=12.6.228.13
ARG JAVET_V8_VERSION=12.7.224.16

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:3.1.4 -f docker/linux-arm64/base_all_in_one.Dockerfile .

ARG JAVET_NODE_VERSION=18.15.0
ARG JAVET_V8_VERSION=12.6.228.13
ARG JAVET_V8_VERSION=12.7.224.16

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_12.6.228.13 \
# -t sjtucaocao/javet:arm64-base-v8_12.7.224.16 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
# --build-arg JAVET_V8_VERSION=12.6.228.13 \
# --build-arg JAVET_V8_VERSION=12.7.224.16 \
# -f docker/linux-arm64/base_v8.Dockerfile .

ARG JAVET_REPO=sjtucaocao/javet
ARG JAVET_V8_VERSION=12.6.228.13
ARG JAVET_V8_VERSION=12.7.224.16

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=20.15.1
ARG JAVET_V8_VERSION=12.6.228.13
ARG JAVET_V8_VERSION=12.7.224.16

# 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_12.6.228.13 \
# -t sjtucaocao/javet:x86_64-base-v8_12.7.224.16 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
# --build-arg JAVET_V8_VERSION=12.6.228.13 \
# --build-arg JAVET_V8_VERSION=12.7.224.16 \
# -f docker/linux-x86_64/base_v8.Dockerfile .

ARG JAVET_REPO=sjtucaocao/javet
ARG JAVET_V8_VERSION=12.6.228.13
ARG JAVET_V8_VERSION=12.7.224.16

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=3.1.4
JAVET_V8_VERSION=12.6.228.13
JAVET_V8_VERSION=12.7.224.16
JAVET_NODE_VERSION=20.15.1
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:3.1.4 -m 4G -f docker/windows-x86_64/base.Dockerfile .

ARG JAVET_NODE_VERSION=20.15.1
ARG JAVET_V8_VERSION=12.6.228.13
ARG JAVET_V8_VERSION=12.7.224.16

# https://hub.docker.com/_/microsoft-windows
FROM mcr.microsoft.com/windows:20H2-amd64
Expand Down
7 changes: 0 additions & 7 deletions docs/reference/resource_management/memory_management.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,6 @@ V8Runtime.await()

This API represents a light-weighted way of giving V8 a hint to perform GC. It actually tells Node.js or V8 runtime to drain the message or task queue. As a side effect of the drain, a GC may occur based on the decision of Node.js or V8 runtime.

V8Runtime.idleNotificationDeadline(long deadlineInMillis)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This API explicitly tells Node.js or V8 runtime that the application expects a GC to happen in the given milliseconds. Be careful, Node.js or V8 runtime may disregard this instruction.

V8Runtime.lowMemoryNotification()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -218,7 +213,6 @@ Almost all `V8 options <https://docs.google.com/document/d/1DFsbyoPcdK1__fe1nBDz
v8Flags.setMaxHeapSize(768);
v8Flags.setMaxOldSpaceSize(512);
v8Flags.setUseStrict(true);
v8Flags.setTrackRetainingPath(true);
v8Flags.setCustomFlags("--max-semi-space-size=384 --min-semi-space-size=256");
// V8 Mode
Expand All @@ -229,7 +223,6 @@ Almost all `V8 options <https://docs.google.com/document/d/1DFsbyoPcdK1__fe1nBDz
v8Flags.setMaxHeapSize(768);
v8Flags.setMaxOldSpaceSize(512);
v8Flags.setUseStrict(true);
v8Flags.setTrackRetainingPath(true);
v8Flags.setCustomFlags("--max-semi-space-size=384 --min-semi-space-size=256");
.. note::
Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes/release_notes_3_1.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ Release Notes 3.1.x
--------------

* Upgraded Node.js to ``v20.15.1`` `(2024-07-08) <https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V20.md#20.15.1>`_
* Upgraded V8 to ``v12.7.224.16`` (2024-07-15)
* Rewrote ``getV8HeapStatistics()``, ``getV8HeapSpaceStatistics()`` for ``V8Runtime`` to remediate the race condition and fixed possible memory leak
* Added ``observerTimeoutMillis`` to ``JavetEngineConfig``
* Added ``V8StatisticsFuture``
* Added ``isStopping()``, ``setStopping()`` to ``NodeRuntime``
* Removed ``idleNotificationDeadline()`` from ``V8Runtime``
* Removed ``--track-retaining-path`` from ``V8Flags``

3.1.3 V8 v12.6
--------------
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 @@ -166,7 +166,7 @@ def update(self) -> None:
def main():
change_node_version = ChangeNodeVersion('20.15.1')
change_node_version.update()
change_v8_version = ChangeV8Version('12.6.228.13')
change_v8_version = ChangeV8Version('12.7.224.16')
change_v8_version.update()
return 0

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/caoccao/javet/enums/JSRuntimeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public enum JSRuntimeType {
*/
V8(
"v8",
"12.6.228.13",
"12.7.224.16",
V8RuntimeOptions::new,
o -> o instanceof V8RuntimeOptions);

Expand Down
2 changes: 0 additions & 2 deletions src/main/java/com/caoccao/javet/interop/IV8Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,6 @@ boolean functionSetSourceCode(

boolean hasScheduledException(long v8RuntimeHandle);

void idleNotificationDeadline(long v8RuntimeHandle, long deadlineInMillis);

Object integerObjectCreate(long v8RuntimeHandle, int intValue);

Object integerObjectValueOf(long v8RuntimeHandle, long v8ValueHandle, int v8ValueType);
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/com/caoccao/javet/interop/V8Native.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,6 @@ public native boolean functionSetSourceCode(
@Override
public native boolean hasScheduledException(long v8RuntimeHandle);

@Override
public native void idleNotificationDeadline(long v8RuntimeHandle, long deadlineInMillis);

@Override
public native Object integerObjectCreate(long v8RuntimeHandle, int intValue);

Expand Down
12 changes: 0 additions & 12 deletions src/main/java/com/caoccao/javet/interop/V8Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -1768,18 +1768,6 @@ public boolean hasScheduledException() throws JavetException {
return v8Native.hasScheduledException(handle);
}

/**
* Idle notification deadline tells V8 to perform GC in the given millis.
*
* @param deadlineInMillis the deadline in millis
* @since 0.9.1
*/
public void idleNotificationDeadline(long deadlineInMillis) {
if (!isClosed() && deadlineInMillis > 0) {
v8Native.idleNotificationDeadline(handle, deadlineInMillis);
}
}

/**
* Initialize V8 value cache.
*
Expand Down
35 changes: 0 additions & 35 deletions src/main/java/com/caoccao/javet/interop/options/V8Flags.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,6 @@ public final class V8Flags {
* @since 0.9.13
*/
public static final String FLAG_MAX_HEAP_SIZE = "--max-heap-size";
/**
* The constant FLAG_TRACK_RETAINING_PATH.
*
* @since 0.9.13
*/
public static final String FLAG_TRACK_RETAINING_PATH = "--track-retaining-path";
/**
* The constant FLAG_USE_STRICT.
*
Expand All @@ -87,7 +81,6 @@ public final class V8Flags {
private int maxHeapSize;
private int maxOldSpaceSize;
private boolean sealed;
private boolean trackRetainingPath;
private boolean useStrict;

/**
Expand All @@ -104,7 +97,6 @@ public final class V8Flags {
maxHeapSize = 0;
maxOldSpaceSize = 0;
sealed = false;
trackRetainingPath = false;
useStrict = true;
}

Expand Down Expand Up @@ -192,16 +184,6 @@ public boolean isSealed() {
return sealed;
}

/**
* Is track retaining path.
*
* @return the boolean
* @since 0.7.0
*/
public boolean isTrackRetainingPath() {
return trackRetainingPath;
}

/**
* Is use strict.
*
Expand Down Expand Up @@ -335,20 +317,6 @@ public V8Flags setMaxOldSpaceSize(int maxOldSpaceSize) {
return this;
}

/**
* Sets track retaining path.
*
* @param trackRetainingPath the track retaining path
* @return the self
* @since 0.7.0
*/
public V8Flags setTrackRetainingPath(boolean trackRetainingPath) {
if (!sealed) {
this.trackRetainingPath = trackRetainingPath;
}
return this;
}

/**
* Sets use strict.
*
Expand Down Expand Up @@ -387,9 +355,6 @@ public String toString() {
if (useStrict) {
tokens.add(FLAG_USE_STRICT);
}
if (trackRetainingPath) {
tokens.add(FLAG_TRACK_RETAINING_PATH);
}
Collections.sort(tokens, String::compareTo);
if (StringUtils.isNotEmpty(customFlags)) {
tokens.add(customFlags);
Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/caoccao/javet/BaseTestJavet.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public BaseTestJavet(JSRuntimeType jsRuntimeType) {
v8Flags.setMaxHeapSize(768);
v8Flags.setMaxOldSpaceSize(512);
v8Flags.setUseStrict(true);
v8Flags.setTrackRetainingPath(true);
}
}
if (jsRuntimeType.isNode()) {
Expand Down
Loading

0 comments on commit e741099

Please sign in to comment.