V8: Chrome's JavaScript engine source code
code.google.com
code.google.com
The genius here is to recognize that most of the cool work done to Smalltalk and Self applies equally well to Javascript. It feels like cheating, but the V8 team is actually just picking some low-hanging fruit done with research in the 90's. They push the envelope for what we can use JS for and that is a really good thing!
* Tracemonkey (Mozilla) * Squirrelfish (Apple/Webkit) * V8 (Google)
I would love to see a benchmark comparison (Sunspider?) to see how V8 compares to Tracemonkey and Squirrelfish.
Unfortunately a TraceMonkey bug prevents direct comparisons.
http://weblogs.mozillazine.org/roadmap/archives/2008/09/trac...
(Just find a site that has a lot of complex windows. Fastest link I could find: http://extjs.com/deploy/dev/examples/desktop/desktop.html )
Coupling an advanced javascript compiler/vm with a really quick rendering engine leaves you with what you feel there.
Hard numbers, V8 is maybe 3x faster than WebKit nightlies on every benchmark suite I could find.
You gain the advantage that the difference between library code and primitive built-in things blur more so one function can be implemented as a javascript function (because the compiler already produces good code for that part), while another function (un-implementable in JS) is C++.
`string.js` is used by `tools/js2c.py` to create a `string.h`, but otherwise I think many of the string functions are implemented in JavaScript and (I'm guessing) compiled later since `string.js` and other JavaScript files are referencing C macros.