Baby Steps
June 23rd, 2007
I mentioned there are some challenges ahead. We need to integrate Tamarin’s garbage collector, MMgc, into Mozilla. The way to do this is incrementally, and the place to start is SpiderMonkey (the existing C implementation of JavaScript). So the first steps will be:
- either get SpiderMonkey to build as C++, or write a C wrapper for MMgc (leaning toward the latter)
- convince the SpiderMonkey and Tamarin build systems to cooperate
- examine the few places where SpiderMonkey is directly using
malloc()andfree() - align SpiderMonkey’s
jsvaltype and related macros with MMgc’sAtomtype - align SpiderMonkey’s notion of GC roots with MMgc’s
GCRoots - replace SpiderMonkey’s memory management routines with MMgc’s
Yeah, it gets harder as you go down the list.
A lot of this work has already been done, more or less. Some patches from crowder and graydon will help. They may be a little out of date, though, and I expect it’ll take some more hacking on top of that.

Leave a Reply