

V8: Chrome's JavaScript engine source code - mace
http://code.google.com/p/v8/

======
jlouis
It is obvious that the "older" JS-engines were not built for executing
applications, but more for running small in-expensive things on homepages. As
of the later years, JS has become pretty heavy and people use it a lot more.

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!

------
stcredzero
Now this runs a lot faster:

<http://www.abrahamjoffe.com.au/ben/canvascape/>

------
cbetz
There are now three engines vying for the title of the "fastest" JS engine:

* 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.

~~~
erik
I found a blog entry with some SunSpider runs: [http://web-
graphics.com/2008/09/02/scripting-engines-just-go...](http://web-
graphics.com/2008/09/02/scripting-engines-just-got-a-whole-lot-faster/)

Unfortunately a TraceMonkey bug prevents direct comparisons.

~~~
ionfish
Brendan Eich posted some new numbers with a more recent TraceMonkey build.

[http://weblogs.mozillazine.org/roadmap/archives/2008/09/trac...](http://weblogs.mozillazine.org/roadmap/archives/2008/09/tracemonkey_update.html)

------
yan
I have been grepping through the tree trying to find the implementation of the
String class. A part of me thinks they just defined it in string.js and
somehow made the rest of the code treat it as a cpp class.

~~~
shadytrees
I think (fuzzily), from what I can find, that string-stream.cc allocates a
block of char's for a string. Once the string grows beyond the capacity,
`char* HeapStringAllocator::grow(unsigned* bytes)` doubles the size of the
allocated buffer. Kind of disappointing after half an hour of reading and
C-s'ing in Emacs.

`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.

