| Summary: | Allocate the whole RegExpMatchesArray backing store up front. | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Andreas Kling <kling> | ||||
| Component: | JavaScriptCore | Assignee: | Andreas Kling <kling> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | fpizlo, ggaren, kling, mhahnenberg | ||||
| Priority: | P2 | Keywords: | Performance | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Andreas Kling
2014-07-23 15:24:28 PDT
Created attachment 235385 [details]
Patch
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? Committed r172618: <http://trac.webkit.org/changeset/172618> |