JavaScript:ActionMonkey
Jump to navigation
Jump to search
ActionMonkey is the code-name for the project to integrate Tamarin and SpiderMonkey as part of Mozilla 2.
Want to help? Write to jason dot orendorff at gmail dot com. Or visit irc://irc.mozilla.org/mmgc and say hi.
Goals
The goals are:
- Preservation (with necessary additions and as few deletions as possible) of jsapi.h.
- SpiderMonkey's thread safety and property tree integrated/reimplemented in Tamarin.
- Replacement of SpiderMonkey's decompiler with a better decompiler that can work with ABC.
- Replacement of SpiderMonkey's GC with Tamarin:MMgc, evolved as needed.
- Replacement of SpiderMonkey's interpreter by an evolved version of Tamarin's.
- Advanced JIT optimization for hot paths and untyped code, inspired by Trace Trees.
- Information flow VM support for better security models.
Stage 0
Replace SpiderMonkey's GC with Tamarin's GC (MMgc).
- Use MMgc in non-incremental mode to start with. (It's easier. Avoid premature optimization.)
- Use a C wrapper for MMgc instead of building SpiderMonkey as C++, for the moment.
- Convince the SpiderMonkey and Tamarin build systems to cooperate.
- Change the few places where SpiderMonkey is directly using malloc() and free() to use a new internal API (lowercase
js_malloc
).- Don't forget realloc/calloc.
- Hope these can all be macro-defined.
Retain as many JSAPI functions as possible:
- Tracing API. This is used by the cycle collector.
- API for tracing private data. DOM objects use this to participate in GC.
- Rooting API. This can be implemented in terms of
MMgc::GCRoot
. - Object pinning API. Same here.
- XPConnect garbage-collects
XPCWrapNative
objects and its own data structures. This needs some more research. JS_IsAboutToBeFinalized()
needs to be implemented for MMgc.JS_AddExternalStringFinalizer()
needs to be implemented, probably usingMMgc::GCFinalizedObject
.
We will, for the moment, lose one thing: the threading model where a single JSRuntime
has multiple threads, each with its own JSContext
.
Modify stuff that is not using the JSAPI but is cheating:
- Change the XPCOM cycle collector (crash of thunder) to use a separate trace phase instead of depending on the SpiderMonkey GC mark phase to generate certain information it needs for cycle detection.
During this stage, work will be done in the http://hg.mozilla.org/mozilla-central Mercurial repository.
Stage 1
More to come.