

Chrome's v8 compiles JavaScript into machine code - andreyf
http://code.google.com/apis/v8/design.html#mach_code

======
amix
Lars Bak (head of development for V8) has before made VM's for Self and
SmallTalk. Other than that he was the technical lead for Java's HotSpot VM.

It's a very interesting approach they have taken, especially with class
transitions and compilation. I hope Python / Ruby / Perl and other languages
can learn and optimize with these ideas and code base.

Btw. Java was interpreted at first, JIT was first added with HotSpot and the
speed improvement was around 20x.

~~~
sb
"...hope Python/Ruby/Perl and other languages..." JITing code of these
languages surely is possible (compare e.g. with psyco, exceptions might be
eval'ed statements and the like...), however, all of these languages take the
approach of a simple but fast compiler and having an interpreter as an
execution engine (where more optimizations are easily possible), hence the
ideas are not directly applicable (as far as python is concerned: their
explicit goal is to have the utmost simplicity in their compiler/interpreter)

also, while the JITing part of the v8 surely is nice by itself, IMHO the real
runtime performance seems to come from the inlining by what they call "fast
property access" -- the papers cited are a very good reference; indepth
details can be found via scholar.google.com, though not explicitly mentioned,
i figure that PICS, polymorphic inlince caches, are relevant too...

besides that i find the source code very interesting, it seems that it's just
a very small codebase (with "ugly" c++ coding standards--given my subjective
taste of course; i liked ellemtel guidelines best...); actually, i found
myself looking for the "rest" until it became obvious thats all...

~~~
stcredzero
Python and Ruby are just a bit more difficult for fast VM implementors because
every Object is like a little dictionary. The ordering of the instance values
in each Object's collection is dependent on runtime events. In languages where
the instance variables are declared ahead of time, the VM implementor can just
access each instance variable as an offset of the Object pointer. (Which is
what happens in many Smalltalk and Java VMs.)

This is certainly not impossible to overcome. It's just an added difficulty.

~~~
LogicHoleFlaw
Objects in JavaScript are also dictionaries.. hence the use of "object
literals" for dictionaries. The hidden class system in v8 is the technique
which allows offsets to be used instead of having to do dict lookups all the
time.

------
stcredzero
For more info on the background of V8 -

<http://news.ycombinator.com/item?id=293869>

------
etal
Is this the same strategy used in Ikarus Scheme?

<http://www.cs.indiana.edu/~aghuloum/ikarus/#about>

I don't see any comparisons to existing interpreter/compiler implementations
in the V8 docs.

(edit: Oh. Strongtalk. So is that "incremental optimizing compilation" as
well?)

------
pistoriusp
Did anyone else read V8 as VB in the comic?

------
iman
What cpu architectures are supported?

~~~
andreyf
V8 implements ECMAScript as specified in ECMA-262, 3rd edition, and runs on
Windows XP and Vista, Mac OS X 10.5 (Leopard), and Linux systems that use
IA-32 or ARM processors.

