這一系列的文章翻譯自:https://v8.dev/docs
這是這一系列文檔翻譯的第一篇,之後會陸續翻譯所有的文檔,取決於個人的空餘時間。
文檔
V8是google開源的高性能JavaScript和WebAssembly引擎,使用c++編寫。它被用於chrome和node.js,以及其他的瀏覽器。
這篇文檔的目標讀者是希望再他們的應用程序中使用V8引擎的C++開發者,以及其他對V8引擎的設計和性能感興趣的人。這篇文檔向你介紹了V8,該系列剩餘的其他文檔將會向你展示如何再你的代碼中使用V8,同時會描述一些V8引擎的設計細節,以及提供了關於測試V8引擎性能的一系列JavaScript基準。
關於V8
V8實現了ECMAScript以及WebAssembly,可以運行在Window 7或者更高,MacOS 10.12+,以及使用x84,IA-32,ARM,或者MIPS處理器的Linux系統。V8可以單獨啓動,也可以嵌入到其他任何C++程序中。
V8編譯和執行JavaScript源代碼,處理對於對象的內存分配,以及當對象不再需要時的垃圾收集。精確的垃圾收集器時V8性能的關鍵之一。
JavaScript在瀏覽器的腳本編程中被廣泛使用,例如用於操作DOM。DOM一般不是由JavaScript引擎提供的,而是由瀏覽器來實現的。在V8中也是這樣,Google Chrome提供了DOM。然而,V8確實提供了所有ECMA標準定義的數據類型,操作符,對象和函數。
V8使得任何C++程序可以暴露它們自己的對象和函數與給JavaScript代碼。由你來決定你想要將哪些對象和函數暴露給JavaScript。
文檔概覽
- 從源代碼構建V8
- Contributing
- V8’s public API and its stability
- Becoming a V8 committer
- Committer’s responsibility
- Blink web tests (a.k.a. layout tests)
- Evaluating code coverage
- Release process
- Implementing and shipping JavaScript/WebAssembly language features
- Flake bisect
- Handling of ports
- Merging & patching
- Node.js integration build
- New Node.js integration build
- Reporting security bugs
- Running benchmarks locally
- Testing
- Triaging issues
- Debugging
ARM debugging with the simulator
Cross-compiling and debugging for ARM/Android
Debugging builtins with GDB
Debugging over the V8 Inspector Protocol
GDB JIT Compilation Interface integration
Investigating memory leaks
Stack trace API
Using D8 - Embedding V8
Guide to embedding V8
Version numbers
Built-in functions
i18n support
Untrusted code mitigations - Under the hood
Ignition
TurboFan
Torque user manual
Writing Torque built-ins
Writing CSA built-ins - Writing optimizable JavaScript
Using V8’s sample-based profiler
Profiling Chromium with V8
Using Linux perf with V8
Tracing V8