JavaScriptエンジン

JavaScriptエンジン (英語: JavaScript engine) は、JavaScriptのコードを実行するコンピュータプログラムである。初期のJavaScriptエンジンは単なるインタプリタであったが、近年の全てのエンジンは、性能の向上のためにJITコンパイルを利用している[1]

JavaScriptエンジンは通常、ウェブブラウザのベンダーによって開発されており、全ての主要なブラウザはそのエンジンを搭載している。ブラウザでは、JavaScriptエンジンはDOMを介してレンダリングエンジンと連携して実行される。

JavaScriptエンジンの使用はブラウザに限定されたものではなく、例えば、V8は一般的なNode.jsランタイムシステムのコアコンポーネントである。

ECMAScriptはJavaScriptの標準仕様なので、ECMAScriptエンジン (英語: ECMAScript engine) はJavaScriptエンジンの別名である。

歴史

最初のJavaScriptエンジンはNetscape Navigator向けにブレンダン・アイクによって1995年に作成された。これは彼によって新たに開発された言語であるJavaScriptのための初歩的なインタプリタであった[注釈 1]

最初のモダンなJavaScriptエンジンは、GoogleGoogle Chrome (Chromium) のために作成したV8である。V8は2008年にChromeの一部として登場し、それ以前のどのエンジンよりも遥かに優れた性能であった[2][3][4]。V8はJITコンパイルを採用したことが革新的であり、これによって実行時間を大幅に改善することができる。

V8との競争のために、他のブラウザベンダーはインタプリタをオーバーホールする必要があった[5]AppleSafari向けにNitroを開発した。このエンジンは以前のエンジンより30%優れた性能を示した[6]MozillaはNitroを部分的に活用して、SpiderMonkeyを改良した[7]OperaはインタプリタをCarakanに置き換えた。このエンジンは場合によっては従来より2倍高速であった[8]

2017年から、主要ブラウザがWebAssemblyに対応するようになり、性能が重要となる部分で事前にコンパイルされた実行ファイルを使用できるようになった。JavaScriptエンジンは通常のJavaScriptのコードと同じサンドボックスでWebAssemblyのコードを実行する。

主なエンジン

脚注

注釈

  1. このエンジンはSpiderMonkey呼ばれており、改良された上でFirefoxでも引き続き使用されている。

出典

  1. Looper, Jen (2015年9月21日). A Guide to JavaScript Engines for Idiots”. Telerik Developer Network. 2019年1月16日時点のオリジナルよりアーカイブ。2016年3月17日閲覧。
  2. Shankland, Stephen (2008年9月2日). Speed test: Google Chrome beats Firefox, IE, Safari”. CNET Business Tech. CBS Interactive. 2019年11月9日閲覧。
  3. Big browser comparison test: Internet Explorer vs. Firefox, Opera, Safari and Chrome”. PC Games Hardware. Computec Media AG. 2019年11月9日閲覧。
  4. Lifehacker Speed Tests: Safari 4, Chrome 2”. Lifehacker. 2019年11月9日閲覧。
  5. Mozilla asks, 'Are we fast yet?'”. Wired. 2019年1月18日閲覧。
  6. Apple Releases Safari 5”. Cision PR Newswire (2010年6月7日). 2019年11月9日閲覧。
  7. Shankland, Stephen (2010年3月2日). Opera 10.5 brings new JavaScript engine”. CNET. CBS Interactive. 2019年11月9日閲覧。
  8. Shankland, Stephen (2009年2月5日). Need for speed spurs Opera JavaScript overhaul”. CNET. CBS Interactive. 2019年11月9日閲覧。
  9. Stachowiak, Maciej (2008年11月9日). Companies and Organizations that have contributed to WebKit”. WebKit Wiki. 2019年4月13日閲覧。
  10. Belfiore, Joe (2018-12-06), Microsoft Edge: Making the web better through more open source collaboration, Microsoft, https://blogs.windows.com/windowsexperience/2018/12/06/microsoft-edge-making-the-web-better-through-more-open-source-collaboration
  11. Microsoft Edge and Chromium Open Source: Our Intent”. Microsoft Edge Team (2018年12月6日). 2018年12月8日閲覧。
  12. Tung, Liam (2019-07-12), Facebook just released this new open source JavaScript engine, ZDNet, https://www.zdnet.com/article/facebook-just-released-a-new-open-source-javascript-engine/
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.