/learn-js-engine

记录自己学习JavaScript引擎的一些总结

Primary LanguageJavaScriptMIT LicenseMIT

learn-js-engine

记录自己学习JavaScript引擎的一些知识总结

主要是关于v8的内容,后续可能会涉及到v8和其他引擎之间的对比

获取v8源码&编译

按照v8官方文档的步骤即可

遇到的问题

  1. 运行gclient sync时遇到下面的错误:

NOTICE: You have PROXY values set in your environment, but gsutil in depot_tools does not (yet) obey them. Also, --no_auth prevents the normal BOTO_CONFIG environment variable from being used. To use a proxy in this situation, please supply those settings in a .boto file pointed to by the NO_AUTH_BOTO_CONFIG environment var.

这是因为gclient工具不识别环境变量设置的代理,所以按照提示配置.boto文件即可。 参照这里

编译

  1. 进入v8源码目录
cd /path/to/v8
  1. 更新代码与依赖
git pull && gclient sync
  1. 编译
tools/dev/gm.py x64.debug

查看编译工具gm.py的更多介绍

优质文章

  1. JavaScript engine fundamentals: Shapes and Inline Caches
  2. JavaScript engine fundamentals: optimizing prototypes
  3. Javascript Hidden Classes and Inline Caching in V8
  4. Optimizing dynamic JavaScript with inline caches
  5. JavaScript Engines Hidden Classes
  6. How JavaScript works: inside the V8 engine + 5 tips on how to write optimized code
  7. Fast Property Access
  8. V8 hidden class and inline cache
  9. V8 internals

个人总结

  1. Config d8 tools for debug javascript code
  2. JavaScript engine fundamentals: Shapes and Inline Caches(翻译)