男属蛇和什么属相最配| 十二指肠溃疡吃什么中成药| 蜘蛛吃什么食物| 昙花有什么功效与作用| 人的价值是什么| 增强抵抗力吃什么| 血管瘤是什么症状| 脑供血不足用什么药效果最好| 雷诺综合症是什么病| 10月15是什么星座| prp治疗是什么意思| 调节肠道菌群吃什么药| 糖尿病适合喝什么饮料| 疱疹病毒是什么引起的| 睡觉咬牙齿是什么原因引起的| 蚂蚁长什么样子| 纯水是什么水| 人参长什么样子图片| 青提是什么| 鸡内金是什么东西| 肚子右边是什么部位| 维生素c补什么| 尖锐湿疣是什么样的| 妊娠线什么时候长| 咽喉炎用什么药| 韭菜籽配什么壮阳最猛| ffa是什么意思| 白菜炒什么好吃| 思密达是什么药| 手指麻木什么原因| 右小腿抽筋是什么原因| hr是什么牌子| 股癣是什么样子的图片| 血压测不出来什么原因| 撸是什么意思| 肌肉抖动是什么原因| 台州为什么念第一声| 通勤什么意思| 太阳为什么会发光发热| 益气养阴是什么意思| 9527是什么意思| 梦见死去的亲人又活了是什么意思| 什么驴技穷成语| 无产阶级是什么意思| 震字五行属什么| 英寸是什么单位| 早搏是什么意思| 为什么做完爱下面会疼| 什么样的阳光填形容词| 探店是什么意思| 产前诊断是检查什么| 月经咖啡色是什么原因| 御木本是什么档次| 猪胰是什么东西| 狐臭是什么原因| 三铵复合肥是什么| 宫颈癌是什么| 枭雄的意思是什么| 乘风破浪的意思是什么| 羊肉和什么菜搭配最好| 宫外孕和宫内孕有什么区别| 吃什么食物对心脏好| 双歧杆菌三联和四联有什么区别| 胃胀是什么原因引起的| 言字旁有什么字| 练瑜伽有什么好处| 尿酸高适合吃什么水果| 治疗带状疱疹用什么药最好| 胰腺炎吃什么药见效快| 后羿是一个什么样的人| 孕妇c反应蛋白高说明什么| 拔牙之后需要注意什么事项| 小便发黄是什么原因引起的| 五行黑色属什么| 为什么腿会肿| 周公吐哺天下归心是什么意思| 多吃黄瓜有什么好处| 最大的罩杯是什么杯| 扫把星什么意思| 翘嘴鱼吃什么食物| 补充蛋白质吃什么最好| 磨玻璃结节是什么意思| 医院什么时候下班| 狗狗拉稀吃什么药| 什么叫蜘蛛痣| edo是什么意思| 7月5号什么星座| 为什么会岔气| 血氨高会导致什么后果| 泡脚有什么好处和坏处| 鱼腥草不能和什么一起吃| 钛对人体有什么好处| 哈密瓜为什么会苦| 一岁宝宝发烧吃什么药| 为什么想到一个人会心痛| 阿莫西林有什么副作用| 梦见拔花生是什么预兆| 一蹴而就什么意思| phoebe是什么意思| 什么的饰品| 皮肤出现红点是什么原因| 益生元和益生菌有什么区别| 异卵双胞胎什么意思| 瘢痕体质是什么意思| 治疗勃起困难有什么药| 腮腺炎的症状是什么| 孕酮低什么原因| 拔冗是什么意思| 梦见织毛衣是什么意思| 蓝朋友什么意思| 杂合突变型是什么意思| 1950年属虎的是什么命| 蜜蜂蜇人后为什么会死去| 嘴上长痘痘是什么原因| 活在当下什么意思| 什么是炎症| 脾是起什么作用的| 和氏璧是什么玉| 教研是什么意思| leonardo是什么牌子| 耳朵旁边长痘痘是什么原因| 溶血症是什么意思| 空调什么品牌好| 冲代表什么生肖| 4月15日是什么日子| 衣原体检查是什么| 篓子是什么意思| 老人走之前有什么预兆| 爸爸的表哥叫什么| 刑警队是干什么的| 儿童湿疹用什么药膏| 走花路是什么意思| 香醋是什么醋| 外阴炎什么症状| 鸡眼膏为什么越贴越疼| 蚊香对人体有什么危害| 血小板分布宽度是什么意思| dyf是什么意思| 杞子配什么增强性功能| pocky是什么意思| 香奶奶是什么牌子| 三七粉是什么| 湿热是什么原因引起的| 小孩便秘吃什么通便快| 百合什么时候收获| 什么是大三阳| 虚妄是什么意思| 骸骨是什么意思| 月嫂下户是什么意思| 错构瘤是什么意思| 清五行属什么| 蚊子有什么用| 甲状腺结节有什么症状| 一五行属性是什么| 大力出奇迹什么意思| 恶性贫血是什么意思| 喝苦荞茶有什么好处和坏处| 0a是什么意思| 女人辟邪带什么最好| 12月7日是什么星座| 上火流鼻血吃什么降火| 59年属什么| 什么时候闰十二月| 什么叫有机| 正视是什么意思| 蝴蝶喜欢吃什么| 砭石是什么东西| 平均血小板体积偏高是什么原因| 组胺过敏是什么意思| mct是什么| 指甲凹凸不平是什么原因| 中医科是看什么病的| 勾心斗角是什么意思| 山楂炖肉起什么作用| 舌苔白腻是什么原因| 打葡萄糖点滴有什么用| 羊可以加什么偏旁| 比熊吃什么牌子狗粮好| 尔尔是什么意思| 尿液发黄是什么病| 什么样的月光| 甘油三酯是什么| 为什么发动文化大革命| 同样的药为什么价格相差很多| 红花泡水喝有什么功效| 吴京和吴樾什么关系| 喝酒前喝什么不容易醉| 肺挂什么科| 总胆固醇偏低是什么意思| 苏轼是什么派词人| 北顶娘娘庙求什么灵验| 利可君片是什么药| 九分裤配什么鞋| 钾肥是什么肥料| 儿童过敏性结膜炎用什么眼药水| spv是什么| 三点水者念什么意思| 茶氨酸是什么| 夸父为什么要追赶太阳| 孩子头晕挂什么科| 宫颈糜烂用什么药最好| prl是什么意思| 香菇和什么不能一起吃| 羊排和什么一起炖好吃| 为什么叫香港脚| 孕妇梦见棺材是什么征兆| 巨细胞病毒阳性什么意思| 牙齿掉了一小块是什么原因| 皮炎是什么原因引起的| 日字五行属什么| 保护心脏吃什么最好| 补肾虚吃什么药最好| 曹洪是曹操的什么人| 老人反复发烧是什么原因引起的| 老打瞌睡犯困是什么原因| 蚊子咬了涂什么| 办理出院手续都需要什么| 备孕喝苏打水什么作用| 琪是什么意思| 口腔癌早期有什么征兆| 咽喉炎挂什么科| 前辈是什么意思| 一什么饼干| 白细胞低是什么原因| 打呼噜吃什么药最管用| 小狗不能吃什么| 哥哥的哥哥叫什么| 上善若水是什么意思| 蚕屎有什么作用和功效| cst是什么意思| 为什么会吐| 2岁打什么疫苗| 蜱虫咬了什么症状| 去脚气用什么药最好| 红薯叶不能和什么一起吃| 什么是通勤| 脑梗是什么意思| 乾五行属什么| 橡胶过敏是什么症状| 带牙套是什么意思| mil是什么单位| 脚酸臭是什么原因| 什么颜色加什么颜色等于灰色| 五阴是什么| 眼睛有眼屎是什么原因引起的| 胃部检查除了胃镜还有什么方法| 强直性脊柱炎是什么| 四战之地的生肖是什么| u是什么意思| 九秩是什么意思| 室间隔缺损是什么意思| 中国的国果是什么| 什么时间容易怀孕| 孩子注意力不集中是什么原因| 安乃近片是什么药| 火靠念什么| 本科二批是什么意思| 二级教授是什么意思| 什么因果才会有双胞胎| 吃了就吐是什么原因| 转氨酶高吃什么药| 菜肴是什么意思| 为什么腰疼| 喝红花有什么作用与功效| 百度

大师用车|文明出行 请勿使用以下危险的汽车用

SquirrelFish Mascot

“Hello, Internet!”

WebKit’s core JavaScript engine just got a new interpreter, code-named SquirrelFish.

SquirrelFish is fast—much faster than WebKit’s previous interpreter. Check out the numbers. On the SunSpider JavaScript benchmark, SquirrelFish is 1.6 times faster than WebKit’s previous interpreter.

SunSpider runs per minute

bar graph of SunSpider runs

Longer bars are better.

What Is SquirrelFish?

SquirrelFish is a register-based, direct-threaded, high-level bytecode engine, with a sliding register window calling convention. It lazily generates bytecodes from a syntax tree, using a simple one-pass compiler with built-in copy propagation.

SquirrelFish owes a lot of its design to some of the latest research in the field of efficient virtual machines, including research done by Professor M. Anton Ertl, et al, Professor David Gregg, et al, and the developers of the Lua programming language.

Some great introductory reading on these topics includes:

I’ve also pored over stacks of terrible books and papers on these topics. I’ll spare you those.

Why It’s Fast

Like the interpreters for many scripting languages, WebKit’s previous JavaScript interpreter was a simple syntax tree walker. To execute a program, it would first parse the program into a tree of statements and expressions. For example, the expression “x + y” might parse to

        +   
      /   \    
     x     y

Having created a syntax tree, the interpreter would recursively visit the nodes in the tree, performing their operations and propagating execution state. This execution model incurred a few types of run-time cost.

First, a syntax tree describes a program’s grammatical structure, not the operations needed to execute it. Therefore, during execution, the interpreter would repeatedly visit nodes that did no useful work. For example, for the block “{ x++; }”, the interpreter would first visit the block node “{…}”, which did nothing, and then visit its first child, the increment node “x++”, which incremented x.

Second, even nodes that did useful work were expensive to visit. Each visit required a virtual function call and return, which meant a couple of indirect memory reads to retrieve the function being called, and two indirect branches—one for the call, and one for the return. On modern hardware, “indirect” is a synonym for “slow”, since indirection tends to defeat caching and branch prediction.

Third, to propagate execution state between nodes, the interpreter had to pass around a bunch of data. For example, when processing a subtree involving a local variable, the interpreter would copy the variable’s value between all the nodes in the subtree. So, starting at the “x” part of the expression “f((x) + 1)”, a variable node “x” would return x to a parentheses node “(x)”, which would return x to a plus node “(x) + 1”. Then, the plus node would return (x) + 1 to an argument list node “((x) + 1)”, which would copy that value into an argument list object, which, in turn, it would pass to the function node for f. Sheesh!

In our first rounds of optimization, we squeezed out as much performance as we could without changing this underlying architecture. Doing so allowed us to regression test each optimization we wrote. It also set a very high bar for any replacement technology. Finally, having realized the full potential of the syntax tree architecture, we switched to bytecode.

SquirrelFish’s bytecode engine elegantly eliminates almost all of the overhead of a tree-walking interpreter. First, a bytecode stream exactly describes the operations needed to execute a program. Compiling to bytecode implicitly strips away irrelevant grammatical structure. Second, a bytecode dispatch is a single direct memory read, followed by a single indirect branch. Therefore, executing a bytecode instruction is much faster than visiting a syntax tree node. Third, with the syntax tree gone, the interpreter no longer needs to propagate execution state between syntax tree nodes.

The bytecode’s register representation and calling convention work together to produce other speedups, as well. For example, jumping to the first instruction in a JavaScript function, which used to require two C++ function calls, one of them virtual, now requires just a single bytecode dispatch. At the same time, the bytecode compiler, which knows how to strip away many forms of intermediate copying, can often arrange to pass arguments to a JavaScript function without any copying.

Just the Beginning

In a typical compiler, conversion to bytecode is just a means to an end, not an end in itself. The purpose of the conversion is to “lower” an abstract tree of grammatical constructs to a concrete vector of execution primitives, the latter form being more amenable to well-known optimization techniques.

Therefore, though we’re very happy with SquirrelFish’s current performance, we also believe that it’s just the beginning. Some of the compile-time optimizations we’re looking at, now that we have a bytecode representation, include:

  • constant folding
  • more aggressive copy propagation
  • type inference—both exact and speculative
  • specialization based on expression context—especially void and boolean context
  • peephole optimization
  • escape analysis

This is an interesting problem space. Since many scripts on the web are executed once and then thrown away, we need to invent versions of these optimizations that are simple and efficient. Moreover, since JavaScript is such a dynamic language, we also need to invent versions of these optimizations that are resilient in the context of an unknown environment.

We’re also looking at further optimizing the virtual machine, including:

  • constant pool instructions
  • superinstructions
  • instructions with implicit register operands
  • advanced dispatch techniques, like instruction duplication and context threading
  • getting computed goto working on Windows

Performance on Windows has extra room to grow because the interpreter on Windows is not direct-threaded yet. In place of computed goto, it uses a switch statement inside a loop.

Getting Involved

If you’re interested in compilers or virtual machines, this is a great project to join. We’re moving quickly, so the best way to come up to speed is to log on to our IRC channel.

As always, testing out nightly builds and reporting bugs is also a great help.

Extra Bonus Updates

We’ve got some extra bonus info: very early draft documentation of the SquirrelFish VM’s opcodes. For those of you who know about VMs, you may find this enlightening, for those who don’t, you may find it is simpler than you expect.

In addition, we have a detailed comparison of Safari 3.1 vs. SquirrelFish, looking at the individual tests, it is interesting to see which sped up the most. If you look at this comparison to Safari 3.0, you can see that we’ve sped up 4.34x overall since Safari 3, and have improved some kinds of code by over an order of magnitude.

SquirrelFish around the web: There’s lots of interesting discussion in the reddit article about this post. And posts from key SquirrelFish developer Cameron Zwarich has performance data and other info, as does occasional WebKit contributor Charles Ying.

老是干咳什么原因 结节3类是什么意思 什么时候割包皮最好 肌酐下降是什么原因 海归是什么意思
健脾胃吃什么食物好 八一建军节什么生肖 尿血挂什么科 婴幼儿湿疹用什么药膏最有效 一个木一个寿念什么
舟可是什么字 休学什么意思 什么食物对眼睛视力好 手脚发麻是什么原因 1967年出生属什么
上海有什么烟 头晕在医院挂什么科 1117什么星座 牙齿吃甜的就会疼什么原因 前列腺肥大是什么症状
麦冬有什么功效hcv8jop1ns4r.cn 脸发红发痒是什么原因hcv8jop6ns3r.cn 阴毛有什么作用hcv9jop7ns4r.cn 为什么井盖是圆的hcv8jop2ns3r.cn 天秤男喜欢什么样的女生hcv9jop6ns3r.cn
欧金金什么意思hcv9jop3ns5r.cn 甲胎蛋白什么意思1949doufunao.com 一直鼻塞是什么原因hcv9jop4ns8r.cn 头皮脂溢性皮炎用什么洗发水cl108k.com 中东为什么叫中东hcv9jop0ns2r.cn
白皮书什么意思shenchushe.com 曲酒是什么酒creativexi.com 眼睛飞蚊症用什么眼药水dajiketang.com bbc是什么意思0297y7.com 阳虚有什么症状和表现hcv8jop9ns6r.cn
什么食物利尿hcv8jop8ns9r.cn 羊水指数和羊水深度有什么区别hcv7jop5ns0r.cn 脚凉是什么原因造成的hcv9jop7ns5r.cn 向晚的意思是什么hcv9jop5ns3r.cn 脉冲什么意思hcv9jop1ns6r.cn
百度