W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2013

Re: Elements (extends Array)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 08 Aug 2013 01:55:52 -0400
Message-ID: <520332E8.8030409@mit.edu>
To: Jonas Sicking <jonas@sicking.cc>
CC: Domenic Denicola <domenic@domenicdenicola.com>, public-script-coord@w3.org
On 8/8/13 1:52 AM, Jonas Sicking wrote:
> Couldn't we still implement such a method by having specially generated
> code which did type testing specifically by doing checks similar to what
> Array.isArray does? I.e. we would generate wholly different type testing
> code than we do for (other) DOM objects.

It depends on whether we even have a way to tell some Arrays apart from 
others internally.  Right now, SpiderMonkey (for example) doesn't allow 
an embedding to do that.

If we posit that that's changed, introducing basically a separate kind 
of DOM object that doesn't behave like all the others is possible, but 
would slow down some things (more branching) and would require a bunch 
more work to make it play nice with the JIT (because it doesn't have the 
same internal layout as other objects the JIT knows about).

So as I said, doable at significant performance cost.

-Boris
Received on Thursday, 8 August 2013 05:56:22 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:37:50 UTC