最早的 JS 引擎是純解釋器,現代 JS 引擎已經使用 JIT(Just-in-time compilation:結合預編譯(ahead-of-time compilation AOT)和解釋器的優點的編譯方式)以提高性能
主流引擎
Chrome V8、SpiderMonkey、JavaScriptCore、Chakra
- Chrome V8 from Google is the most used engine. Google Chrome and the many other Chromium-based browsers use it, as do applications built with CEF, Electron, or any other framework that embeds Chromium. Other uses include the Node.js runtime system.
- SpiderMonkey is developed by Mozilla for use in Firefox and its forks. The GNOME Shell uses it for extension support.
- JavaScriptCore is Apple's engine for its Safari browser. Other WebKit-based browsers also use it.
- Chakra is the current engine of the Microsoft Edge browser, forked from the same-named engine of Internet Explorer. However, Microsoft is now rebuilding Edge as a Chromium-based browser, so it will be using V8 instead of Chakra. Internet Explorer will continue to use its version of Chakra.
Edge 換 Chromium 內核了。。