博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
认识javascript引擎
阅读量:5906 次
发布时间:2019-06-19

本文共 8625 字,大约阅读时间需要 28 分钟。

hot3.png

转自wikipedia

A JavaScript engine is specialized which and executes (also known as ). Although there are several uses for a JavaScript engine, it is most commonly used in .

History[]

Before the second in 2008-2009, the JavaScript engine (also termed JavaScript interpreter or JavaScript implementation) was known as simply an interpreter that read and executed .

The first JavaScript engine was created by at for the web browser. The engine, code named , is implemented in C++. It has since been updated (in JavaScript 1.5) to conform to ECMA-262 Edition 3. The engine, created primarily by Norris Boyd (also at Netscape) is a JavaScript implementation in . Like SpiderMonkey, Rhino is ECMA-262 Edition 3 compliant. Applications of the technology include Apple Safari 4's Nitro, Google Chrome's and Mozilla 's .

By far the most common host environment for JavaScript is a web browser. Web browsers typically use the public (API) to create "host objects" responsible for reflecting the (DOM) into JavaScript.

The is another common application of the engine. A exposes host objects representing an request and response objects, which a JavaScript program then manipulates to dynamically generate web pages. Microsoft's ASP technology for IIS allows server-side code to be written in or JScript (Microsoft's implementation of JavaScript). Jaxer is a web server that runs entirely on JavaScript; this has the benefit of allowing the same code to be shared on the server and on the client.

Performance evolution[]

"..previously behind-the-scenes programming technology called JavaScript is getting new visibility .. "
—-CNET

A typical major browser has a graphical engine and an independent JavaScript engine, which allows for easier testing, reimplementation or use in other projects. For example Carakan is used with Presto; Nitro with WebKit; SpiderMonkey with Gecko; KJS with KHTML; Rhino by default has no layout engine. Other combinations are possible, for example, V8 with WebKit in Google Chrome. The JavaScript engine gives developers access to functionality (networking, DOM handling, external events, HTML5 video, canvas and data storage) needed to control the web browser.

is a for measuring the performance of JavaScript engines in more than a dozen tests, each concentrating on different part of JavaScript language. SunSpider does not use for benchmarking any features beyond those needed to test pure computations (no HTML, no CSS, no networking).

The JavaScript engine race: 2008 and 2009[]

Recently, there has been a race by browser developers to develop even faster JavaScript engines in response to the growing use of JavaScript frameworks and , as the user's experience is directly influenced by the browser's ability to execute the site's client-side code. In 2008, was praised for its JavaScript performance, but other browsers soon received new JavaScript engines which were faster. Later, Chrome won in the races of better performance. Chrome's strength is its application performance and processing speed, both of which were independently verified by multiple websites to be the fastest amongst the major browsers of its time. With the advent of WebKit's and Mozilla's JavaScript virtual machines, Chrome's JavaScript execution performance has been found to be slower. Google responded with the Danish-developed which boosted JavaScript performance in Google Chrome 2.

On June 2, 2008, the WebKit development team announced SquirrelFish, a then-new JavaScript engine that vastly improves Safari's speed at interpreting scripts. The engine was one of the new features in Safari 4, released for developers on June 11, 2008; the final JavaScript engine was called Nitro.

In January 2009, the engine then known as SquirrelFish Extreme (SFX) was enabled for Mac OS X on architectures as it passes all tests on that platform by Apple Inc. Released June 30, 2009, includes the optimization technique that offered "performance improvements ranging between 20 and 40 times faster" compared to in some cases.

The JavaScript engine race: 2010[]

In early 2010, the Norwegian browser replaced the aging Futhark with the faster Carakan, which was 2.5 times faster in early testing. Others in the race, at this time, include Apple's Safari's Nitro (the engine formerly known as SquirrelFish) and Firefox's new JägerMonkey (a "cross-child of Nitro with the older TraceMonkey Engine"). Microsoft lagged behind, lacking a dedicated JavaScript engine and being the slowest of the major browsers. Although by mid-2010, Microsoft held out the carrot of in then unreleased . JägerMonkey began testing in the publicly released beta in Summer 2010., also released in Summer 2010, featured 30 percent faster JavaScript performance than (using the Nitro engine).

2011[]

In 2011, and were released with their JavaScript software.[]

JavaScript engines[]

Mozilla[]

  • , managed by the Mozilla Foundation, open source, developed entirely in Java
  • (code name), the first ever JavaScript engine, written by Brendan Eich at Netscape Communications
  • , a introduced with
  • , the engine introduced with
  • , further JIT compiler optimizations for SpiderMonkey, introduced with
  • , the engine based on , introduced with
  • , by

Google[]

  • - open source, developed by Google in Denmark, part of Google Chrome

Opera[]

  • , by , used by web browser version 10.50 until switching to with Opera 14 (released in 2013).
  • , by Opera Software, used by Opera web browser versions 9.50 to 10.10 until replaced by Carakan in Opera 10.50 (released March 2010).

Safari[]

  • - open source, marketed as Nitro and developed by for

Other[]

  • - KDE's ECMAScript/JavaScript engine originally developed by for the KDE project's Konqueror web browser
  • open source, written by Brendan Eich, who also wrote SpiderMonkey
  • , for
  • , open source, written by Douglas Campos and others
  • , open source as part of OpenJDK, written by Oracle Java Languages and Tool Group
  • The open-source JUCE C++ toolkit contains an embedded JavaScript interpreter

Implementations[]

See also:

JavaScript is a dialect of , which is supported in many applications, especially . Dialects sometimes include extensions to the language, or to the and related (API) such as the (W3C) specified (DOM). This means that an application written in one dialect may be incompatible with another, unless the applications are written to use only a common subset of supported features and APIs ("core").

A dialect and an implementation are distinct: a dialect of a language is a significant variant of that language, while an implementation of a language (or dialect) executes a program written in that language (or dialect).

Application Dialect and latest version ECMAScript edition
, the engine ECMA-262, edition 5
Mozilla , the layout engine, , and JavaScript 1.8.5 ECMA-262, edition 5
, the engine ECMA-262, edition 5.1
ECMAScript with some JavaScript 1.5
and extensions
ECMA-262, edition 5.1
layout engine, KDE's JavaScript 1.5 ECMA-262, edition 3
JavaScript 1.5 ECMA-262, edition 3
JavaScript 1.4 ECMA-262, edition 3
JavaScript 1.5 ECMA-262, edition 3
JavaScript 1.5 with extensions ECMA-262, edition 3

See also[]

  • – Browser speed test

References[]

  1. ^ Shankland, Stephen (2010-03-02). . CNET. CBS Interactive. Retrieved 2012-01-30. 
  2. ^ Shankland, Stephen (February 5, 2009). . . CBS Interactive. 
  3. Shankland, Stephen (2008-09-02). . CNET Business Tech. CBS Interactive. Retrieved 2010-06-28. 
  4. . PC Games Hardware. Computec Media AG. Retrieved 2010-06-28. 
  5. . . Retrieved 2010-06-28. 
  6. Shankland, Stephen (2008-09-02). . CNET. CBS Interactive. Retrieved 2010-06-28. 
  7. Shankland, Stephen (2008-09-19). . CNET. CBS Interactive. Retrieved 2010-06-29. 
  8. . satine.org. Retrieved 2010-06-29. 
  9. Shankland, Stephen (2008-09-03). . CNET Business Tech. CBS Interactive. Retrieved 2010-06-29. 
  10. Garen, Geoffrey (2008-06-02). . Retrieved 2008-06-11. 
  11. Lipskas, Vygantas (2008-06-11). . Retrieved 2008-06-11. 
  12. Ryan Paul (2008-08-22). . arstechnica.com. Ars Technica © 2010 Condé Nast Digital. Retrieved 2010-06-28. 
  13. ^ . 
  14. Safari 5 Released
  15. Marius Oiaga (2010-03-20), , softpedia.com (SoftNews NET SRL), retrieved 2010-06-28 
  16. Werner Schuster (2011-10-02), , InfoQ 
  17. J. Laskey (2011-07-19), , Oracle 
  18. . Opera.com. Opera Software ASA. Retrieved 2010-06-28. 

External links[]

  • - A daily comparison of bleeding-edge JavaScript engines for Mozilla , and .
  • – Browser speed test
  • – Online JavaScript speed test
  • – Online JavaScript speed test
  • – A different open source JavaScript engine on Java platform
[]
Dialects
    • engines
()
Frameworks,
libraries
()
()
()
()
ActionScript
Multiple
implementations
People
Other
Retrieved from " "
:

转载于:https://my.oschina.net/u/138995/blog/178695

你可能感兴趣的文章
Appium===Appium+Python API(转)
查看>>
pillow模块的学习
查看>>
生。老。病。死。求不得,爱别离,怨憎会,五阴炽盛。怜众生无知,取苦为乐,饮鸩止渴。...
查看>>
Javascript和swf通讯基础教程
查看>>
oracle sql 行转列 unpivot的使用
查看>>
LoadRunner监控图表与配置(一) 监控与图表
查看>>
2018.9.8-9.8 统计学课程笔记(1)-从概率论到统计学
查看>>
Report: Disappearing Wetlands Put Planet Life at Risk
查看>>
2018.11 企业战略课堂笔记3 五力模型
查看>>
BOM之history对象
查看>>
Springboot --- Spring Security (一)
查看>>
poj2263
查看>>
c++快速排序(从大到小greater/从小到大less)
查看>>
8. Ext文本输入框:Ext.form.TextField属性汇总
查看>>
js实现td排序及分组分类
查看>>
C++中的友元函数和友元类
查看>>
Java对象及对象引用变量
查看>>
C#泛型集合—Dictionary<K,V>使用技巧
查看>>
麻省理工科技创业之:Win 8新概念
查看>>
iOS - PackIpa App 打包
查看>>