[Webkit-unassigned] [Bug 41920] Avoid slow-path for put() in Array.splice()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 12 15:36:56 PDT 2010


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


Darin Adler <darin at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #61272|review?, commit-queue?      |review-, commit-queue-
               Flag|                            |




--- Comment #6 from Darin Adler <darin at apple.com>  2010-07-12 15:36:55 PST ---
(From update of attachment 61272)
Great that you're tackling this!

> -        JSArray(NonNullPassRefPtr<Structure>, unsigned initialLength);
> +        JSArray(NonNullPassRefPtr<Structure>, unsigned initialLength, bool compact = false);

In the WebKit project we strongly discourage using booleans for arguments like this one where callers pass constants. Instead, we normally use enums.

Since there is only one place where we call this, I think the default for the boolean argument isn't a good idea. No reason to have the default.

The patch otherwise looks pretty good. But setIndex is not fast enough. We want to just set m_numValuesInVector, m_length, and the values in m_storage->m_vector, without any branches and without looping. We should come up with a new code path specifically designed for creating a new array efficiently.

I’m going to say review- because of the boolean.

-- 
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