Recently I learned that there are "External Arrays" in V8. So when you embed V8 in your app, you can map your C-array to JS-array, and even choose a type, either it's char, word, int etc. This can significantly speed up data exchange between JS and C. Now the question is there something like that in SpiderMonkey?
I tried google for "spidermonkey external arrays", "binary arrays", "map arrays" and some more, no luck so far.
I have SpiderMonkey source code, but it will take ages to familiarize with it.