SpiderMonkey: The JavaScript Engine

SpiderMonkey

It is the first JavaScript engine. It runs JavaScript! It is written in C/C++, and contains an interpreter, a garbage collector, and a JIT (just-in-time) compiler. The JIT compiler was implemented by Mozilla in Firefox 3.5 (2009) [https://hacks.mozilla.org/2009/07/tracemonkey-overview/]. Over the years, this JIT compiler has been upgraded to become faster.

Who Made It and Maintains It:

It was first written by Brendan Eich in 1995. In 2011, Eich passed off management of the code to Dave Mandelin, who works for Mozilla(https://blog.mozilla.org/dmandelin/, https://twitter.com/dmandelin).

ChangeLog is at this url: http://hg.mozilla.org/mozilla-central/summary

You can see people’s names who have fixed bugs, or otherwise done work on it, here.

SpiderMonkey Source Code:

https://github.com/ricardoquesada/Spidermonkey

Forked: 32 times

Core contributors:

https://github.com/ricardoquesada/Spidermonkey/graphs/contributors

Licensing:

SpiderMonkey is run by Mozilla, and so Mozilla takes care of what licensing it has.

In the SpiderMonkey package, the licensing info. for SpiderMonkey is under ./toolkit/content/license.html. The license is really long, but at the top it says “most of the source code is available under the Mozilla Public License 2.0 (MPL).” It then says “The remainder of the software which is not under the MPL is available under one of a variety of other free and open source licenses.”

Nevertheless, the MPL2 (https://www.mozilla.org/MPL/2.0/) seems to be the main license for this code. This license grants anyone to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit” it, and to “make, use, sell, offer for sale, have made, import, and otherwise transfer” it.

Where is it?

SpiderMonkey Source Code:

https://github.com/ricardoquesada/Spidermonkey

Official Repo:

https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey

How to download.

Go to url: http://hg.mozilla.org/mozilla-central/summary

Click “zip” at the top of the page.

This downloads a 258 MB zip file.

On Windows 7:

Download MozillaBuild

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites#mozillabuild

The Community:

Since the project is managed by Mozilla, I would consider the community to be the open-source community in general. Anyone who was worked on the project is part of this community. Based on this, the community is huge. To give an idea of how big it is, just take a look at the change logs (http://hg.mozilla.org/mozilla-central/summary). Notice that you can go back in the logs by at least 100,000 logs.

Community Processes:

I found this website on how to write your first patch for SpiderMonkey: https://wiki.mozilla.org/JavaScript:New_to_SpiderMonkey. Basically, it tells you to install the code, and then make a small change. Testing for problems, and then efficiency is the next steps. Finally, fixing an actual problem would be where to go from there.

This means that the community takes testing to be an important matter, as well as efficiency in the program.

Tools Used By The Community:

https://bugzilla.mozilla.org/

This website is a forum for bugs and fixes in the Mozilla project. The topics are very specific, so be warned that it may be difficult to find answers here.

http://stackoverflow.com/

I have seen questions and answers on stack overflow, for problems installing and building.

Open Source Case Study Introduction

The project that I chose to research is SpiderMonkey (SM). It is a JavaScript (JS) engine for Firefox. So, I guess this means that when you write some JS code, this is the underlying code that turns your JS code into machine language.

In Wikipedia, it says that SM is not a just-in-time (JIT) compiler, but it has a JIT compiler that goes with it. The JIT compiler has been updated over the years, starting with TraceMonkey, then JägerMonkey, and finally IonMonkey.

SM was originally written by Brendan Eich, and is now updated and maintained by the Mozilla Foundation. Although it is now run by Mozilla, it is not made only for Mozilla. It is meant to be used in any application that wants to run JS. Other applications include: Adobe Acrobat, Reader, Flash Professional and Dreamweaver, GNOME desktop environment, as well as many others.

During my presentation, after many hours of research, I hope to expand on details of how SM is used, how it works, and other interesting details that I may happen across.

Sources:

SpiderMonkey home page: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey

SpiderMonkey wiki: http://en.wikipedia.org/wiki/SpiderMonkey_(software)

Brendan Eich wiki: http://en.wikipedia.org/wiki/Brendan_Eich