Monday, November 06, 2006

SpiderMonkey's relative Tamarin joins the family


Today Adobe announced that the ECMAScript 4 compatible virtual machine in the Adobe Flash Player has been contributed to the Mozilla project under the name Tamarin. It is the single largest contribution to the Mozilla foundation since its inception and consist of about 135.000 lines of source code. The engine is fully open source using the standard Mozilla license, with the Mozilla foundation retaining full ownership.

What does this mean?

  • I anticipate that Tamarin will become the reference implementation for ECMAScript 4 VMs. Most of you have probably not realized yet, but ActionScript 3 IS an ECMAScript 4 compatible VM (or at least the closest one as one of my coworkers wants me to point out). Yes, it is the implementation of a standard and not something Adobe has made up. Yes, I know ECMAScript 4 was and still is preliminary, but the changes which will be adopted before it goes official will probably be extremely minor (depending on which further additions get approved though).

  • Adobe does NOT open source the Flash Player by doing this. Just the Verifier, JIT, core frameworks and the garbage collection engine are now open source. Also important to note: The java based compiler which converts ECMAScript 4 to the byte code understood by Tamarin is not included in this agreement. Instead the focus will be an ECMAScript 4 based compiler, which will be required for eval() to work anyway since we don't want to pollute Mozilla with too much Java code. Adobe Flash Player 9 does not support eval() to keep the binary size of the Flash Player to a minimum. Our focus on the Java compiler was required to support Flex Builder 2.

  • The plan is that Mozilla and the Adobe Flash Player will share the exact same code base now and in the future. There is no plan to fork the virtual machine at any point. Changes which go into the Mozilla source tree will be directly adopted by Adobe and vice versa.

  • Mozilla might adopt the conservative garbage collector even for SpiderMonkey. Again, what most people do not realize is that we made the switch from a simple reference counting system to a more advanced mechanism for ActionScript 1&2 while maintaining backwards compatibility. This was an incredible challenge. In case of the Adobe Flash Player this resulted in about half the memory requirements in many situations. This would be a huge boon for AJAX based applications, in addition to resolving circular reference issues if they still exist in SpiderMoney.

  • If you study the source code you'll realize that a 64bit port is NOT a recompile away. We are actively working on the 64bit port, the source code right now is still 32bit until the changes required are stabilized.

Labels:

7 Comments:

Anonymous Anonymous said...

It should be ECMAScript as in European Computer Manufacturers Association (ECMA).

Tuesday, November 07, 2006 5:19:00 PM  
Anonymous Anonymous said...

Tinic,

Are the sources actually available in the mozilla source tree / cvs somewhere? If so, where? (I looked today, and couldn't find the path.)

Thanks!

Tuesday, November 07, 2006 7:38:00 PM  
Anonymous Anonymous said...

Anonymous,

According to the Tamarin Project page at:
http://www.mozilla.org/projects/tamarin/
The Tamarin source code is available via CVS at mozilla/js/tamarin/
http://lxr.mozilla.org/mozilla/source/js/tamarin/

Tuesday, November 07, 2006 9:53:00 PM  
Anonymous Anonymous said...

Tinic,

Sorry about the last comment. I found the sources. Apparently they're under the "MozillaSources" CVS module. (they're also in LXR, but that was easier to find :-)

My next question is, where can we get the appropriate version of zlib to compile the project? I'm using MS Visual Studio 2003 on WinXP, and it upconverts the .sln file just fine. However, upon building, it's complaining about not finding files in ../../../zlib. I found some files on zlib.net and on the sf.net rDOS project (just based on the file names that were missing), but now I'm stuck on:

"infback.cpp", and "inffas86.cpp".

Any idea where we can find these?

Sorry for all the questions... but I'm really excited by the prospect of being able to run/debug the VM I've been obsessing about since 2002. ;-)

Thanks for all your help in advance.
-- Anon

Tuesday, November 07, 2006 11:23:00 PM  
Anonymous Anonymous said...

"..anyway since we do want to pollute Mozilla.."

shouldn't this be "we DON'T want to pollute,etc.."?

Wednesday, November 08, 2006 5:43:00 AM  
Anonymous shaver said...

SpiderMonkey already has a mark-and-sweep collector safe against reference cycles, but we've wanted a more sophisticated (generational, f.e.) collector for some time; it'll be interesting to see how MMgc can be used to improve our GC situation, for sure!

The tamarin sources are in mozilla/js/tamarin in the Mozilla repository, and you can browse them at http://lxr.mozilla.org/mozilla/source/js/tamarin/ as well.

Wednesday, November 08, 2006 6:03:00 AM  
Anonymous <a href="http://drugscenterhere.com">ShopMan</a> said...

I like articles like this. Thanks!

Saturday, August 25, 2007 11:57:00 PM  

Post a Comment

<< Home