JavaScript engine

A JavaScript engine is a program that runs JavaScript code. Web Browsers often have a JavaScript engine. It can also be used outside of web browsers, such as ru…

JavaScript engine
V8 (JavaScript engine) logo

A JavaScript engine is a program that runs JavaScript code. Web Browsers often have a JavaScript engine. It can also be used outside of web browsers, such as running services in Node.js or apps in the electron framework.

Design

JavaScript was originally created as a scripting language to allow web pages to have changing, or dynamic, elements. Early Javascript engines were created as interpreters, programs that simply read the script and execute the instructions without analyzing it any more.

As JavaScript started being used more and more as a general-purpose language, execution speed, or how quickly the code is run, became more important for JavaScript engines. In response, many engines, such as V8 (Used in Chrome and Chromium) and SpiderMonkey (used in Firefox), started using Just-In-Time Compilation. In this method, it starts by compiling all of the code to optimized machine code, which is typically faster than interpretation, then running the result.[1][2]

References

  1. ↑ Doglio, Fernando (2020-08-12). "The JIT in JavaScript: Just In Time Compiler". Medium. Retrieved 2021-01-02.[permanent dead link]
  2. ↑ "A crash course in just-in-time (JIT) compilers – Mozilla Hacks - the Web developer blog". Mozilla Hacks – the Web developer blog. Retrieved 2021-01-02.


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.