浏览器如何执行javascript [英] How do browsers execute javascript
问题描述
我正在试图弄清楚Web浏览器是否使用解释器来执行javascript或某种编译器。众所周知,脚本语言的解释不是编译的;但是有 JScriptCompiler 可以将javascript编译成MSIL。这让我想知道IE,FF,Chrome等是否正在使用某种编译器或者它是否是解释器。
I'm trying to figure out if web browsers use an interpreter to execute javascript, or some sort of compiler. It is well known that scripting languages are interpreted not compiled; however there is the JScriptCompiler that can compile javascript into MSIL. This leaves me to wonder if IE, FF, Chrome etc are using some sort of compiler or if it's an interpreter.
任何人都可以引用浏览器运行javascript的具体方法?
Can anyone cite the specific method in which browsers run javascript?
推荐答案
过去,Javascript被解释了 - 仅此而已。
In the past, Javascript was interpreted -- and nothing more.
在过去两年左右的时间里,浏览器一直在实现新的Javascript引擎,尝试编译代码的某些部分,以加快Javascript的速度。
In the past two years or so, browsers have been implementing new Javascript engines, trying to compile some portions of code, to speed Javascript up.
有关Mozilla Firefox的更多信息,请查看:
For more informations on what has been done for Mozilla Firefox, you should take a look at :
- JavaScript:TraceMonkey
- an overview of TraceMonkey
有关Chrome引擎的更多信息,您需要阅读:
For more informations about Chrome's engine, you'll want to read :
- Dynamic Machine Code Generation
对于webkit (safari):
- Announcing SquirrelFish
不确定(或正在)在其他浏览器上完成了什么 - 但我认为存在相同类型的东西,或者将存在。
Not sure what has been (or is being) done on other browsers -- but I suppose the same kind of thing exists, or will exist.
当然,还有更多信息: <维基百科上的strong> JavaScript引擎 。
这篇关于浏览器如何执行javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!