Bug 135217 - Allocate the whole RegExpMatchesArray backing store up front.
Summary: Allocate the whole RegExpMatchesArray backing store up front.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on:
Blocks:
 
Reported: 2014-07-23 15:24 PDT by Andreas Kling
Modified: 2014-08-14 20:22 PDT (History)
4 users (show)

See Also:


Attachments
Patch (2.42 KB, patch)
2014-07-23 15:25 PDT, Andreas Kling
ggaren: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2014-07-23 15:24:28 PDT
Have patch.
Comment 1 Andreas Kling 2014-07-23 15:25:01 PDT
Created attachment 235385 [details]
Patch
Comment 2 Geoffrey Garen 2014-07-25 11:22:58 PDT
Comment on attachment 235385 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=235385&action=review

r=me

> Source/JavaScriptCore/runtime/RegExpMatchesArray.cpp:55
> +static inline Butterfly* createRegExpMatchesArrayButterfly(VM& vm, JSCell* intendedOwner, unsigned initialLength)
> +{
> +    Butterfly* butterfly = Butterfly::create(
> +        vm, intendedOwner, 0, 0, true, indexingHeaderForArray(initialLength, initialLength),
> +        ArrayStorage::sizeFor(initialLength));
> +    ArrayStorage* storage = butterfly->arrayStorage();
> +    storage->m_indexBias = 0;
> +    storage->m_sparseMap.clear();
> +    storage->m_numValuesInVector = 0;
> +    return butterfly;
> +}

Maybe this function should go in JSArray.h?
Comment 3 Andreas Kling 2014-08-14 20:22:19 PDT
Committed r172618: <http://trac.webkit.org/changeset/172618>