Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"深入V8引擎"书籍大纲 #11

Open
qjivy opened this issue May 23, 2021 · 16 comments
Open

"深入V8引擎"书籍大纲 #11

qjivy opened this issue May 23, 2021 · 16 comments

Comments

@qjivy
Copy link
Contributor

qjivy commented May 23, 2021

今年V8小组要完成一本介绍V8技术细节的书籍。这个issue用来记录这本书的内容提纲。

稻盛先生说“必须具备某种‘无赖’精神”。

在开始挑战某项新事业时,人容易出现“因为没有这个或那个”的心态,往往一拖再拖,迟迟不肯迈出第一步。但是,挑战新事物,或是从事谁都没有做过的事业时,因为本来就没有前例可循,所以起步阶段一无所有是理所当然的。

即便如此,也无论如何都想要实现。如果愿望如此强烈,就会去思考如何才能实现,就会透彻地、具体地思考所需的人才、技术、资金、设备以及如何调配这些资源。对于心中强烈的愿望和梦想,只有透彻思考到每个细节,目标才能够实现。

@qjivy
Copy link
Contributor Author

qjivy commented May 23, 2021

  1. V8 overview和相关背景介绍
    a) JavaScript语言介绍
    b) SpiderMonkey/CharkraCore/V8/简介
    c) V8的技术演进历史(full CodeGen,turbofan,sparkplug)
  2. 一个简单例子在V8中运行的流程
    a) helloworld 或者 “1+1” 如何运行[1]
  3. V8的构建系统[2][3]
    a) gn
    b) ninja
    c) 配置方法和选项
    d) Chromium构建工具depot_tools
  4. V8前端 : 阐述V8如何从JavaScript代码生成Bytecode
    a) scanning [4]
    b) parser to AST [5]
    c) AST rewrite? [6]
    d) BytecodeGenerator [7]
  5. V8的Bytecode解释器Ignition
    a) Bytecode介绍 [8]
    b) BytecodeHandler和AOT编译
    c) 解释执行过程[7]
  6. V8的优化编译器TurboFan
    a) pipeline 和phase体系[9 ]
    b) SON IR及其产生[10]
    i. SON IR介绍
    ii. IR opcode
  7. JavaScript level opcode
  8. Simplified level opcode
  9. Machine level opcode
    c) 体系结构无关phases:
    d) 体系结构相关phases:后端
  10. V8的后端
    a) 指令选择:
    i. 基于树匹配的指令选择过程
    ii. 指令选择阶段的优化[11]
    b) 指令调度:
    i. 基本块内基于critical path的拓扑排序调度[12]
    c) 寄存器分配:[13]
    i. 现行扫描寄存器分配算法
    ii. 分配约束的表达和满足
    iii. GAP的处理
    iv. 溢出的处理
  11. V8的WebAssembly基线编译器Liftoff
    a) Wasm的ISA
    b) baseline编译
    c) tier-up和优化
  12. V8的RegExp编译器
  13. V8的sparkplug编译器
  14. V8的垃圾回收器Orinoco
  15. V8的安全策略和防护机制 [14]
    a) isolate和Native context
    b) poison机制
  16. V8的测试框架 [15]
  17. V8的调试方法,命令行选项和工具
    a) 命令行选项解释
    b) Tuborlizer的用法
    c) gdb + simulator的用法
  18. JS引擎的常见优化方法和V8的实现
    a) Speculative optimization
    b) Inline Caching
    c) Deoptimization

Reference:

[1] Calculating 1 + 1 in JavaScript,https://medium.com/compilers/calculating-1-1-in-javascript-1cecb6e9610
[2] V8 JavaScript Engine: Compiling with GN and Ninja
https://medium.com/compilers/v8-javascript-engine-compiling-with-gn-and-ninja-8673e7c5e14a
[3]从0开始,自顶向下地学习 V8’s build system, part1-par3
[4] https://medium.com/compilers/calculating-1-1-in-javascript-part-3-710f686d9a40
[5] https://medium.com/compilers/calculating-1-1-in-javascript-part-4-42ca49f45ac5
[6] https://medium.com/compilers/calculating-1-1-in-javascript-part-5-79abef791670
[7] https://github.com/plctlab/v8-internals/blob/master/slides/01-igniton-bytecode-dump.pdf
[8] https://m.bilibili.com/video/BV16b4y1f7Wf
[9] https://yt.droid.ac.cn/whale/v8-riscv/-/issues/250
[10] Cliff Click and Michael Paleczny. 1995. A simple graph-based intermediate representation. SIGPLAN Not. 30, 3 (March 1993), 35–49. DOI:https://doi.org/10.1145/202530.202534
[11] https://github.com/isrc-cas/PLCT-Open-Reports/blob/master/20200527-v8%E6%8C%87%E4%[…]8B%A9%E8%BF%87%E7%A8%8B%E4%B8%AD%E7%9A%84%E4%BC%98%E5%8C%96.pdf
[12] https://yt.droid.ac.cn/whale/v8-riscv/-/issues/253
[13] V8 Turbofan Register Allocation Design, https://docs.google.com/document/d/1aeUugkWCF1biPB4tTZ2KT3mmRSDV785yWZhwzlJe5xY/edit
[14] https://m.bilibili.com/video/BV1hp4y1t7Mx
[15] https://medium.com/compilers/testing-the-v8-javascript-engine-cbda7d9272e6

@lzm0x219
Copy link

Mark

@zhongmeizhi
Copy link

Mark too

@flx413
Copy link

flx413 commented May 24, 2021

M

@uncr4ck4ble
Copy link

期待

@bb33bb
Copy link

bb33bb commented May 28, 2021

迫切期待最新消息。

@vicksiyi
Copy link

期待

@hYuang
Copy link

hYuang commented Jul 23, 2021

能帮忙做些什么吗

@bb33bb
Copy link

bb33bb commented Dec 21, 2021

啥时候出版呀?等的比较久了。

@aehyok
Copy link

aehyok commented Jun 14, 2022

一年多了,继续加油

@ilikethese
Copy link

Mark

@Rowlet-Pan
Copy link

请问这本书出版了吗?

@lazyparser
Copy link
Member

请问这本书出版了吗?

就我所知还在初稿的阶段

@BinLi-git
Copy link

2023年了,别再鸽了。。。

@chennbnbnb
Copy link

chennbnbnb commented Nov 2, 2023

催更催更, v8方面很缺资料, 期待你们的工作. 或者实在不行先出个电子online版本的, 边更边写, 最后再出版纸质的

@zhaojunmeng
Copy link

请问还会有后续吗?
我这里是一个UnrealEngine下面的游戏项目,也在使用V8作为脚本引擎,最近在学习v8的相关知识;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests