sagudev

Results 349 comments of sagudev

> Now assuming that &mut JsContext is always required for performing GC then this should be perfectly safe as the &mut T would be invalidated by a (potential) GC call....

In https://github.com/servo/mozjs/pull/638 I've build safe context type (the most fundamental block to safety&soundness) and outlined plan forward. Long term I think it will also make it possible to get rid...

Okay, time for another soundness issue of all. We can never really be sure that root is uniq (one thing can be rooted twice), thus creating two sets of MutableHandles...

> Thinking out loud: is this is only unsound when implemented against types that can mutate due to GC: JSVal, *mut JSObject, etc? Or is the presence of any field...

One of interesting cases is servo's dom_struct, that is actually allocated via Box, but is actually lifetime managed by SM (SM finalizes it by Box::from_raw then drop), but to my...

I checked in firefox and they always use `Heap` in dom objects (as fields), but they use `RootedValue = JS::Rooted` for local rooted values. I think this boils down to...

This is best-effort anyway, it doesn't cost anything, we just try to do our best to get stable versions sooner.

This will simplify error handling in servo too, currently we hack it: https://github.com/servo/servo/blob/ee63174d6ff0b3b7d9b255fc47c72a82ae63bc09/components/webgpu/gpu_error.rs#L76 That reminds me this should also be used for classification in wgpu: https://github.com/gfx-rs/wgpu/blob/c110bf22d811ac1a65d79375e4cfa2313787e3bc/wgpu/src/backend/wgpu_core.rs#L267-L300

We have https://github.com/servo/mozjs/blob/10fb074ab11756444e8b0f69e4cbed8d6462e3ae/mozjs-sys/build.rs#L97-L100 but maybe we should make it unconditional.

Indeed: https://github.com/servo/mozjs/blob/10fb074ab11756444e8b0f69e4cbed8d6462e3ae/mozjs-sys/makefile.cargo#L147