0%

V8 代码下载及编译

背景

为了学习和了解 Javascript Engine 的工作原理,在本地下载了V8的代码。

环境

  1. 硬件平台:x86_64
  2. OS: ubuntu 20.04

下载编译

  1. 安装depot_tools
1
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
  1. 在空目录下拉取 V8 代码
1
fetch v8
  1. 更新工具包
1
gclient sync
  1. 在 V8 的代码根目录下更新编译所需工具
1
./build/install-build-deps.sh
  1. 编译
1
tools/dev/gm.py x64.release

参考

https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up

https://segmentfault.com/a/1190000023231568

https://v8.js.cn/docs/build/

https://www.css3.io/v8yuan-ma-fen-xi.html