Re: JSContext refactoring
Kent Williams <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.jseng |
|---|---|
| Message-ID | <[email protected]> |
Looking at our application -- which is a very straightforward embedding of Spidermonkey, the only references to JSRuntime is in concert with creating the JSContext for our interpreter, like thus: > JS_Init(); > JSRuntime *rt = JS_NewRuntime(8L * 1024 * 1024); > if (!rt) > return 1; > JSContext *cx = JS_NewContext(rt, 8192); So in essence, creating and using the Runtime would just go away, as would the runtime parameter of JS_NewContext. Right? On 06/17/2016 04:45 AM, Jan de Mooij wrote: > Hi all, > > After hundreds of Gecko/SpiderMonkey patches (thanks to bholley, bz, and > many others), each JSRuntime in Gecko now has a single JSContext. > > We've discussed this a bit the past weeks and the next step will likely be > to make JSContext inherit from JSRuntime [0]. JSContext will then only be > used on the main thread, while background threads can still use (shared) > stuff in JSRuntime via ExclusiveContext, similar to how it works today. > (These names are not set in stone, but for now it's easiest to keep them.) > > After that, we can hopefully remove JSRuntime from the public API and > embedders will only have to worry about JSContext. > > We can do most of these steps incrementally, but that means there will be > breaking API changes for a while as we remove APIs, add new ones (some of > which will be temporary), etc. Jason and I were talking about that this > week and we still think it will be worth it though. > > As this will affect all embedders, a heads up seemed appropriate. Let us > know if you have any ideas or suggestions. > > Thanks, > Jan > > [0] https://bugzilla.mozilla.org/show_bug.cgi?id=650361 > _______________________________________________ > dev-tech-js-engine mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-tech-js-engine