Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

dom.js concerns, again

127 views
Skip to first unread message

Boris Zbarsky

unread,
Apr 17, 2012, 3:05:10 PM4/17/12
to mozilla-...@lists.mozilla.org
The premise of dom.js seems to be that we can make it faster than jsapi
calling into Rust, right?

Do we have any actual data on this? Especially given the "ensure this
is an instance of the right interface" bits in WebIDL (which afaict
current dom.js simply doesn't do)? Do we have a plan for doing those
(efficiently!) in JS?

Note that we _do_ have plans for doing them efficiently using TI and the
fact that we can control JSClasses for DOM objects an can teach TI and
ICs about them for our current JSAPI-calls-C++ bindings....

-Boris

Boris Zbarsky

unread,
Apr 17, 2012, 5:22:56 PM4/17/12
to mozilla-...@lists.mozilla.org
On 4/17/12 3:05 PM, Boris Zbarsky wrote:
> The premise of dom.js seems to be that we can make it faster than jsapi
> calling into Rust, right?

And I guess that we can keep all memory management in JS; is that doable
even without js-hosted WebIDL implementations if it comes to that (a la
what workers do in Gecko now)?

In any case, the question about doing fast JS-only bindings remains.

-Boris

Niko Matsakis

unread,
Apr 17, 2012, 5:26:26 PM4/17/12
to Boris Zbarsky, mozilla-...@lists.mozilla.org
On 4/17/12 12:05 PM, Boris Zbarsky wrote:
> Do we have any actual data on this? Especially given the "ensure this
> is an instance of the right interface" bits in WebIDL (which afaict
> current dom.js simply doesn't do)? Do we have a plan for doing those
> (efficiently!) in JS?

Not as far as I know.


Niko

David Flanagan

unread,
Jun 1, 2012, 10:55:03 PM6/1/12
to Boris Zbarsky, mozilla-...@lists.mozilla.org
On 4/17/12 12:05 PM, Boris Zbarsky wrote:
> The premise of dom.js seems to be that we can make it faster than
> jsapi calling into Rust, right?
>
> Do we have any actual data on this? Especially given the "ensure this
> is an instance of the right interface" bits in WebIDL (which afaict
> current dom.js simply doesn't do)? Do we have a plan for doing those
> (efficiently!) in JS?
>
I have no data on it. Can you explain what you mean by the "ensure this
is an instance of the right interface"? Do you just mean not allowing
someone to pass a NodeList, for example, to a method that wants an
Element? I'm pretty sure that dom.js does do that... but its been a
while since I looked at the code. I don't generally monitor this list,
so email me directly if you'd like me to look at this.

David

> Note that we _do_ have plans for doing them efficiently using TI and
> the fact that we can control JSClasses for DOM objects an can teach TI
> and ICs about them for our current JSAPI-calls-C++ bindings....
>
> -Boris
> _______________________________________________
> dev-servo mailing list
> dev-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo

Boris Zbarsky

unread,
Jun 2, 2012, 12:31:07 AM6/2/12
to mozilla-...@lists.mozilla.org
On 6/1/12 10:55 PM, David Flanagan wrote:
> Can you explain what you mean by the "ensure this
> is an instance of the right interface"?

I meant verifying that it's not a random object that happens to have the
right properties but is actually a "platform object" that we created
ourselves. I've since learned that dom.js does verify that; it's just
that the code to do it is autogenerated from IDL, so wasn't obviously
present in the repository.

-Boris

David Flanagan

unread,
Jun 2, 2012, 1:27:48 AM6/2/12
to dev-...@lists.mozilla.org
On 6/1/12 9:31 PM, Boris Zbarsky wrote:
> On 6/1/12 10:55 PM, David Flanagan wrote:
>> Can you explain what you mean by the "ensure this
>> is an instance of the right interface"?
>
> I meant verifying that it's not a random object that happens to have
> the right properties but is actually a "platform object" that we
> created ourselves. I've since learned that dom.js does verify that;
> it's just that the code to do it is autogenerated from IDL, so wasn't
> obviously present in the repository.
>
I thought that's what you meant, and I thought dom.js did it right, so
I'm glad to hear that you found that layer of generated boilerplate code.

David
0 new messages