[Webkit-unassigned] [Bug 40970] [PATCH] Add equivalent of one-argument Array constructor functionality to JSC C API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 28 11:19:57 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40970





--- Comment #4 from Caio Marcelo de Oliveira Filho <caio.oliveira at openbossa.org>  2010-06-28 11:19:57 PST ---
Thanks for the comments, Geoffrey.

While I agree this is a quirk in the JavaScript Array API, JSC actually does something different instead of simply creating an empty Array and setting the length. It allocates storage in some situations and fill it with empty values.

So, JSC code already optimizes this case for Array constructor (even calling it a quirk). The patch would just allow C API users to access this case just like JS Array constructor provides us.


> We want all array clients to go fast, not just C API clients.

I might misunderstood your comment, but the patch seems to work in the opposite direction. Enable C API clients to have same access as JavaScript clients have.


The context of this patch is supporting the QScriptEngine::newArray(uint length), which follows the quirk on the builtin Array constructor.

We can, of course, live with the empty followed by setLength(). But just feels a little bit "odd" since we do have special tuned code for this exact case, i.e. JSC internally optimizes this case instead of simply treating as a quirk.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list