最早的 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 内核了。。