Nikkei Electronics Asia -- January 2009
Box-5
V8 Source Code Build & Execution

E-Mail Article
Tweet This
Digg This
Share this with friends on Facebook
Buzz Up!
Jan 19, 2009 17:04 Nikkei Electronics Asia

This is a sidebar of Why Is the New Google V8 Engine So Fast? [Part 5].

V8's source code has been made available as an open source product, and can be downloaded from the project Website.

The latest version of the source code can be checked out from the Subversion repository, which also explains how to execute the sample shell program.

First checkout the code in the Subversion repository, then obtain the source code.

$ svn checkout http://v8.
googlecode.com/svn/
branches/bleeding_edge/ v8

Under Linux the scons command is used with this build (requires gcc and g++). scons installation is possible with installation commands like yum and aptitude. The source code checked out from Subversion also includes a project file for Visual Studio 2005. The Windows build uses this project file.

Under Linux, scons is executed as shown below to build the sample shell program.

$ cd v8
$ scons sample=shell

With a successful build, the "shell" program will be output to the same directory. Specify the file name as an argument for "shell" to execute.

* hello.js content
print("hello, V8!");

* run
$ ./shell hello.js
hello, V8!

Rebuild as a debug version to output the compiler machine language.

$ scons sample=shell
mode=debug

The debug problem is shell_g. Specify machine language output as an option at execution to output machine language (Fig C-1).

Cover Storyˇ§Runaway Evolution of Google Engine - table of contents