Hi Ms2ger!

Can you briefly summarize the new approach, contrast it to the old one, and
describe how it solves the issues around moving?

Thanks!

Nick

On Mon, Jun 27, 2016 at 1:21 AM, Ms2ger <ms2...@gmail.com> 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-servo mailing list
> dev-servo@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
>
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to