Re: what is wrong with using JS::PersistentRooted

msami <[email protected]> Wed, 11 Sep 2019 01:55:56 -0700 (PDT)
Newsgroups gmane.comp.mozilla.devel.jseng
Message-ID <[email protected]>
> 
> That is the general idea, and I know it is complicated and confusing. 
> You'll need to post more details of what you're running into if you need 
> more than that.

thanks for your reply, my application is Vxml Interpreter for voice-platform that services calls, each call go throw vxml document which uses spidermonkey to interpret javascripts, the problem is these calls are dynamically allocated, I needd to create a wrapper for JSAPI that lives with the call and get destroyed with it 

the model we use now we init the JSAPI on a layer higher than the calls serving level, all calls are on the same thread on cx on runtime 

each call has it's a global object when we use rootedobject it causes core dump so we replaced it with persistentRooted and it seems to work fine 

the big problem is that we need to use JS::AutoObjectVector and it causes the same problem as rootedObject when GC start Running


we use JS::AutoObjectVector as scope chain to evaluate on it as the vxml is multilayered each layer can see upper layers and not vise verse