diff --git a/.github/workflows/android_build.yml b/.github/workflows/android_build.yml
index d2b609b64..639739b0c 100644
--- a/.github/workflows/android_build.yml
+++ b/.github/workflows/android_build.yml
@@ -8,9 +8,9 @@ on:
workflow_dispatch:
env:
- JAVET_NODE_VERSION: 20.8.0
- JAVET_V8_VERSION: 11.8.172.15
- JAVET_VERSION: 3.0.0
+ JAVET_NODE_VERSION: 20.9.0
+ JAVET_V8_VERSION: 11.9.169.6
+ JAVET_VERSION: 3.0.1
ROOT: /home/runner/work/Javet
jobs:
@@ -37,7 +37,7 @@ jobs:
uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
- local-cache: true
+ local-cache: false
- name: Setup Path
run: |
@@ -61,6 +61,7 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py arm.release -- 'target_os="android"' 'target_cpu="arm"' 'v8_target_cpu="arm"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
+ ninja -C out.gn/arm.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/arm.release v8_monolith
- name: Setup JDK 11
@@ -108,7 +109,7 @@ jobs:
uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
- local-cache: true
+ local-cache: false
- name: Setup Path
run: |
@@ -132,6 +133,7 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py arm64.release -- 'target_os="android"' 'target_cpu="arm64"' 'v8_target_cpu="arm64"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
+ ninja -C out.gn/arm64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/arm64.release v8_monolith
- name: Setup JDK 11
@@ -179,7 +181,7 @@ jobs:
uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
- local-cache: true
+ local-cache: false
- name: Setup Path
run: |
@@ -203,6 +205,7 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py ia32.release -- 'target_os="android"' 'target_cpu="x86"' 'v8_target_cpu="x86"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
+ ninja -C out.gn/ia32.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/ia32.release v8_monolith
- name: Setup JDK 11
@@ -250,7 +253,7 @@ jobs:
uses: nttld/setup-ndk@v1
with:
ndk-version: r25b
- local-cache: true
+ local-cache: false
- name: Setup Path
run: |
@@ -274,6 +277,7 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py x64.release -- 'target_os="android"' 'target_cpu="x64"' 'v8_target_cpu="x64"' v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
+ ninja -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/x64.release v8_monolith
- name: Setup JDK 11
diff --git a/.github/workflows/linux_build_artifact.yml b/.github/workflows/linux_build_artifact.yml
index 59c4e9e3e..033ddefbb 100644
--- a/.github/workflows/linux_build_artifact.yml
+++ b/.github/workflows/linux_build_artifact.yml
@@ -17,9 +17,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
- JAVET_NODE_VERSION: 20.8.0
- JAVET_V8_VERSION: 11.8.172.15
- JAVET_VERSION: 3.0.0
+ JAVET_NODE_VERSION: 20.9.0
+ JAVET_V8_VERSION: 11.9.169.6
+ JAVET_VERSION: 3.0.1
jobs:
javet_linux_x86_64:
diff --git a/.github/workflows/linux_build_node_v8_image.yml b/.github/workflows/linux_build_node_v8_image.yml
index 59aa16c69..7c24f8152 100644
--- a/.github/workflows/linux_build_node_v8_image.yml
+++ b/.github/workflows/linux_build_node_v8_image.yml
@@ -21,9 +21,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
- JAVET_NODE_VERSION: 20.8.0
- JAVET_V8_VERSION: 11.8.172.15
- JAVET_VERSION: 3.0.0
+ JAVET_NODE_VERSION: 20.9.0
+ JAVET_V8_VERSION: 11.9.169.6
+ JAVET_VERSION: 3.0.1
# if we skip a job using a job level `if` condition, then any dependent jobs also don't run.
# we can skip a step of the job, using a step level `if` condition.
diff --git a/.github/workflows/linux_x86_64_build.yml b/.github/workflows/linux_x86_64_build.yml
index 7ca7ba855..97dda9993 100644
--- a/.github/workflows/linux_x86_64_build.yml
+++ b/.github/workflows/linux_x86_64_build.yml
@@ -7,9 +7,9 @@ on:
workflow_dispatch:
env:
- JAVET_NODE_VERSION: 20.8.0
- JAVET_V8_VERSION: 11.8.172.15
- JAVET_VERSION: 3.0.0
+ JAVET_NODE_VERSION: 20.9.0
+ JAVET_V8_VERSION: 11.9.169.6
+ JAVET_VERSION: 3.0.1
ROOT: /home/runner/work/Javet
jobs:
@@ -52,6 +52,7 @@ jobs:
gclient sync -D
cd v8
python3 tools/dev/v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
+ ninja -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/x64.release v8_monolith
- name: Setup JDK 8
diff --git a/.github/workflows/macos_arm64_build.yml b/.github/workflows/macos_arm64_build.yml
index d03d7dcc6..efb2bfcd3 100644
--- a/.github/workflows/macos_arm64_build.yml
+++ b/.github/workflows/macos_arm64_build.yml
@@ -7,9 +7,9 @@ on:
workflow_dispatch:
env:
- JAVET_NODE_VERSION: 20.8.0
+ JAVET_NODE_VERSION: 11.8.172.15
JAVET_V8_VERSION: 11.8.172.15
- JAVET_VERSION: 3.0.0
+ JAVET_VERSION: 3.0.1
ROOT: /Users/runner/work/Javet
jobs:
@@ -53,6 +53,7 @@ jobs:
cd v8
python3 tools/dev/v8gen.py arm64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
gn gen out.gn/arm64.release
+ ninja -C out.gn/arm64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/arm64.release v8_monolith
- name: Setup JDK 8
diff --git a/.github/workflows/macos_x86_64_build.yml b/.github/workflows/macos_x86_64_build.yml
index 7193901af..26a566d8d 100644
--- a/.github/workflows/macos_x86_64_build.yml
+++ b/.github/workflows/macos_x86_64_build.yml
@@ -7,9 +7,9 @@ on:
workflow_dispatch:
env:
- JAVET_NODE_VERSION: 20.8.0
- JAVET_V8_VERSION: 11.8.172.15
- JAVET_VERSION: 3.0.0
+ JAVET_NODE_VERSION: 20.9.0
+ JAVET_V8_VERSION: 11.9.169.6
+ JAVET_VERSION: 3.0.1
ROOT: /Users/runner/work/Javet
jobs:
@@ -53,6 +53,7 @@ jobs:
cd v8
python3 tools/dev/v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false v8_enable_i18n_support=false v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
gn gen out.gn/x64.release
+ ninja -C out.gn/x64.release v8_monolith || python3 ${{ env.ROOT }}/Javet/scripts/python/patch_v8_build.py -p ./
ninja -C out.gn/x64.release v8_monolith
- name: Setup JDK 8
diff --git a/.gitignore b/.gitignore
index c6a0b6d06..7f3a42107 100644
--- a/.gitignore
+++ b/.gitignore
@@ -77,3 +77,8 @@ _build
pom.xml.releaseBackup
release.properties
target
+
+# ------------------------------------------------------------------------------
+# JNI
+
+cpp/build*
diff --git a/.sdkmanrc b/.sdkmanrc
deleted file mode 100644
index 281f1ec43..000000000
--- a/.sdkmanrc
+++ /dev/null
@@ -1,2 +0,0 @@
-gradle=7.2
-java=8.0.312-zulu
diff --git a/README.rst b/README.rst
index ff8943f59..3c37fe7d9 100644
--- a/README.rst
+++ b/README.rst
@@ -3,10 +3,10 @@ Javet
|Maven Central| |Discord| |Donate|
-|Linux x86_64 Build| |MacOS arm64 Build| |MacOS x86_64 Build| |Android Build|
+|Linux x86_64 Build| |MacOS x86_64 Build| |Android Build|
.. |Maven Central| image:: https://img.shields.io/maven-central/v/com.caoccao.javet/javet?style=for-the-badge
- :target: https://search.maven.org/search?q=g:com.caoccao.javet
+ :target: https://central.sonatype.com/search?q=g:com.caoccao.javet
.. |Discord| image:: https://img.shields.io/discord/870518906115211305?label=join%20our%20Discord&style=for-the-badge
:target: https://discord.gg/R4vvKU96gw
@@ -17,9 +17,6 @@ Javet
.. |Linux x86_64 Build| image:: https://github.com/caoccao/Javet/actions/workflows/linux_x86_64_build.yml/badge.svg
:target: https://github.com/caoccao/Javet/actions/workflows/linux_x86_64_build.yml
-.. |MacOS arm64 Build| image:: https://github.com/caoccao/Javet/actions/workflows/macos_arm64_build.yml/badge.svg
- :target: https://github.com/caoccao/Javet/actions/workflows/macos_arm64_build.yml
-
.. |MacOS x86_64 Build| image:: https://github.com/caoccao/Javet/actions/workflows/macos_x86_64_build.yml/badge.svg
:target: https://github.com/caoccao/Javet/actions/workflows/macos_x86_64_build.yml
@@ -38,13 +35,13 @@ Major Features
=========== ======= ======= ======= =======
CPU Arch Android Linux MacOS Windows
=========== ======= ======= ======= =======
-x86 ✔ ❌ ❌ ❌
-x86_64 ✔ ✔ ✔ ✔
-arm ✔ ❌ ❌ ❌
-arm64 ✔ ✔ ✔ ❌
+x86 ✔️ ❌ ❌ ❌
+x86_64 ✔️ ✔️ ✔️ ✔️
+arm ✔️ ❌ ❌ ❌
+arm64 ✔️ ✔️ ✔️ ❌
=========== ======= ======= ======= =======
-* Node.js ``v20.8.0`` + V8 ``v11.8.172.15``
+* Node.js ``v20.9.0`` + V8 ``v11.9.169.6``
* Dynamic switch between Node.js and V8 mode (`Which mode do you prefer? `_)
* Polyfill V8 mode with `Javenode `_
* V8 API exposure in JVM
@@ -53,6 +50,7 @@ arm64 ✔ ✔ ✔ ❌
* Javet engine pool
* Easy spring integration
* Live debug with Chrome DevTools
+* AST Analysis with `JavetSanitizer `_
Quick Start
===========
@@ -69,21 +67,21 @@ Maven
com.caoccao.javet
javet
- 3.0.0
+ 3.0.1
com.caoccao.javet
javet-linux-arm64
- 3.0.0
+ 3.0.1
com.caoccao.javet
javet-macos
- 3.0.0
+ 3.0.1
Gradle Kotlin DSL
@@ -91,20 +89,20 @@ Gradle Kotlin DSL
.. code-block:: kotlin
- implementation("com.caoccao.javet:javet:3.0.0") // Linux and Windows (x86_64)
- implementation("com.caoccao.javet:javet-linux-arm64:3.0.0") // Linux (arm64)
- implementation("com.caoccao.javet:javet-macos:3.0.0") // Mac OS (x86_64 and arm64)
- implementation("com.caoccao.javet:javet-android:3.0.0") // Android (arm, arm64, x86 and x86_64)
+ implementation("com.caoccao.javet:javet:3.0.1") // Linux and Windows (x86_64)
+ implementation("com.caoccao.javet:javet-linux-arm64:3.0.1") // Linux (arm64)
+ implementation("com.caoccao.javet:javet-macos:3.0.1") // Mac OS (x86_64 and arm64)
+ implementation("com.caoccao.javet:javet-android:3.0.1") // Android (arm, arm64, x86 and x86_64)
Gradle Groovy DSL
^^^^^^^^^^^^^^^^^
.. code-block:: groovy
- implementation 'com.caoccao.javet:javet:3.0.0' // Linux and Windows (x86_64)
- implementation 'com.caoccao.javet:javet-linux-arm64:3.0.0' // Linux (arm64)
- implementation 'com.caoccao.javet:javet-macos:3.0.0' // Mac OS (x86_64 and arm64)
- implementation 'com.caoccao.javet:javet-android:3.0.0' // Android (arm, arm64, x86 and x86_64)
+ implementation 'com.caoccao.javet:javet:3.0.1' // Linux and Windows (x86_64)
+ implementation 'com.caoccao.javet:javet-linux-arm64:3.0.1' // Linux (arm64)
+ implementation 'com.caoccao.javet:javet-macos:3.0.1' // Mac OS (x86_64 and arm64)
+ implementation 'com.caoccao.javet:javet-android:3.0.1' // Android (arm, arm64, x86 and x86_64)
Hello Javet
-----------
@@ -129,12 +127,18 @@ Sponsors
License
=======
-`APACHE LICENSE, VERSION 2.0 `_.
+`APACHE LICENSE, VERSION 2.0 `_
+
+Blog
+====
+
+* `Performance Comparison of GraalJS, Javet and Nashorn `_
+* `How to Elegantly Expose JsonNode in V8 `_
+* `How to Compromise V8 on JVM `_
Documents
=========
* `Javet Intro `_
-* `Performance Comparison of GraalJS, Javet and Nashorn `_
* `Javet Javadoc `_
* `Javet Document Portal `_
diff --git a/android/javet-android/build.gradle.kts b/android/javet-android/build.gradle.kts
index 6b5867225..d01c76f80 100644
--- a/android/javet-android/build.gradle.kts
+++ b/android/javet-android/build.gradle.kts
@@ -21,7 +21,7 @@ plugins {
id("com.android.library")
}
-version = "3.0.0"
+version = "3.0.1"
android {
compileSdk = 30
diff --git a/android/javet-android/src/main/AndroidManifest.xml b/android/javet-android/src/main/AndroidManifest.xml
index 0e560ce5d..7fc157416 100644
--- a/android/javet-android/src/main/AndroidManifest.xml
+++ b/android/javet-android/src/main/AndroidManifest.xml
@@ -2,7 +2,7 @@
\ No newline at end of file
diff --git a/android/pom.xml b/android/pom.xml
index 349bf20d7..ca3f00ee0 100644
--- a/android/pom.xml
+++ b/android/pom.xml
@@ -3,7 +3,7 @@
com.caoccao.javet
javet-android
- 3.0.0
+ 3.0.1
javet
aar
Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding V8 in Java.
@@ -29,7 +29,7 @@
scm:git:git://github.com/caoccao/Javet.git
scm:git:git@github.com:caoccao/caoccao.git
https://github.com/caoccao/Javet
- 3.0.0
+ 3.0.1
diff --git a/build.gradle.kts b/build.gradle.kts
index fb8eeface..a60c44c6e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -25,7 +25,7 @@ repositories {
}
group = "com.caoccao.javet"
-version = "3.0.0"
+version = "3.0.1"
dependencies {
testImplementation("org.eclipse.jetty.websocket:websocket-server:9.4.51.v20230217")
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 70d5d3eef..9dcef6ec3 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -152,7 +152,7 @@ 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")
+ set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /MP /O2 /Ob2 /GS-")
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)
@@ -185,8 +185,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_library(Javet SHARED ${sourceFiles})
add_library(JavetStatic STATIC ${sourceFiles})
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-invalid-offsetof ")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof ")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-invalid-offsetof -O3 ")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof -O3 ")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(arm64|x86_64|aarch64)")
set(JAVET_LIB_SYSTEM "linux")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated ")
@@ -231,8 +231,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
set(JAVET_LIB_SYSTEM "android")
add_definitions(-D__ANDROID__)
list(APPEND includeDirs $ENV{JAVA_HOME}/include/linux)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -O3 -funroll-loops -ftree-vectorize -ffast-math -fpermissive -fPIC ")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -O3 -funroll-loops -ftree-vectorize -ffast-math -fpermissive -fPIC ")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -funroll-loops -ftree-vectorize -ffast-math -fpermissive -fPIC ")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wno-unused-function -Wno-unused-variable -funroll-loops -ftree-vectorize -ffast-math -fpermissive -fPIC ")
if(DEFINED V8_DIR)
foreach(importLibrary ${importLibraries})
set_target_properties(${importLibrary} PROPERTIES IMPORTED_LOCATION ${V8_RELEASE_DIR}/obj/lib${importLibrary}.a)
diff --git a/cpp/build-android.sh b/cpp/build-android.sh
index 88832620b..8208724e1 100755
--- a/cpp/build-android.sh
+++ b/cpp/build-android.sh
@@ -2,15 +2,15 @@
# Usage for V8: sh build-android.sh -DV8_DIR=${HOME}/v8 -DCMAKE_ANDROID_NDK=${HOME}/android -DCMAKE_ANDROID_ARCH=arm64
# Usage for Node: sh build-android.sh -DNODE_DIR=${HOME}/node -DCMAKE_ANDROID_NDK=${HOME}/android -DCMAKE_ANDROID_ARCH=arm64
-JAVET_VERSION=3.0.0
-rm -rf build_anroid
-mkdir build_anroid
-cd build_anroid
-mkdir -p ../../build_anroid/libs
+JAVET_VERSION=3.0.1
+rm -rf build_android
+mkdir build_android
+cd build_android
+mkdir -p ../../build/libs
cmake ../ -DCMAKE_SYSTEM_NAME=Android -DJAVET_VERSION=${JAVET_VERSION} "$@" \
- && make -j4
+ && make -j$(nproc)
if [ $? -eq 0 ]; then
- cp -f *.a ../../build_anroid/libs
+ cp -f *.a ../../build/libs
echo Build Completed
else
echo Build Failed
diff --git a/cpp/build-linux-arm64.sh b/cpp/build-linux-arm64.sh
index 29bec66df..bc3f164ef 100644
--- a/cpp/build-linux-arm64.sh
+++ b/cpp/build-linux-arm64.sh
@@ -2,16 +2,16 @@
# Usage for V8: sh build-linux-arm64.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-linux-arm64.sh -DNODE_DIR=${HOME}/node
-JAVET_VERSION=3.0.0
+JAVET_VERSION=3.0.1
rm -rf build_linux_arm64
mkdir build_linux_arm64
cd build_linux_arm64
-mkdir -p ../../build_linux_arm64/libs
+mkdir -p ../../build/libs
cmake ../ -DJAVET_VERSION=${JAVET_VERSION} "$@" \
- && make -j4 \
+ && make -j$(proc) \
&& strip --strip-unneeded -R .note -R .comment ../../src/main/resources/libjavet-*-linux-arm64.v.${JAVET_VERSION}.so
if [ $? -eq 0 ]; then
- cp -f *.a ../../build_linux_arm64/libs
+ cp -f *.a ../../build/libs
echo Build Completed
else
echo Build Failed
diff --git a/cpp/build-linux-x86_64.sh b/cpp/build-linux-x86_64.sh
index 57f7b3274..2cf3ca7da 100644
--- a/cpp/build-linux-x86_64.sh
+++ b/cpp/build-linux-x86_64.sh
@@ -2,17 +2,17 @@
# Usage for V8: sh build-linux-x86_64.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-linux-x86_64.sh -DNODE_DIR=${HOME}/node
-JAVET_VERSION=3.0.0
+JAVET_VERSION=3.0.1
rm -rf build_linux_x86_64
mkdir build_linux_x86_64
cd build_linux_x86_64
-mkdir -p ../../build_linux_x86_64/libs
+mkdir -p ../../build/libs
cmake ../ -DJAVET_VERSION=${JAVET_VERSION} "$@" \
- && make -j4 \
+ && make -j$(nproc) \
&& execstack -c ../../src/main/resources/libjavet-*-linux-x86_64.v.${JAVET_VERSION}.so \
&& strip --strip-unneeded -R .note -R .comment ../../src/main/resources/libjavet-*-linux-x86_64.v.${JAVET_VERSION}.so
if [ $? -eq 0 ]; then
- cp -f *.a ../../build_linux_x86_64/libs
+ cp -f *.a ../../build/libs
echo Build Completed
else
echo Build Failed
diff --git a/cpp/build-macos.sh b/cpp/build-macos.sh
index 3f575f905..644babed3 100755
--- a/cpp/build-macos.sh
+++ b/cpp/build-macos.sh
@@ -2,15 +2,15 @@
# Usage for V8: sh build-macos.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-macos.sh -DNODE_DIR=${HOME}/node
-JAVET_VERSION=3.0.0
+JAVET_VERSION=3.0.1
rm -rf build_macos
mkdir build_macos
cd build_macos
-mkdir -p ../../build_macos/libs
+mkdir -p ../../build/libs
cmake ../ -DJAVET_VERSION=${JAVET_VERSION} "$@" \
- && make -j4
+ && make -j$(nproc)
if [ $? -eq 0 ]; then
- cp -f *.a ../../build_macos/libs
+ cp -f *.a ../../build/libs
echo Build Completed
else
echo Build Failed
diff --git a/cpp/build-windows.cmd b/cpp/build-windows.cmd
index 4283743e5..7c3bf8de6 100644
--- a/cpp/build-windows.cmd
+++ b/cpp/build-windows.cmd
@@ -1,15 +1,15 @@
@echo off
REM Usage for V8: build -DV8_DIR=C:\v8
REM Usage for Node: build -DNODE_DIR=C:\node
-SET JAVET_VERSION=3.0.0
+SET JAVET_VERSION=3.0.1
rd /s/q build_windows
mkdir build_windows
cd build_windows
-mkdir ..\..\build_windows\libs
+mkdir ..\..\build\libs
cmake ..\ -G "Visual Studio 17 2022" -A x64 -DJAVET_VERSION=%JAVET_VERSION% %* ^
&& cmake --build . -- /p:CharacterSet=Unicode /p:Configuration=Release /p:Platform=x64
IF %ERRORLEVEL% EQU 0 (
-copy /y Release\*.lib ..\..\build_windows\libs
+copy /y Release\*.lib ..\..\build\libs
echo Build Completed
) ELSE (
echo Build Failed
diff --git a/cpp/jni/com_caoccao_javet_interop_V8Native.h b/cpp/jni/com_caoccao_javet_interop_V8Native.h
index b4f479e92..044693ee1 100644
--- a/cpp/jni/com_caoccao_javet_interop_V8Native.h
+++ b/cpp/jni/com_caoccao_javet_interop_V8Native.h
@@ -607,6 +607,14 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_mapSetUndefin
JNIEXPORT jobject JNICALL Java_com_caoccao_javet_interop_V8Native_moduleCompile
(JNIEnv *, jobject, jlong, jstring, jbyteArray, jboolean, jstring, jint, jint, jint, jboolean, jboolean);
+/*
+ * Class: com_caoccao_javet_interop_V8Native
+ * Method: moduleCreate
+ * Signature: (JLjava/lang/String;JI)Ljava/lang/Object;
+ */
+JNIEXPORT jobject JNICALL Java_com_caoccao_javet_interop_V8Native_moduleCreate
+ (JNIEnv *, jobject, jlong, jstring, jlong, jint);
+
/*
* Class: com_caoccao_javet_interop_V8Native
* Method: moduleEvaluate
@@ -671,6 +679,22 @@ JNIEXPORT jint JNICALL Java_com_caoccao_javet_interop_V8Native_moduleGetStatus
JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_moduleInstantiate
(JNIEnv *, jobject, jlong, jlong, jint);
+/*
+ * Class: com_caoccao_javet_interop_V8Native
+ * Method: moduleIsSourceTextModule
+ * Signature: (JJI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_moduleIsSourceTextModule
+ (JNIEnv *, jobject, jlong, jlong, jint);
+
+/*
+ * Class: com_caoccao_javet_interop_V8Native
+ * Method: moduleIsSyntheticModule
+ * Signature: (JJI)Z
+ */
+JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_moduleIsSyntheticModule
+ (JNIEnv *, jobject, jlong, jlong, jint);
+
/*
* Class: com_caoccao_javet_interop_V8Native
* Method: objectCreate
diff --git a/cpp/jni/javet_callbacks.cpp b/cpp/jni/javet_callbacks.cpp
index 3ac556457..25bc727c1 100644
--- a/cpp/jni/javet_callbacks.cpp
+++ b/cpp/jni/javet_callbacks.cpp
@@ -285,6 +285,66 @@ namespace Javet {
}
}
+ V8MaybeLocalValue JavetSyntheticModuleEvaluationStepsCallback(
+ V8LocalContext v8Context,
+ V8LocalModule v8LocalModule) {
+ FETCH_JNI_ENV(GlobalJavaVM);
+ Javet::Exceptions::ClearJNIException(jniEnv);
+ if (v8Context.IsEmpty()) {
+ LOG_ERROR("JavetSyntheticModuleEvaluationStepsCallback: V8 context is empty.");
+ }
+ else {
+ auto v8Isolate = v8Context->GetIsolate();
+ auto v8Runtime = Javet::V8Runtime::FromV8Context(v8Context);
+ if (v8Runtime == nullptr) {
+ LOG_ERROR("JavetSyntheticModuleEvaluationStepsCallback: V8 runtime is empty.");
+ }
+ else {
+ V8TryCatch v8TryCatch(v8Isolate);
+ auto v8GlobalObject = v8Runtime->v8GlobalObject.Get(v8Isolate);
+ std::string stringKey("module:{}" + std::to_string(v8LocalModule->GetIdentityHash()));
+ auto v8LocalStringKey = Javet::Converter::ToV8String(v8Context, stringKey.c_str());
+ auto v8LocalPrivateKey = v8::Private::ForApi(v8Isolate, v8LocalStringKey);
+ auto v8MaybeLocalValue = v8GlobalObject->GetPrivate(v8Context, v8LocalPrivateKey);
+ if (v8MaybeLocalValue.IsEmpty()) {
+ LOG_ERROR("JavetSyntheticModuleEvaluationStepsCallback: Module " << stringKey << " is not found.");
+ }
+ else {
+ v8GlobalObject->DeletePrivate(v8Context, v8LocalPrivateKey);
+ auto v8LocalObject = v8MaybeLocalValue.ToLocalChecked().As();
+ auto v8MaybeLocalArray = v8LocalObject->GetPropertyNames(v8Context);
+ if (v8MaybeLocalArray.IsEmpty()) {
+ LOG_ERROR("JavetSyntheticModuleEvaluationStepsCallback: Module " << stringKey << " is empty.");
+ }
+ else {
+ auto v8LocalArray = v8MaybeLocalArray.ToLocalChecked();
+ int length = v8LocalArray->Length();
+ for (int i = 0; i < length; ++i) {
+ auto v8MaybeLocalKey = v8LocalArray->Get(v8Context, i);
+ if (!v8MaybeLocalKey.IsEmpty()) {
+ auto v8LocalValueKey = v8MaybeLocalKey.ToLocalChecked();
+ if (v8LocalValueKey->IsString() || v8LocalValueKey->IsStringObject()) {
+ auto v8LocalStringKey = v8LocalValueKey.As();
+ auto v8MaybeLocalValueValue = v8LocalObject->Get(v8Context, v8LocalStringKey);
+ if (!v8MaybeLocalValueValue.IsEmpty()) {
+ auto v8MaybeBool = v8LocalModule->SetSyntheticModuleExport(
+ v8Isolate, v8LocalStringKey, v8MaybeLocalValueValue.ToLocalChecked());
+ v8MaybeBool.FromMaybe(false);
+ }
+ }
+ }
+ }
+ if (v8TryCatch.HasCaught()) {
+ Javet::Exceptions::ThrowJavetExecutionException(jniEnv, v8Runtime, v8Context, v8TryCatch);
+ }
+ }
+ }
+ return v8::Undefined(v8Isolate);
+ }
+ }
+ return V8MaybeLocalValue();
+ }
+
JavetCallbackContextReference::JavetCallbackContextReference(JNIEnv* jniEnv, const jobject callbackContext) noexcept
: v8PersistentCallbackContextHandlePointer(nullptr) {
jniEnv->CallVoidMethod(callbackContext, jmethodIDJavetCallbackContextSetHandle, TO_JAVA_LONG(this));
@@ -294,7 +354,7 @@ namespace Javet {
const v8::FunctionCallbackInfo& args) noexcept {
FETCH_JNI_ENV(GlobalJavaVM);
Javet::Exceptions::ClearJNIException(jniEnv);
- v8::Isolate* v8Isolate = args.GetIsolate();
+ auto v8Isolate = args.GetIsolate();
V8IsolateScope v8IsolateScope(v8Isolate);
V8HandleScope v8HandleScope(v8Isolate);
auto v8Context = v8Isolate->GetCurrentContext();
@@ -355,7 +415,7 @@ namespace Javet {
const V8LocalName& propertyName,
const v8::PropertyCallbackInfo& args) noexcept {
FETCH_JNI_ENV(GlobalJavaVM);
- v8::Isolate* v8Isolate = args.GetIsolate();
+ auto v8Isolate = args.GetIsolate();
V8IsolateScope v8IsolateScope(v8Isolate);
V8HandleScope v8HandleScope(v8Isolate);
auto v8Context = v8Isolate->GetCurrentContext();
@@ -411,7 +471,7 @@ namespace Javet {
const V8LocalValue& propertyValue,
const v8::PropertyCallbackInfo& args) noexcept {
FETCH_JNI_ENV(GlobalJavaVM);
- v8::Isolate* v8Isolate = args.GetIsolate();
+ auto v8Isolate = args.GetIsolate();
V8IsolateScope v8IsolateScope(v8Isolate);
V8HandleScope v8HandleScope(v8Isolate);
auto v8Context = v8Isolate->GetCurrentContext();
diff --git a/cpp/jni/javet_callbacks.h b/cpp/jni/javet_callbacks.h
index 53d63e6b8..de9ebefd0 100644
--- a/cpp/jni/javet_callbacks.h
+++ b/cpp/jni/javet_callbacks.h
@@ -38,6 +38,11 @@ namespace Javet {
v8::Isolate* v8Isolate,
v8::GCType v8GCType,
v8::GCCallbackFlags v8GCCallbackFlags) noexcept;
+ V8MaybeLocalModule JavetModuleResolveCallback(
+ V8LocalContext v8Context,
+ V8LocalString specifier,
+ V8LocalFixedArray importAssertions,
+ V8LocalModule referrer) noexcept;
void JavetPropertyGetterCallback(
V8LocalName propertyName,
const v8::PropertyCallbackInfo& info) noexcept;
@@ -49,12 +54,9 @@ namespace Javet {
void OOMErrorCallback(const char* location, const v8::OOMDetails& oomDetails) noexcept;
#endif
void JavetPromiseRejectCallback(v8::PromiseRejectMessage message) noexcept;
-
- V8MaybeLocalModule JavetModuleResolveCallback(
+ V8MaybeLocalValue JavetSyntheticModuleEvaluationStepsCallback(
V8LocalContext v8Context,
- V8LocalString specifier,
- V8LocalFixedArray importAssertions,
- V8LocalModule referrer) noexcept;
+ V8LocalModule v8LocalModule);
class JavetCallbackContextReference {
public:
diff --git a/cpp/jni/javet_converter.cpp b/cpp/jni/javet_converter.cpp
index b79bdf2bf..83c5fa144 100644
--- a/cpp/jni/javet_converter.cpp
+++ b/cpp/jni/javet_converter.cpp
@@ -543,13 +543,13 @@ namespace Javet {
ToV8PersistentReference(v8Context, v8Script));
}
+#ifdef ENABLE_NODE
jobject ToExternalV8Value(
JNIEnv* jniEnv,
const V8Runtime* v8Runtime,
const V8LocalContext& v8Context,
const V8InternalObject& v8InternalObject) noexcept {
auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
-#ifdef ENABLE_NODE
if (v8InternalObject.IsJSObject() || v8InternalObject.IsPrimitive()
|| v8InternalObject.IsJSArray() || v8InternalObject.IsJSTypedArray()) {
auto v8LocalObject = v8::Utils::ToLocal(v8::internal::handle(v8InternalObject, v8InternalIsolate));
@@ -570,7 +570,15 @@ namespace Javet {
else if (v8InternalObject.IsCode()) {
LOG_DEBUG("Converter: Code is not supported.");
}
+ return ToExternalV8ValueUndefined(jniEnv, v8Runtime);
+ }
#else
+ jobject ToExternalV8Value(
+ JNIEnv* jniEnv,
+ const V8Runtime* v8Runtime,
+ const V8LocalContext& v8Context,
+ const v8::internal::Tagged& v8InternalObject) noexcept {
+ auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
if (v8::internal::IsJSObject(v8InternalObject) || v8::internal::IsPrimitive(v8InternalObject)
|| v8::internal::IsJSArray(v8InternalObject) || v8::internal::IsJSTypedArray(v8InternalObject)) {
auto v8LocalObject = v8::Utils::ToLocal(v8::internal::handle(v8InternalObject, v8InternalIsolate));
@@ -591,9 +599,9 @@ namespace Javet {
else if (v8::internal::IsCode(v8InternalObject)) {
LOG_DEBUG("Converter: Code is not supported.");
}
-#endif
return ToExternalV8ValueUndefined(jniEnv, v8Runtime);
}
+#endif
jobject ToExternalV8Value(
JNIEnv* jniEnv,
diff --git a/cpp/jni/javet_converter.h b/cpp/jni/javet_converter.h
index 15db65e71..38e03420d 100644
--- a/cpp/jni/javet_converter.h
+++ b/cpp/jni/javet_converter.h
@@ -152,7 +152,11 @@ namespace Javet {
JNIEnv* jniEnv,
const V8Runtime* v8Runtime,
const V8LocalContext& v8Context,
+#ifdef ENABLE_NODE
const V8InternalObject& v8InternalObject) noexcept;
+#else
+ const v8::internal::Tagged& v8InternalObject) noexcept;
+#endif
jobject ToExternalV8Value(
JNIEnv* jniEnv,
@@ -319,17 +323,29 @@ namespace Javet {
static inline V8InternalContext ToV8InternalContext(
const V8LocalContext& v8LocalContext) noexcept {
+#ifdef ENABLE_NODE
return V8InternalContext::cast(*v8::Utils::OpenHandle(*v8LocalContext));
+#else
+ return *V8InternalContext::cast(*v8::Utils::OpenHandle(*v8LocalContext));
+#endif
}
static inline V8InternalJSFunction ToV8InternalJSFunction(
const V8LocalValue& v8LocalValue) noexcept {
+#ifdef ENABLE_NODE
return V8InternalJSFunction::cast(*v8::Utils::OpenHandle(*v8LocalValue));
+#else
+ return *V8InternalJSFunction::cast(*v8::Utils::OpenHandle(*v8LocalValue));
+#endif
}
static inline V8InternalScript ToV8InternalScript(
const V8LocalScript& v8LocalScript) noexcept {
+#ifdef ENABLE_NODE
return V8InternalScript::cast(*v8::Utils::OpenHandle(*v8LocalScript));
+#else
+ return *V8InternalScript::cast(*v8::Utils::OpenHandle(*v8LocalScript));
+#endif
}
}
}
diff --git a/cpp/jni/javet_jni_function.cpp b/cpp/jni/javet_jni_function.cpp
index 347f633fc..e541fc95e 100644
--- a/cpp/jni/javet_jni_function.cpp
+++ b/cpp/jni/javet_jni_function.cpp
@@ -71,13 +71,13 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionCanDi
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
if (IS_V8_FUNCTION(v8ValueType)) {
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
+#ifdef ENABLE_NODE
return v8InternalShared.CanDiscardCompiled();
+#else
+ return v8InternalShared->CanDiscardCompiled();
+#endif
}
}
return false;
@@ -147,13 +147,8 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionCopyS
auto sourceV8LocalValue = sourceV8PersistentValuePointer->Get(v8Context->GetIsolate());
auto targetV8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
auto sourceV8InternalFunction = Javet::Converter::ToV8InternalJSFunction(sourceV8LocalValue);
-#ifdef ENABLE_NODE
auto targetV8InternalShared = targetV8InternalFunction.shared();
auto sourceV8InternalShared = sourceV8InternalFunction.shared();
-#else
- auto targetV8InternalShared = *targetV8InternalFunction.shared();
- auto sourceV8InternalShared = *sourceV8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(sourceV8InternalShared) && IS_USER_DEFINED_FUNCTION(targetV8InternalShared)) {
V8InternalDisallowGarbageCollection disallowGarbageCollection;
auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
@@ -161,11 +156,19 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionCopyS
targetV8InternalShared = *v8InternalIsolate->factory()->CloneSharedFunctionInfo(
v8::internal::handle(sourceV8InternalShared, v8InternalIsolate));
// Clone the scope info
+#ifdef ENABLE_NODE
auto sourceScopeInfo = sourceV8InternalShared.scope_info();
+#else
+ auto sourceScopeInfo = sourceV8InternalShared->scope_info();
+#endif
auto emptyBlocklistHandle = V8InternalStringSet::New(v8InternalIsolate);
auto targetScopeInfo = *V8InternalScopeInfo::RecreateWithBlockList(
v8InternalIsolate, v8::internal::handle(sourceScopeInfo, v8InternalIsolate), emptyBlocklistHandle);
+#ifdef ENABLE_NODE
targetV8InternalShared.set_raw_scope_info(targetScopeInfo);
+#else
+ targetV8InternalShared->set_raw_scope_info(targetScopeInfo);
+#endif
targetV8InternalFunction.set_shared(targetV8InternalShared, V8InternalWriteBarrierMode::UPDATE_WRITE_BARRIER);
success = true;
}
@@ -209,13 +212,13 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionDisca
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
if (IS_V8_FUNCTION(v8ValueType)) {
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
+#ifdef ENABLE_NODE
if (v8InternalShared.CanDiscardCompiled()) {
+#else
+ if (v8InternalShared->CanDiscardCompiled()) {
+#endif
auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
V8InternalSharedFunctionInfo::DiscardCompiled(v8InternalIsolate, v8::internal::handle(v8InternalShared, v8InternalIsolate));
return true;
@@ -230,19 +233,19 @@ JNIEXPORT jobjectArray JNICALL Java_com_caoccao_javet_interop_V8Native_functionG
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
if (IS_V8_FUNCTION(v8ValueType)) {
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
+#ifdef ENABLE_NODE
+ if (IS_USER_DEFINED_FUNCTION(v8InternalShared) && v8InternalShared.is_wrapped()) {
#else
- auto v8InternalShared = *v8InternalFunction.shared();
+ if (IS_USER_DEFINED_FUNCTION(v8InternalShared) && v8InternalShared->is_wrapped()) {
#endif
- if (IS_USER_DEFINED_FUNCTION(v8InternalShared) && v8InternalShared.is_wrapped()) {
auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
#ifdef ENABLE_NODE
auto v8InternalScript = V8InternalScript::cast(v8InternalShared.script());
auto wrappedArguments = v8InternalScript.wrapped_arguments();
#else
- auto v8InternalScript = *V8InternalScript::cast(v8InternalShared.script());
- auto wrappedArguments = *v8InternalScript.wrapped_arguments();
+ auto v8InternalScript = V8InternalScript::cast(v8InternalShared->script());
+ auto wrappedArguments = *v8InternalScript->wrapped_arguments();
#endif
auto length = wrappedArguments.length();
if (length > 0) {
@@ -265,18 +268,15 @@ JNIEXPORT jbyteArray JNICALL Java_com_caoccao_javet_interop_V8Native_functionGet
if (IS_V8_FUNCTION(v8ValueType)) {
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
#ifdef ENABLE_NODE
auto v8InternalScript = V8InternalScript::cast(v8InternalShared.script());
+ if (v8InternalScript.is_wrapped()) {
#else
- auto v8InternalScript = *V8InternalScript::cast(v8InternalShared.script());
+ auto v8InternalScript = V8InternalScript::cast(v8InternalShared->script());
+ if (v8InternalScript->is_wrapped()) {
#endif
- if (v8InternalScript.is_wrapped()) {
V8TryCatch v8TryCatch(v8Context->GetIsolate());
std::unique_ptr cachedDataPointer;
cachedDataPointer.reset(v8::ScriptCompiler::CreateCodeCacheForFunction(v8LocalValue.As()));
@@ -413,25 +413,27 @@ JNIEXPORT jobject JNICALL Java_com_caoccao_javet_interop_V8Native_functionGetScr
if (IS_V8_FUNCTION(v8ValueType)) {
V8InternalDisallowGarbageCollection disallowGarbageCollection;
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
#ifdef ENABLE_NODE
auto v8InternalScript = V8InternalScript::cast(v8InternalShared.script());
auto v8InternalSource = V8InternalString::cast(v8InternalScript.source());
-#else
- auto v8InternalScript = *V8InternalScript::cast(v8InternalShared.script());
- auto v8InternalSource = *V8InternalString::cast(v8InternalScript.source());
-#endif
const int startPosition = v8InternalShared.StartPosition();
const int endPosition = v8InternalShared.EndPosition();
const int sourceLength = v8InternalSource.length();
auto sourceCode = v8InternalSource.ToCString(
V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
0, sourceLength);
+#else
+ auto v8InternalScript = V8InternalScript::cast(v8InternalShared->script());
+ auto v8InternalSource = V8InternalString::cast(v8InternalScript->source());
+ const int startPosition = v8InternalShared->StartPosition();
+ const int endPosition = v8InternalShared->EndPosition();
+ const int sourceLength = v8InternalSource->length();
+ auto sourceCode = v8InternalSource->ToCString(
+ V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
+ 0, sourceLength);
+#endif
return jniEnv->NewObject(
Javet::Converter::jclassIV8ValueFunctionScriptSource,
Javet::Converter::jmethodIDIV8ValueFunctionScriptSourceConstructor,
@@ -448,24 +450,25 @@ JNIEXPORT jstring JNICALL Java_com_caoccao_javet_interop_V8Native_functionGetSou
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
if (IS_V8_FUNCTION(v8ValueType)) {
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
#ifdef ENABLE_NODE
auto v8InternalScript = V8InternalScript::cast(v8InternalShared.script());
auto v8InternalSource = V8InternalString::cast(v8InternalScript.source());
-#else
- auto v8InternalScript = *V8InternalScript::cast(v8InternalShared.script());
- auto v8InternalSource = *V8InternalString::cast(v8InternalScript.source());
-#endif
const int startPosition = v8InternalShared.StartPosition();
const int endPosition = v8InternalShared.EndPosition();
auto sourceCode = v8InternalSource.ToCString(
V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
startPosition, endPosition - startPosition);
+#else
+ auto v8InternalScript = V8InternalScript::cast(v8InternalShared->script());
+ auto v8InternalSource = V8InternalString::cast(v8InternalScript->source());
+ const int startPosition = v8InternalShared->StartPosition();
+ const int endPosition = v8InternalShared->EndPosition();
+ auto sourceCode = v8InternalSource->ToCString(
+ V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
+ startPosition, endPosition - startPosition);
+#endif
return Javet::Converter::ToJavaString(jniEnv, sourceCode.get());
}
}
@@ -477,13 +480,13 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionIsCom
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
if (IS_V8_FUNCTION(v8ValueType)) {
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
+#ifdef ENABLE_NODE
return v8InternalShared.is_compiled();
+#else
+ return v8InternalShared->is_compiled();
+#endif
}
}
return false;
@@ -494,13 +497,13 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionIsWra
RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
if (IS_V8_FUNCTION(v8ValueType)) {
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
+#ifdef ENABLE_NODE
return v8InternalShared.is_wrapped();
+#else
+ return v8InternalShared->is_wrapped();
+#endif
}
}
return false;
@@ -528,18 +531,15 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSc
if (IS_V8_FUNCTION(v8ValueType)) {
V8InternalDisallowGarbageCollection disallowGarbageCollection;
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
#ifdef ENABLE_NODE
auto v8InternalScopeInfo = v8InternalShared.scope_info();
+ if (v8InternalScopeInfo.scope_type() == V8InternalScopeType::FUNCTION_SCOPE) {
#else
- auto v8InternalScopeInfo = *v8InternalShared.scope_info();
+ auto v8InternalScopeInfo = v8InternalShared->scope_info();
+ if (v8InternalScopeInfo->scope_type() == V8InternalScopeType::FUNCTION_SCOPE) {
#endif
- if (v8InternalScopeInfo.scope_type() == V8InternalScopeType::FUNCTION_SCOPE) {
auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
auto mSourceCode = (jstring)jniEnv->CallObjectMethod(mScriptSource, Javet::Converter::jmethodIDIV8ValueFunctionScriptGetCode);
auto umSourceCode = Javet::Converter::ToV8String(jniEnv, v8Context, mSourceCode);
@@ -547,20 +547,27 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSc
const int endPosition = jniEnv->CallIntMethod(mScriptSource, Javet::Converter::jmethodIDIV8ValueFunctionScriptGetEndPosition);
#ifdef ENABLE_NODE
auto v8InternalScript = V8InternalScript::cast(v8InternalShared.script());
-#else
- auto v8InternalScript = *V8InternalScript::cast(v8InternalShared.script());
-#endif
auto v8InternalSource = v8::Utils::OpenHandle(*umSourceCode);
-#ifdef ENABLE_NODE
bool sourceCodeEquals = v8InternalScript.source().StrictEquals(*v8InternalSource);
+ bool positionEquals = startPosition == v8InternalShared.StartPosition() && endPosition == v8InternalShared.EndPosition();
#else
- bool sourceCodeEquals = V8InternalObject::StrictEquals(v8InternalScript.source(), *v8InternalSource);
+ auto v8InternalScript = V8InternalScript::cast(v8InternalShared->script());
+ auto v8InternalSource = v8::Utils::OpenHandle(*umSourceCode);
+ bool sourceCodeEquals = V8InternalObject::StrictEquals(v8InternalScript->source(), *v8InternalSource);
+ bool positionEquals = startPosition == v8InternalShared->StartPosition() && endPosition == v8InternalShared->EndPosition();
#endif
- bool positionEquals = startPosition == v8InternalShared.StartPosition() && endPosition == v8InternalShared.EndPosition();
if (!sourceCodeEquals || !positionEquals) {
+#ifdef ENABLE_NODE
if (v8InternalShared.CanDiscardCompiled()) {
+#else
+ if (v8InternalShared->CanDiscardCompiled()) {
+#endif
V8InternalSharedFunctionInfo::DiscardCompiled(v8InternalIsolate, v8::internal::handle(v8InternalShared, v8InternalIsolate));
+#ifdef ENABLE_NODE
v8InternalShared.set_allows_lazy_compilation(true);
+#else
+ v8InternalShared->set_allows_lazy_compilation(true);
+#endif
}
if (!sourceCodeEquals) {
auto v8InternalScriptHandle = v8::internal::handle(v8InternalScript, v8InternalIsolate);
@@ -571,7 +578,7 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSc
v8InternalShared.set_script(*clonedV8InternalScript);
#else
auto clonedV8InternalScript = v8InternalIsolate->factory()->CloneScript(v8InternalScriptHandle, v8InternalSource);
- v8InternalShared.set_script(*clonedV8InternalScript, v8::kReleaseStore);
+ v8InternalShared->set_script(*clonedV8InternalScript, v8::kReleaseStore);
#endif
}
else {
@@ -583,7 +590,11 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSc
}
}
if (!positionEquals) {
+#ifdef ENABLE_NODE
v8InternalScopeInfo.SetPositionInfo(startPosition, endPosition);
+#else
+ v8InternalScopeInfo->SetPositionInfo(startPosition, endPosition);
+#endif
}
success = true;
}
@@ -601,29 +612,29 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSo
if (IS_V8_FUNCTION(v8ValueType)) {
V8InternalDisallowGarbageCollection disallowGarbageCollection;
auto v8InternalFunction = Javet::Converter::ToV8InternalJSFunction(v8LocalValue);
-#ifdef ENABLE_NODE
auto v8InternalShared = v8InternalFunction.shared();
-#else
- auto v8InternalShared = *v8InternalFunction.shared();
-#endif
if (IS_USER_DEFINED_FUNCTION(v8InternalShared)) {
#ifdef ENABLE_NODE
auto v8InternalScopeInfo = v8InternalShared.scope_info();
+ while (v8InternalScopeInfo.scope_type() == V8InternalScopeType::FUNCTION_SCOPE) {
#else
- auto v8InternalScopeInfo = *v8InternalShared.scope_info();
+ auto v8InternalScopeInfo = v8InternalShared->scope_info();
+ while (v8InternalScopeInfo->scope_type() == V8InternalScopeType::FUNCTION_SCOPE) {
#endif
- while (v8InternalScopeInfo.scope_type() == V8InternalScopeType::FUNCTION_SCOPE) {
auto v8InternalIsolate = reinterpret_cast(v8Context->GetIsolate());
#ifdef ENABLE_NODE
auto v8InternalScript = V8InternalScript::cast(v8InternalShared.script());
auto v8InternalSource = V8InternalString::cast(v8InternalScript.source());
-#else
- auto v8InternalScript = *V8InternalScript::cast(v8InternalShared.script());
- auto v8InternalSource = *V8InternalString::cast(v8InternalScript.source());
-#endif
const int startPosition = v8InternalShared.StartPosition();
const int endPosition = v8InternalShared.EndPosition();
const int sourceLength = v8InternalSource.length();
+#else
+ auto v8InternalScript = V8InternalScript::cast(v8InternalShared->script());
+ auto v8InternalSource = V8InternalString::cast(v8InternalScript->source());
+ const int startPosition = v8InternalShared->StartPosition();
+ const int endPosition = v8InternalShared->EndPosition();
+ const int sourceLength = v8InternalSource->length();
+#endif
// Build the new source code.
auto umSourceCode = Javet::Converter::ToV8String(jniEnv, v8Context, mSourceCode);
@@ -631,9 +642,15 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSo
V8LocalString newSourceCode;
if (startPosition > 0) {
int utf8Length = 0;
+#ifdef ENABLE_NODE
auto stdStringHeader(v8InternalSource.ToCString(
V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
0, startPosition, &utf8Length));
+#else
+ auto stdStringHeader(v8InternalSource->ToCString(
+ V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
+ 0, startPosition, &utf8Length));
+#endif
auto v8MaybeLocalStringHeader = v8::String::NewFromUtf8(
v8Context->GetIsolate(), stdStringHeader.get(), v8::NewStringType::kNormal, utf8Length);
if (v8MaybeLocalStringHeader.IsEmpty()) {
@@ -651,9 +668,15 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSo
}
if (endPosition < sourceLength) {
int utf8Length = 0;
+#ifdef ENABLE_NODE
auto stdStringFooter(v8InternalSource.ToCString(
V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
endPosition, sourceLength - endPosition, &utf8Length));
+#else
+ auto stdStringFooter(v8InternalSource->ToCString(
+ V8InternalAllowNullsFlag::DISALLOW_NULLS, V8InternalRobustnessFlag::ROBUST_STRING_TRAVERSAL,
+ endPosition, sourceLength - endPosition, &utf8Length));
+#endif
auto v8MaybeLocalStringFooter = v8::String::NewFromUtf8(
v8Context->GetIsolate(), stdStringFooter.get(), v8::NewStringType::kNormal, utf8Length);
if (v8MaybeLocalStringFooter.IsEmpty()) {
@@ -683,17 +706,25 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSo
auto newV8InternalSource = v8::Utils::OpenHandle(*newSourceCode);
#ifdef ENABLE_NODE
bool sourceCodeEquals = v8InternalSource.StrictEquals(*newV8InternalSource);
+ bool positionEquals = newEndPosition == v8InternalShared.EndPosition();
#else
bool sourceCodeEquals = V8InternalObject::StrictEquals(v8InternalSource, *newV8InternalSource);
+ bool positionEquals = newEndPosition == v8InternalShared->EndPosition();
#endif
- bool positionEquals = newEndPosition == v8InternalShared.EndPosition();
if (!sourceCodeEquals || !positionEquals) {
// Discard compiled data and set lazy compile.
+#ifdef ENABLE_NODE
if (v8InternalShared.CanDiscardCompiled()) {
V8InternalSharedFunctionInfo::DiscardCompiled(v8InternalIsolate, v8::internal::handle(v8InternalShared, v8InternalIsolate));
v8InternalShared.set_allows_lazy_compilation(true);
}
+#else
+ if (v8InternalShared->CanDiscardCompiled()) {
+ V8InternalSharedFunctionInfo::DiscardCompiled(v8InternalIsolate, v8::internal::handle(v8InternalShared, v8InternalIsolate));
+ v8InternalShared->set_allows_lazy_compilation(true);
+ }
+#endif
if (!sourceCodeEquals) {
auto v8InternalScriptHandle = v8::internal::handle(v8InternalScript, v8InternalIsolate);
if (mCloneScript) {
@@ -703,7 +734,7 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSo
v8InternalShared.set_script(*clonedV8InternalScript);
#else
auto clonedV8InternalScript = v8InternalIsolate->factory()->CloneScript(v8InternalScriptHandle, newV8InternalSource);
- v8InternalShared.set_script(*clonedV8InternalScript, v8::kReleaseStore);
+ v8InternalShared->set_script(*clonedV8InternalScript, v8::kReleaseStore);
#endif
}
else {
@@ -715,7 +746,11 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_functionSetSo
}
}
if (!positionEquals) {
+#ifdef ENABLE_NODE
v8InternalScopeInfo.SetPositionInfo(startPosition, newEndPosition);
+#else
+ v8InternalScopeInfo->SetPositionInfo(startPosition, newEndPosition);
+#endif
}
success = true;
}
diff --git a/cpp/jni/javet_jni_module.cpp b/cpp/jni/javet_jni_module.cpp
index 0d68c90c0..18e2a0a95 100644
--- a/cpp/jni/javet_jni_module.cpp
+++ b/cpp/jni/javet_jni_module.cpp
@@ -52,6 +52,51 @@ JNIEXPORT jobject JNICALL Java_com_caoccao_javet_interop_V8Native_moduleCompile
return nullptr;
}
+JNIEXPORT jobject JNICALL Java_com_caoccao_javet_interop_V8Native_moduleCreate
+(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle, jstring mModuleName, jlong v8ValueHandle, jint v8ValueType) {
+ RUNTIME_AND_VALUE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
+ if (v8LocalValue->IsObject()) {
+ V8TryCatch v8TryCatch(v8Context->GetIsolate());
+ auto v8LocalObject = v8LocalValue.As();
+ auto v8MaybeLocalArray = v8LocalObject->GetPropertyNames(v8Context);
+ if (v8MaybeLocalArray.IsEmpty()) {
+ if (Javet::Exceptions::HandlePendingException(jniEnv, v8Runtime, v8Context)) {
+ return nullptr;
+ }
+ }
+ else {
+ auto v8LocalArray = v8MaybeLocalArray.ToLocalChecked();
+ std::vector exportNames;
+ int length = v8LocalArray->Length();
+ for (int i = 0; i < length; ++i) {
+ auto v8MaybeLocalValue = v8LocalArray->Get(v8Context, i);
+ if (!v8MaybeLocalValue.IsEmpty()) {
+ auto v8LocalValueKey = v8MaybeLocalValue.ToLocalChecked();
+ if (v8LocalValueKey->IsString() || v8LocalValueKey->IsStringObject()) {
+ exportNames.emplace_back(v8LocalValueKey.As());
+ }
+ }
+ }
+ auto v8LocalModule = v8::Module::CreateSyntheticModule(
+ v8Context->GetIsolate(),
+ Javet::Converter::ToV8String(jniEnv, v8Context, mModuleName),
+ exportNames,
+ Javet::Callback::JavetSyntheticModuleEvaluationStepsCallback);
+ std::string stringKey("module:{}" + std::to_string(v8LocalModule->GetIdentityHash()));
+ auto v8LocalStringKey = Javet::Converter::ToV8String(v8Context, stringKey.c_str());
+ auto v8LocalPrivateKey = v8::Private::ForApi(v8Context->GetIsolate(), v8LocalStringKey);
+ auto v8GlobalObject = v8Runtime->v8GlobalObject.Get(v8Context->GetIsolate());
+ v8GlobalObject->SetPrivate(v8Context, v8LocalPrivateKey, v8LocalObject);
+ if (v8TryCatch.HasCaught()) {
+ return Javet::Exceptions::ThrowJavetExecutionException(jniEnv, v8Runtime, v8Context, v8TryCatch);
+ }
+ return Javet::Converter::ToExternalV8Module(jniEnv, v8Runtime, v8Context, v8LocalModule);
+ }
+ }
+ Javet::Exceptions::ClearJNIException(jniEnv);
+ return Javet::Converter::ToExternalV8ValueUndefined(jniEnv, v8Runtime);
+}
+
JNIEXPORT jobject JNICALL Java_com_caoccao_javet_interop_V8Native_moduleEvaluate
(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle, jlong v8ValueHandle, jint v8ValueType, jboolean mResultRequired) {
RUNTIME_AND_MODULE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
@@ -172,3 +217,15 @@ JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_moduleInstant
}
return false;
}
+
+JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_moduleIsSourceTextModule
+(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle, jlong v8ValueHandle, jint v8ValueType) {
+ RUNTIME_AND_MODULE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
+ return v8LocalModule->IsSourceTextModule();
+}
+
+JNIEXPORT jboolean JNICALL Java_com_caoccao_javet_interop_V8Native_moduleIsSyntheticModule
+(JNIEnv* jniEnv, jobject caller, jlong v8RuntimeHandle, jlong v8ValueHandle, jint v8ValueType) {
+ RUNTIME_AND_MODULE_HANDLES_TO_OBJECTS_WITH_SCOPE(v8RuntimeHandle, v8ValueHandle);
+ return v8LocalModule->IsSyntheticModule();
+}
diff --git a/cpp/jni/javet_resource_node.rc b/cpp/jni/javet_resource_node.rc
index e86b11691..ff5eb5eb9 100644
--- a/cpp/jni/javet_resource_node.rc
+++ b/cpp/jni/javet_resource_node.rc
@@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,0,0,0
- PRODUCTVERSION 3,0,0,0
+ FILEVERSION 3,0,1,0
+ PRODUCTVERSION 3,0,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "caoccao.com"
VALUE "FileDescription", "caoccao.com"
- VALUE "FileVersion", "3.0.0.0"
- VALUE "InternalName", "libjavet-node-windows-x86_64.v.3.0.0.dll"
+ VALUE "FileVersion", "3.0.1.0"
+ VALUE "InternalName", "libjavet-node-windows-x86_64.v.3.0.1.dll"
VALUE "LegalCopyright", "Copyright (C) 2021-2023"
- VALUE "OriginalFilename", "libjavet-node-windows-x86_64.v.3.0.0.dll"
+ VALUE "OriginalFilename", "libjavet-node-windows-x86_64.v.3.0.1.dll"
VALUE "ProductName", "Javet Windows"
- VALUE "ProductVersion", "3.0.0.0"
+ VALUE "ProductVersion", "3.0.1.0"
END
END
BLOCK "VarFileInfo"
diff --git a/cpp/jni/javet_resource_v8.rc b/cpp/jni/javet_resource_v8.rc
index 607e0f1d8..b3e7f7953 100644
--- a/cpp/jni/javet_resource_v8.rc
+++ b/cpp/jni/javet_resource_v8.rc
@@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 3,0,0,0
- PRODUCTVERSION 3,0,0,0
+ FILEVERSION 3,0,1,0
+ PRODUCTVERSION 3,0,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "caoccao.com"
VALUE "FileDescription", "caoccao.com"
- VALUE "FileVersion", "3.0.0.0"
- VALUE "InternalName", "libjavet-v8-windows-x86_64.v.3.0.0.dll"
+ VALUE "FileVersion", "3.0.1.0"
+ VALUE "InternalName", "libjavet-v8-windows-x86_64.v.3.0.1.dll"
VALUE "LegalCopyright", "Copyright (C) 2021-2023"
- VALUE "OriginalFilename", "libjavet-v8-windows-x86_64.v.3.0.0.dll"
+ VALUE "OriginalFilename", "libjavet-v8-windows-x86_64.v.3.0.1.dll"
VALUE "ProductName", "Javet Windows"
- VALUE "ProductVersion", "3.0.0.0"
+ VALUE "ProductVersion", "3.0.1.0"
END
END
BLOCK "VarFileInfo"
diff --git a/cpp/jni/javet_v8_internal.h b/cpp/jni/javet_v8_internal.h
index 0660637e1..1a81a7e17 100644
--- a/cpp/jni/javet_v8_internal.h
+++ b/cpp/jni/javet_v8_internal.h
@@ -83,12 +83,11 @@ constexpr auto CONVERT_OFFSET_FOR_SCOPE_INFO(T offset) {
return (offset - V8InternalHeapObject::kHeaderSize) / v8::internal::kTaggedSize;
}
-template
-constexpr auto IS_API_FUNCTION(T v8InternalShared) {
- return !v8InternalShared.native() && v8InternalShared.IsApiFunction();
-}
-
template
constexpr auto IS_USER_DEFINED_FUNCTION(T v8InternalShared) {
+#ifdef ENABLE_NODE
return !v8InternalShared.native() && !v8InternalShared.IsApiFunction() && v8InternalShared.IsUserJavaScript();
+#else
+ return !v8InternalShared->native() && !v8InternalShared->IsApiFunction() && v8InternalShared->IsUserJavaScript();
+#endif
}
diff --git a/cpp/jni/javet_v8_runtime.cpp b/cpp/jni/javet_v8_runtime.cpp
index 48d3d831f..094c26c55 100644
--- a/cpp/jni/javet_v8_runtime.cpp
+++ b/cpp/jni/javet_v8_runtime.cpp
@@ -311,7 +311,11 @@ namespace Javet {
jobject V8Runtime::SafeToExternalV8Value(
JNIEnv * jniEnv,
const V8LocalContext & v8Context,
+#ifdef ENABLE_NODE
const V8InternalObject & v8InternalObject) noexcept {
+#else
+ const v8::internal::Tagged& v8InternalObject) noexcept {
+#endif
V8TryCatch v8TryCatch(v8Context->GetIsolate());
jobject externalV8Value = Javet::Converter::ToExternalV8Value(jniEnv, this, v8Context, v8InternalObject);
if (v8TryCatch.HasCaught()) {
diff --git a/cpp/jni/javet_v8_runtime.h b/cpp/jni/javet_v8_runtime.h
index e17ae462a..1f03dd2d5 100644
--- a/cpp/jni/javet_v8_runtime.h
+++ b/cpp/jni/javet_v8_runtime.h
@@ -143,7 +143,11 @@ namespace Javet {
jobject SafeToExternalV8Value(
JNIEnv* jniEnv,
const V8LocalContext& v8Context,
+#ifdef ENABLE_NODE
const V8InternalObject& v8InternalObject) noexcept;
+#else
+ const v8::internal::Tagged& v8InternalObject) noexcept;
+#endif
jobject SafeToExternalV8Value(
JNIEnv* jniEnv,
diff --git a/docker/android/base.Dockerfile b/docker/android/base.Dockerfile
index dde3ae715..b3d1a0f65 100644
--- a/docker/android/base.Dockerfile
+++ b/docker/android/base.Dockerfile
@@ -13,9 +13,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Usage: docker build -t sjtucaocao/javet-android:3.0.0 -f docker/android/base.Dockerfile .
+# Usage: docker build -t sjtucaocao/javet-android:3.0.1 -f docker/android/base.Dockerfile .
-ARG JAVET_V8_VERSION=11.8.172.15
+ARG JAVET_V8_VERSION=11.9.169.6
FROM ubuntu:20.04
WORKDIR /
diff --git a/docker/android/build.Dockerfile b/docker/android/build.Dockerfile
index bcc6db3d1..cf2198364 100644
--- a/docker/android/build.Dockerfile
+++ b/docker/android/build.Dockerfile
@@ -15,7 +15,7 @@
# Usage: docker build -t javet-android:local -f docker/android/build.Dockerfile .
-FROM sjtucaocao/javet-android:3.0.0
+FROM sjtucaocao/javet-android:3.0.1
WORKDIR /
# Copy Javet
diff --git a/docker/linux-arm64/base_all_in_one.Dockerfile b/docker/linux-arm64/base_all_in_one.Dockerfile
index 73043da28..f7268c35d 100644
--- a/docker/linux-arm64/base_all_in_one.Dockerfile
+++ b/docker/linux-arm64/base_all_in_one.Dockerfile
@@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Usage: docker build -t sjtucaocao/javet-arm64:3.0.0 -f docker/linux-arm64/base_all_in_one.Dockerfile .
+# Usage: docker build -t sjtucaocao/javet-arm64:3.0.1 -f docker/linux-arm64/base_all_in_one.Dockerfile .
ARG JAVET_NODE_VERSION=18.15.0
-ARG JAVET_V8_VERSION=11.8.172.15
+ARG JAVET_V8_VERSION=11.9.169.6
FROM ubuntu:20.04
WORKDIR /
diff --git a/docker/linux-arm64/base_gradle.Dockerfile b/docker/linux-arm64/base_gradle.Dockerfile
index 0327ca4f9..19c444910 100644
--- a/docker/linux-arm64/base_gradle.Dockerfile
+++ b/docker/linux-arm64/base_gradle.Dockerfile
@@ -14,7 +14,7 @@
# limitations under the License.
# Usage: docker build \
-# -t sjtucaocao/javet:arm64-3.0.0 \
+# -t sjtucaocao/javet:arm64-3.0.1 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
# -f docker/linux-arm64/base_gradle.Dockerfile .
diff --git a/docker/linux-arm64/base_v8.Dockerfile b/docker/linux-arm64/base_v8.Dockerfile
index 8717fc27a..fc10bcf09 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_11.8.172.15 \
+# -t sjtucaocao/javet:arm64-base-v8_11.9.169.6 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
-# --build-arg JAVET_V8_VERSION=11.8.172.15 \
+# --build-arg JAVET_V8_VERSION=11.9.169.6 \
# -f docker/linux-arm64/base_v8.Dockerfile .
ARG JAVET_REPO=sjtucaocao/javet
-ARG JAVET_V8_VERSION=11.8.172.15
+ARG JAVET_V8_VERSION=11.9.169.6
FROM ${JAVET_REPO}:arm64-base-jvm
diff --git a/docker/linux-arm64/build_artifact.Dockerfile b/docker/linux-arm64/build_artifact.Dockerfile
index 59c5ebaee..168ec9a77 100644
--- a/docker/linux-arm64/build_artifact.Dockerfile
+++ b/docker/linux-arm64/build_artifact.Dockerfile
@@ -18,13 +18,13 @@
# --build-arg JAVET_REPO=sjtucaocao/javet \
# --build-arg JAVET_NODE_VERSION=18.12.1 \
# --build-arg JAVET_V8_VERSION=10.8.168.20 \
-# --build-arg JAVET_VERSION=3.0.0 \
+# --build-arg JAVET_VERSION=3.0.1 \
# -f docker/linux-arm64/build_artifact.Dockerfile .
ARG JAVET_REPO=sjtucaocao/javet
ARG JAVET_NODE_VERSION=18.12.1
ARG JAVET_V8_VERSION=10.8.168.20
-ARG JAVET_VERSION=3.0.0
+ARG JAVET_VERSION=3.0.1
FROM ${JAVET_REPO}:arm64-base-node_${JAVET_NODE_VERSION} as base-node
diff --git a/docker/linux-x86_64/base_all_in_one.Dockerfile b/docker/linux-x86_64/base_all_in_one.Dockerfile
index 2f9507013..2596e6dac 100644
--- a/docker/linux-x86_64/base_all_in_one.Dockerfile
+++ b/docker/linux-x86_64/base_all_in_one.Dockerfile
@@ -13,10 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# Usage: docker build -t sjtucaocao/javet:3.0.0 -f docker/linux-x86_64/base_all_in_one.Dockerfile .
+# Usage: docker build -t sjtucaocao/javet:3.0.1 -f docker/linux-x86_64/base_all_in_one.Dockerfile .
-ARG JAVET_NODE_VERSION=20.8.0
-ARG JAVET_V8_VERSION=11.8.172.15
+ARG JAVET_NODE_VERSION=20.9.0
+ARG JAVET_V8_VERSION=11.9.169.6
FROM ubuntu:20.04
WORKDIR /
diff --git a/docker/linux-x86_64/base_gradle.Dockerfile b/docker/linux-x86_64/base_gradle.Dockerfile
index 7b6b2cc20..97adbf122 100644
--- a/docker/linux-x86_64/base_gradle.Dockerfile
+++ b/docker/linux-x86_64/base_gradle.Dockerfile
@@ -14,7 +14,7 @@
# limitations under the License.
# Usage: docker build \
-# -t sjtucaocao/javet:x86_64-3.0.0 \
+# -t sjtucaocao/javet:x86_64-3.0.1 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
# -f docker/linux-x86_64/base_gradle.Dockerfile .
diff --git a/docker/linux-x86_64/base_node.Dockerfile b/docker/linux-x86_64/base_node.Dockerfile
index 6f3ec482a..4e3e66dab 100644
--- a/docker/linux-x86_64/base_node.Dockerfile
+++ b/docker/linux-x86_64/base_node.Dockerfile
@@ -14,13 +14,13 @@
# limitations under the License.
# Usage: docker build \
-# -t sjtucaocao/javet:x86_64-base-node_20.8.0 \
+# -t sjtucaocao/javet:x86_64-base-node_20.9.0 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
-# --build-arg JAVET_NODE_VERSION=20.8.0 \
+# --build-arg JAVET_NODE_VERSION=20.9.0 \
# -f docker/linux-x86_64/base_node.Dockerfile .
ARG JAVET_REPO=sjtucaocao/javet
-ARG JAVET_NODE_VERSION=20.8.0
+ARG JAVET_NODE_VERSION=20.9.0
FROM ${JAVET_REPO}:x86_64-base-jvm
diff --git a/docker/linux-x86_64/base_v8.Dockerfile b/docker/linux-x86_64/base_v8.Dockerfile
index cb9049a81..685dee5ae 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_11.8.172.15 \
+# -t sjtucaocao/javet:x86_64-base-v8_11.9.169.6 \
# --build-arg JAVET_REPO=sjtucaocao/javet \
-# --build-arg JAVET_V8_VERSION=11.8.172.15 \
+# --build-arg JAVET_V8_VERSION=11.9.169.6 \
# -f docker/linux-x86_64/base_v8.Dockerfile .
ARG JAVET_REPO=sjtucaocao/javet
-ARG JAVET_V8_VERSION=11.8.172.15
+ARG JAVET_V8_VERSION=11.9.169.6
FROM ${JAVET_REPO}:x86_64-base-jvm
diff --git a/docker/linux-x86_64/build_all_in_one.Dockerfile b/docker/linux-x86_64/build_all_in_one.Dockerfile
index b99a6d2d6..706534272 100644
--- a/docker/linux-x86_64/build_all_in_one.Dockerfile
+++ b/docker/linux-x86_64/build_all_in_one.Dockerfile
@@ -15,7 +15,7 @@
# Usage: docker build -t javet:local -f docker/linux-x86_64/build_all_in_one.Dockerfile .
-FROM sjtucaocao/javet:3.0.0
+FROM sjtucaocao/javet:3.0.1
WORKDIR /
# Copy Javet
diff --git a/docker/linux-x86_64/build_artifact.Dockerfile b/docker/linux-x86_64/build_artifact.Dockerfile
index 9411f3f81..f459c6e82 100644
--- a/docker/linux-x86_64/build_artifact.Dockerfile
+++ b/docker/linux-x86_64/build_artifact.Dockerfile
@@ -18,13 +18,13 @@
# --build-arg JAVET_REPO=sjtucaocao/javet \
# --build-arg JAVET_NODE_VERSION=18.12.1 \
# --build-arg JAVET_V8_VERSION=10.8.168.20 \
-# --build-arg JAVET_VERSION=3.0.0 \
+# --build-arg JAVET_VERSION=3.0.1 \
# -f docker/linux-x86_64/build_artifact.Dockerfile .
ARG JAVET_REPO=sjtucaocao/javet
ARG JAVET_NODE_VERSION=18.12.1
ARG JAVET_V8_VERSION=10.8.168.20
-ARG JAVET_VERSION=3.0.0
+ARG JAVET_VERSION=3.0.1
FROM ${JAVET_REPO}:x86_64-base-node_${JAVET_NODE_VERSION} as base-v8
diff --git a/docker/windows-x86_64/base.Dockerfile b/docker/windows-x86_64/base.Dockerfile
index e7735403a..04a33901d 100644
--- a/docker/windows-x86_64/base.Dockerfile
+++ b/docker/windows-x86_64/base.Dockerfile
@@ -29,10 +29,10 @@
# The following dockerfile has been out of date because it still uses
# Visual Studio 2019 Community. Please contact the maintainer if you want an upgrade.
-# Usage: docker build -t sjtucaocao/javet-windows:3.0.0 -m 4G -f docker/windows-x86_64/base.Dockerfile .
+# Usage: docker build -t sjtucaocao/javet-windows:3.0.1 -m 4G -f docker/windows-x86_64/base.Dockerfile .
-ARG JAVET_NODE_VERSION=20.8.0
-ARG JAVET_V8_VERSION=11.8.172.15
+ARG JAVET_NODE_VERSION=20.9.0
+ARG JAVET_V8_VERSION=11.9.169.6
# https://hub.docker.com/_/microsoft-windows
FROM mcr.microsoft.com/windows:20H2-amd64
diff --git a/docker/windows-x86_64/build.Dockerfile b/docker/windows-x86_64/build.Dockerfile
index d27791f63..124bab59c 100644
--- a/docker/windows-x86_64/build.Dockerfile
+++ b/docker/windows-x86_64/build.Dockerfile
@@ -15,7 +15,7 @@
# Usage: docker build -t javet:local -f docker/windows-x86_64/build.Dockerfile .
-FROM sjtucaocao/javet-windows:3.0.0
+FROM sjtucaocao/javet-windows:3.0.1
SHELL ["cmd", "/S", "/C"]
WORKDIR /
diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js
index 175b1e97e..fd5ac10f0 100644
--- a/docs/_static/documentation_options.js
+++ b/docs/_static/documentation_options.js
@@ -1,5 +1,5 @@
const DOCUMENTATION_OPTIONS = {
- VERSION: '3.0.0',
+ VERSION: '3.0.1',
LANGUAGE: 'en, zh-CN',
COLLAPSE_INDEX: false,
BUILDER: 'html',
diff --git a/docs/conf.py b/docs/conf.py
index 532f9b766..8fefa731a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -22,7 +22,7 @@
author = 'Sam Cao'
# The full version, including alpha/beta/rc tags
-release = '3.0.0'
+release = '3.0.1'
# -- General configuration ---------------------------------------------------
diff --git a/docs/development/build.html b/docs/development/build.html
index 6ba65c9df..d4ea415ae 100644
--- a/docs/development/build.html
+++ b/docs/development/build.html
@@ -6,7 +6,7 @@
- Build Javet - Javet 3.0.0 documentation
+ Build Javet - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/development/build.rst b/docs/development/build.rst
index 1ab0d39dc..14ff8e317 100644
--- a/docs/development/build.rst
+++ b/docs/development/build.rst
@@ -24,11 +24,11 @@ Build Environment
Linux Environment
-----------------
-* Ubuntu 20.04+
+* Ubuntu 22.04+
* CMake 3.25.1+
* JDK 8
* Gradle 8.1+
-* GCC 10+
+* GCC 11+
* Python 3.9+
MacOS Environment
@@ -56,7 +56,7 @@ Windows Environment
Android Environment
-------------------
-* Ubuntu 20.04+ or Ubuntu 20.04+ in the WSL2 on the Latest Windows 10
+* Ubuntu 22.04+ or Ubuntu 22.04+ in the WSL2 on the Latest Windows 10
* CMake 3.25.1+
* JDK 8
* Gradle 8.1+
diff --git a/docs/development/build_javet_from_scratch.html b/docs/development/build_javet_from_scratch.html
index 38f236fd9..d52039b11 100644
--- a/docs/development/build_javet_from_scratch.html
+++ b/docs/development/build_javet_from_scratch.html
@@ -6,7 +6,7 @@
- Build Javet from Scratch - Javet 3.0.0 documentation
+ Build Javet from Scratch - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/development/build_javet_with_docker.html b/docs/development/build_javet_with_docker.html
index 7f2ef8fcd..f0de98787 100644
--- a/docs/development/build_javet_with_docker.html
+++ b/docs/development/build_javet_with_docker.html
@@ -6,7 +6,7 @@
- Build Javet with Docker - Javet 3.0.0 documentation
+ Build Javet with Docker - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/development/debug_with_chrome_developer_tools.html b/docs/development/debug_with_chrome_developer_tools.html
index 90d53d1c0..0fe082b3c 100644
--- a/docs/development/debug_with_chrome_developer_tools.html
+++ b/docs/development/debug_with_chrome_developer_tools.html
@@ -6,7 +6,7 @@
- Debug with Chrome Developer Tools - Javet 3.0.0 documentation
+ Debug with Chrome Developer Tools - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/development/design.html b/docs/development/design.html
index e9d58a13c..44f50c506 100644
--- a/docs/development/design.html
+++ b/docs/development/design.html
@@ -6,7 +6,7 @@
- Javet Design - Javet 3.0.0 documentation
+ Javet Design - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/development/index.html b/docs/development/index.html
index 04061a8cd..5bafe1a64 100644
--- a/docs/development/index.html
+++ b/docs/development/index.html
@@ -6,7 +6,7 @@
- Development - Javet 3.0.0 documentation
+ Development - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/development/performance.html b/docs/development/performance.html
index fdb961fd1..c604022f9 100644
--- a/docs/development/performance.html
+++ b/docs/development/performance.html
@@ -6,7 +6,7 @@
- Javet Performance - Javet 3.0.0 documentation
+ Javet Performance - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/development/test.html b/docs/development/test.html
index be0bf54ee..41a66aea2 100644
--- a/docs/development/test.html
+++ b/docs/development/test.html
@@ -6,7 +6,7 @@
- Test Javet - Javet 3.0.0 documentation
+ Test Javet - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/development/tools.html b/docs/development/tools.html
index a944279b4..17544b74a 100644
--- a/docs/development/tools.html
+++ b/docs/development/tools.html
@@ -6,7 +6,7 @@
- Development Tools - Javet 3.0.0 documentation
+ Development Tools - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/faq/background/history_with_j2v8.html b/docs/faq/background/history_with_j2v8.html
index 951710722..c9005dca4 100644
--- a/docs/faq/background/history_with_j2v8.html
+++ b/docs/faq/background/history_with_j2v8.html
@@ -6,7 +6,7 @@
- History with J2V8 - Javet 3.0.0 documentation
+ History with J2V8 - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/background/index.html b/docs/faq/background/index.html
index 3c8fb7098..cd8ca7235 100644
--- a/docs/faq/background/index.html
+++ b/docs/faq/background/index.html
@@ -6,7 +6,7 @@
- Background - Javet 3.0.0 documentation
+ Background - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/background/what_is_the_motivation.html b/docs/faq/background/what_is_the_motivation.html
index d1a69e9d8..52da190bb 100644
--- a/docs/faq/background/what_is_the_motivation.html
+++ b/docs/faq/background/what_is_the_motivation.html
@@ -6,7 +6,7 @@
- What is the Motivation? - Javet 3.0.0 documentation
+ What is the Motivation? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/faq/development/how_to_think_in_javet.html b/docs/faq/development/how_to_think_in_javet.html
index 47e83e046..b96af63fc 100644
--- a/docs/faq/development/how_to_think_in_javet.html
+++ b/docs/faq/development/how_to_think_in_javet.html
@@ -6,7 +6,7 @@
- How to Think in Javet? - Javet 3.0.0 documentation
+ How to Think in Javet? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/faq/development/index.html b/docs/faq/development/index.html
index 9ac6ea391..1f204658e 100644
--- a/docs/faq/development/index.html
+++ b/docs/faq/development/index.html
@@ -6,7 +6,7 @@
- Development - Javet 3.0.0 documentation
+ Development - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/development/where_are_es6_api_in_v8_mode.html b/docs/faq/development/where_are_es6_api_in_v8_mode.html
index 72afadab2..9278831fd 100644
--- a/docs/faq/development/where_are_es6_api_in_v8_mode.html
+++ b/docs/faq/development/where_are_es6_api_in_v8_mode.html
@@ -6,7 +6,7 @@
- Where are ES6 API in V8 Mode? - Javet 3.0.0 documentation
+ Where are ES6 API in V8 Mode? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/development/where_are_the_examples.html b/docs/faq/development/where_are_the_examples.html
index 27876798e..dcb0cf656 100644
--- a/docs/faq/development/where_are_the_examples.html
+++ b/docs/faq/development/where_are_the_examples.html
@@ -6,7 +6,7 @@
- Where are the Examples? - Javet 3.0.0 documentation
+ Where are the Examples? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/faq/development/why_is_the_inspector_disabled_in_node_js_mode.html b/docs/faq/development/why_is_the_inspector_disabled_in_node_js_mode.html
index aa79ec370..34e640414 100644
--- a/docs/faq/development/why_is_the_inspector_disabled_in_node_js_mode.html
+++ b/docs/faq/development/why_is_the_inspector_disabled_in_node_js_mode.html
@@ -6,7 +6,7 @@
- Why is the Inspector Disabled in Node.js Mode? - Javet 3.0.0 documentation
+ Why is the Inspector Disabled in Node.js Mode? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/environment/can_javet_support_legacy_linux.html b/docs/faq/environment/can_javet_support_legacy_linux.html
index 5e8cae20c..7948b2b1c 100644
--- a/docs/faq/environment/can_javet_support_legacy_linux.html
+++ b/docs/faq/environment/can_javet_support_legacy_linux.html
@@ -6,7 +6,7 @@
- Can Javet Support Legacy Linux? - Javet 3.0.0 documentation
+ Can Javet Support Legacy Linux? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/environment/index.html b/docs/faq/environment/index.html
index c81d30972..992ce1cf0 100644
--- a/docs/faq/environment/index.html
+++ b/docs/faq/environment/index.html
@@ -6,7 +6,7 @@
- Environment - Javet 3.0.0 documentation
+ Environment - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/index.html b/docs/faq/index.html
index 10bc10b8d..8854c2102 100644
--- a/docs/faq/index.html
+++ b/docs/faq/index.html
@@ -6,7 +6,7 @@
- FAQ - Javet 3.0.0 documentation
+ FAQ - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/faq/troubleshooting/a_dynamic_link_library_dll_initialization_routine_failed.html b/docs/faq/troubleshooting/a_dynamic_link_library_dll_initialization_routine_failed.html
index df8262971..0e0a7b559 100644
--- a/docs/faq/troubleshooting/a_dynamic_link_library_dll_initialization_routine_failed.html
+++ b/docs/faq/troubleshooting/a_dynamic_link_library_dll_initialization_routine_failed.html
@@ -6,7 +6,7 @@
- A dynamic link library (DLL) initialization routine failed - Javet 3.0.0 documentation
+ A dynamic link library (DLL) initialization routine failed - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/troubleshooting/can_i18n_be_supported.html b/docs/faq/troubleshooting/can_i18n_be_supported.html
index ad26d8bc8..e7faeb24c 100644
--- a/docs/faq/troubleshooting/can_i18n_be_supported.html
+++ b/docs/faq/troubleshooting/can_i18n_be_supported.html
@@ -6,7 +6,7 @@
- Can i18n be Supported? - Javet 3.0.0 documentation
+ Can i18n be Supported? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/faq/troubleshooting/can_i_debug_javet_in_chrome_dev_tools.html b/docs/faq/troubleshooting/can_i_debug_javet_in_chrome_dev_tools.html
index 24b5181ee..cdd2d76b3 100644
--- a/docs/faq/troubleshooting/can_i_debug_javet_in_chrome_dev_tools.html
+++ b/docs/faq/troubleshooting/can_i_debug_javet_in_chrome_dev_tools.html
@@ -6,7 +6,7 @@
- Can I Debug Javet in Chrome DevTools? - Javet 3.0.0 documentation
+ Can I Debug Javet in Chrome DevTools? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/troubleshooting/index.html b/docs/faq/troubleshooting/index.html
index 49d3dacb8..a65a9e2f4 100644
--- a/docs/faq/troubleshooting/index.html
+++ b/docs/faq/troubleshooting/index.html
@@ -6,7 +6,7 @@
- Troubleshooting - Javet 3.0.0 documentation
+ Troubleshooting - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/faq/troubleshooting/why_node_js_crashes_when_being_closed.html b/docs/faq/troubleshooting/why_node_js_crashes_when_being_closed.html
index 22155064b..9a975fab9 100644
--- a/docs/faq/troubleshooting/why_node_js_crashes_when_being_closed.html
+++ b/docs/faq/troubleshooting/why_node_js_crashes_when_being_closed.html
@@ -6,7 +6,7 @@
- Why Node.js Crashes When being Closed? - Javet 3.0.0 documentation
+ Why Node.js Crashes When being Closed? - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/genindex.html b/docs/genindex.html
index ca54e231c..b5acf67e1 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -4,7 +4,7 @@
- Index - Javet 3.0.0 documentation
+ Index - Javet 3.0.1 documentation
@@ -123,7 +123,7 @@
-
+
diff --git a/docs/index.html b/docs/index.html
index 202a2e52c..bf34e9ddb 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -6,7 +6,7 @@
- Javet 3.0.0 documentation
+ Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-Node.js v20.8.0
+ V8 v11.8.172.15
+Node.js v20.9.0
+ V8 v11.9.169.6
Dynamic switch between Node.js and V8 mode (Which mode do you prefer? )
Polyfill V8 mode with Javenode
V8 API exposure in JVM
@@ -357,6 +357,7 @@ Major Features
@@ -369,40 +370,40 @@ Maven<
<dependency>
<groupId> com.caoccao.javet</groupId>
<artifactId> javet</artifactId>
- <version> 3.0.0</version>
+ <version> 3.0.1</version>
</dependency>
<!-- Linux (arm64) -->
<dependency>
<groupId> com.caoccao.javet</groupId>
<artifactId> javet-linux-arm64</artifactId>
- <version> 3.0.0</version>
+ <version> 3.0.1</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<dependency>
<groupId> com.caoccao.javet</groupId>
<artifactId> javet-macos</artifactId>
- <version> 3.0.0</version>
+ <version> 3.0.1</version>
</dependency>
Gradle Kotlin DSL
-implementation ( "com.caoccao.javet:javet:3.0.0" ) // Linux and Windows (x86_64)
-implementation ( "com.caoccao.javet:javet-linux-arm64:3.0.0" ) // Linux (arm64)
-implementation ( "com.caoccao.javet:javet-macos:3.0.0" ) // Mac OS (x86_64 and arm64)
-implementation ( "com.caoccao.javet:javet-android:3.0.0" ) // Android (arm, arm64, x86 and x86_64)
+implementation ( "com.caoccao.javet:javet:3.0.1" ) // Linux and Windows (x86_64)
+implementation ( "com.caoccao.javet:javet-linux-arm64:3.0.1" ) // Linux (arm64)
+implementation ( "com.caoccao.javet:javet-macos:3.0.1" ) // Mac OS (x86_64 and arm64)
+implementation ( "com.caoccao.javet:javet-android:3.0.1" ) // Android (arm, arm64, x86 and x86_64)
Gradle Groovy DSL
-implementation 'com.caoccao.javet:javet:3.0.0' // Linux and Windows (x86_64)
-implementation 'com.caoccao.javet:javet-linux-arm64:3.0.0' // Linux (arm64)
-implementation 'com.caoccao.javet:javet-macos:3.0.0' // Mac OS (x86_64 and arm64)
-implementation 'com.caoccao.javet:javet-android:3.0.0' // Android (arm, arm64, x86 and x86_64)
+implementation 'com.caoccao.javet:javet:3.0.1' // Linux and Windows (x86_64)
+implementation 'com.caoccao.javet:javet-linux-arm64:3.0.1' // Linux (arm64)
+implementation 'com.caoccao.javet:javet-macos:3.0.1' // Mac OS (x86_64 and arm64)
+implementation 'com.caoccao.javet:javet-android:3.0.1' // Android (arm, arm64, x86 and x86_64)
@@ -428,10 +429,21 @@ Sponsors
diff --git a/docs/reference/converters/custom_converter.html b/docs/reference/converters/custom_converter.html
index 06e8e38a8..679007b71 100644
--- a/docs/reference/converters/custom_converter.html
+++ b/docs/reference/converters/custom_converter.html
@@ -6,7 +6,7 @@
-
Custom Converter - Javet 3.0.0 documentation
+
Custom Converter - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/reference/converters/index.html b/docs/reference/converters/index.html
index d75cf0530..5a925581e 100644
--- a/docs/reference/converters/index.html
+++ b/docs/reference/converters/index.html
@@ -6,7 +6,7 @@
- Converters - Javet 3.0.0 documentation
+ Converters - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/reference/converters/object_converter.html b/docs/reference/converters/object_converter.html
index 2873fbd45..11aecd344 100644
--- a/docs/reference/converters/object_converter.html
+++ b/docs/reference/converters/object_converter.html
@@ -6,7 +6,7 @@
-
Object Converter - Javet 3.0.0 documentation
+
Object Converter - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
diff --git a/docs/reference/converters/primitive_converter.html b/docs/reference/converters/primitive_converter.html
index ce42d5a56..58a68e9e9 100644
--- a/docs/reference/converters/primitive_converter.html
+++ b/docs/reference/converters/primitive_converter.html
@@ -6,7 +6,7 @@
- Primitive Converter - Javet 3.0.0 documentation
+ Primitive Converter - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
-
+
diff --git a/docs/reference/converters/proxy_converter.html b/docs/reference/converters/proxy_converter.html
index 1bb3952a9..2011dfeb8 100644
--- a/docs/reference/converters/proxy_converter.html
+++ b/docs/reference/converters/proxy_converter.html
@@ -6,7 +6,7 @@
- Proxy Converter - Javet 3.0.0 documentation
+ Proxy Converter - Javet 3.0.1 documentation
@@ -125,7 +125,7 @@
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+
+java.lang.Object
+
+
+com.caoccao.javet.interop.callback.JavetBuiltInModuleResolver
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields
+
+Modifier and Type
+Field and Description
+
+
+static java.lang.String
+PREFIX_NODE
+The constant PREFIX_NODE.
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+
+
+
+
+
+
+
+Method Summary
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/reference/javadoc/com/caoccao/javet/interfaces/package-summary.html b/docs/reference/javadoc/com/caoccao/javet/interfaces/package-summary.html
index ab354b8e4..443949df4 100644
--- a/docs/reference/javadoc/com/caoccao/javet/interfaces/package-summary.html
+++ b/docs/reference/javadoc/com/caoccao/javet/interfaces/package-summary.html
@@ -3,7 +3,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,13 +11,13 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,13 +11,13 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,13 +11,13 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,13 +11,13 @@
@@ -11,13 +11,13 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
diff --git a/docs/reference/javadoc/com/caoccao/javet/interop/binding/package-summary.html b/docs/reference/javadoc/com/caoccao/javet/interop/binding/package-summary.html
index a4f5b8c18..cc4f6e2b4 100644
--- a/docs/reference/javadoc/com/caoccao/javet/interop/binding/package-summary.html
+++ b/docs/reference/javadoc/com/caoccao/javet/interop/binding/package-summary.html
@@ -3,7 +3,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
@@ -11,7 +11,7 @@
+