Safari’s New JS Interpreter: SquirrelFish

There’s an announcement on the Safari blog about SquirrelFish, their new JS interpreter. To sum it up:

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.

Some performance data can be found here, as well as here, which even tests against Tamarin (slated for inclusion in Mozilla2). I think the motive for this move might have been best summarized here:

  1. I can imagine the “performance per watt� power consumption for SquirrelFish is also much lower. Good for my iPhone’s battery life.

Especially with the iPhone going 3G next week which will consume more power, making a web browser be as efficient as possible with CPU cycles not only makes the experience better, but will save battery life. This doesn’t just impact the iPhone as Google’s Android also includes WebKit.

David Mandelin has some analysis and comparison to the Mozilla work being done on his blog.

It’s pretty interesting stuff.