Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a high-level API for JS typed arrays #6779
Conversation
highfive
commented
Jul 26, 2015
|
Requires servo/rust-mozjs#180. |
|
The first thing I'd ask is whether some of this could live in rust-mozjs; I sometimes dream of a fully safe api around SM. Reviewed 2 of 2 files at r1, 2 of 2 files at r2, 2 of 2 files at r3, 1 of 1 files at r4. components/canvas_traits/lib.rs, line 126 [r3] (raw file): components/script/dom/bindings/typedarray.rs, line 47 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 137 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 159 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 168 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 180 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 250 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 292 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 331 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 358 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 364 [r1] (raw file): components/script/dom/imagedata.rs, line 51 [r2] (raw file): components/script/dom/imagedata.rs, line 54 [r2] (raw file): Comments from the review on Reviewable.io |
|
The rooting can't live there, unfortunately, due to its reliance on the whole JSReflectable trait stuff and RootedJSTraceableSet. |
|
It probably wouldn't be a good idea to move everything except the rooting there. Maybe it could make sense to move most of |
|
Review status: 2 of 9 files reviewed at latest revision, 13 unresolved discussions, all commit checks successful. components/script/dom/bindings/typedarray.rs, line 47 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 168 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 292 [r1] (raw file): Comments from the review on Reviewable.io |
|
|
|
Reviewed 1 of 1 files at r5, 6 of 6 files at r6, 6 of 6 files at r7. components/script/dom/bindings/typedarray.rs, line 110 [r7] (raw file): components/script/dom/bindings/typedarray.rs, line 168 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 188 [r6] (raw file): components/script/dom/bindings/typedarray.rs, line 442 [r6] (raw file): Comments from the review on Reviewable.io |
|
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed. components/script/dom/bindings/typedarray.rs, line 166 [r1] (raw file): components/script/dom/bindings/typedarray.rs, line 189 [r6] (raw file): Comments from the review on Reviewable.io |
|
Review status: 2 of 9 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. components/script/dom/bindings/typedarray.rs, line 194 [r6] (raw file): Comments from the review on Reviewable.io |
|
Review status: 2 of 9 files reviewed at latest revision, 4 unresolved discussions, all commit checks successful. components/script/dom/bindings/typedarray.rs, line 194 [r6] (raw file):
Comments from the review on Reviewable.io |
|
@bzbarsky Do you know why the Gecko code uses JS_CallUnbarrieredObjectTracer? |
|
Probably because I was told to do that by terrence? Note that this is only in cases when we're dealing with a stack-based autorooter, right? |
|
Yeah, that's the conclusion that mwu came to as well. We may need to do something different here, since apparently our RootedTraceableSet has some different characteristics from the CustomAutoRooter stuff. |
|
Reviewed 5 of 7 files at r8. components/script/dom/bindings/typedarray.rs, line 182 [r8] (raw file): components/script/dom/bindings/typedarray.rs, line 385 [r8] (raw file): Comments from the review on Reviewable.io |
…h, and make that operation infallible.
|
Updated. |
|
Note: due to the concerns about unbarriered tracing, I'm intending to implement equivalent support for SM's CustomAutoRooter instead. |
|
|
cc servo#6779 (this adds an unsafe construction of a typed array)
cc servo#6779 (this adds an unsafe construction of a typed array)
cc servo#6779 (this adds an unsafe construction of a typed array)
…ary. There is one mangling-related removal (of va_args-related functions), but these were never called and I'm not convinced they would have worked on any platform except for Linux 64 bit.
|
@jdm Any updates on this? |
|
Not since my related mailing list post. No particular point in leaving this open. |
jdm commentedJul 26, 2015
This largely a Rust-y port of Gecko's API. No codegen support yet, but it's a lot easier to work with typed arrays properly now.
r? @Ms2ger