-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Hawaii Rooting
Josh Matthews edited this page Jan 6, 2017
·
1 revision
#AnimationFrame issues
We believe that the problem(s) are:
-
WebIDL callbacks (JS closures) need to be properly rooted. Currently not.
- Solution: Implement darn rooting API
-
FnBox trait objects are opaque to rooting. Can't be put in JS
- Solution: Don't do that.
-
In order to do rooting properly we need two types for each rootable thingy. One for stack, one for heap. Code explosion.
- Solution: Generics?
JS<T, Rooted>
.
- Solution: Generics?
MIR pass! Just check list of all local variables.
#Generics
We can't lint-check their bodies. We don't know if T is rooted or now.
`fn foo<#[must_root] T>()? Function MUST have bound of T: Rootable or #[must_root] T if you wish to pass a rootable T to it.
mem::replace isn't a problem because it gets checked at the call site.
#Action items:
- Land nox's thing
- Do the same thing we do for promises for callbacks
- Try a MIR lint which lints local variables
- manish (filed https://github.com/servo/servo/issues/14902)
-
JS<T, Rooted>
? - Add cfail tests. Lots.
- ms2ger (filed https://github.com/servo/servo/issues/14903)