Hi Ms2ger, Thanks for the heads up!
Just one comment: SpiderMonkey stores all roots on the Zone and JSRuntime now [1]. Since the JSContext is the JSRuntime too these days, I guess this distinction doesn't even matter anymore. This is important for Firefox because we'd like to (eventually) only mark roots from the relevant zones when doing a compartmental GC. Of course, servo isn't even using Zones, so this is probably totally irrelevant for your use. Nothing to change, just worth noting if you ever do want to use zones. Cheers, Terrence 1- https://dxr.mozilla.org/mozilla-central/source/js/public/RootingAPI.h?q=Rooted&redirect_type=direct#662-664 On Mon, Jun 27, 2016 at 1:21 AM, Ms2ger <[email protected]> wrote: > [Cross-posting to m.d.t.j-e.internals; please reply only to m.d.servo.] > > Hi all, > > eddyb is proposing a new, macro-based approach to rooting SpiderMonkey > types (i.e. types that use `js::jsapi::Rooted`, NOT Servo DOM objects, > which still use `script::dom::bindings::js::Root`), as well as the > fairly uncommon `script::dom::bindings::trace::RootedVec`. > > The goal is to stop using the `return_address` intrinsic, which is > fundamentally incompatible with Rust's assumption that every type can be > moved silently. We have been lucky enough to have the `return_address` > approach work so far, but the introduction of MIR (mid-level > intermediate representation; a large-scale refactoring of code > generation within the Rust compiler) will break our code when it is > turned on. > > Typical use changes from > > ``` > let obj = RootedObject::new(cx, self.callback()); > ``` > > to > > ``` > rooted!(in(cx) let obj = self.callback()); > ``` > > The pull requests are at: > > https://github.com/servo/rust-mozjs/pull/272 > https://github.com/servo/servo/pull/11872 > > Comments from SpiderMonkey GC hackers are or course very welcome. > > Ms2ger > _______________________________________________ > dev-tech-js-engine-internals mailing list > [email protected] > https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > _______________________________________________ dev-tech-js-engine-internals mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

