编译v8-JS引擎

准备

官方文档 https://v8.dev/docs

参考这里的分支命名方式

https://v8.dev/docs/release-process

然后通过这里

https://omahaproxy.appspot.com/

可以查到最新稳定版本的大版本号

通过大版本号可以直接分支checkout出稳定的代码分支

https://chromium.googlesource.com/v8/v8.git/+/branch-heads/8.5、

在这里可以查到大版本号的最新记录

Android 平台

我的配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
is_component_build = false
android_unstripped_runtime_outputs = false
is_debug = false
symbol_level = 1
target_cpu = "arm64"
target_os = "android"
use_goma = false
v8_android_log_stdout = true
v8_static_library = true
v8_monolithic = true
v8_enable_i18n_support = false
v8_use_external_startup_data = false
use_custom_libcxx = false
use_custom_libcxx_for_host = false

修复ndk命名空间导致的问题,可能是唯一正解
https://stackoverflow.com/questions/56339224/error-while-building-v8-in-android-embedded

参考

Windows配置

预先设置环境变量来跳过工具链下载 DEPOT_TOOLS_WIN_TOOLCHAIN=0

1
2
3
4
5
6
7
8
9
10
11
12
13
is_component_build=true
use_debug_fission=false
use_custom_libcxx=false
v8_use_snapshot=true
v8_use_external_startup_data=false
force_local_build_id=true
v8_enable_i18n_support=false
is_debug=false
symbol_level=2
target_cpu="x86"
treat_warnings_as_errors=false
v8_enable_test_features=false
is_clang=true

附录

测试引擎对JS标准的支持情况(在使用一些JS引擎的老版本时)

https://github.com/tc39/test262

https://test262.fyi/# 显示一些主流引擎的兼容性