Ignore:
Timestamp:
Apr 27, 2015, 5:14:47 PM (10 years ago)
Author:
[email protected]
Message:

RegExp matches arrays should use contiguous indexing.
<https://webkit.org/b/144286>

Reviewed by Geoffrey Garen.

We had a custom Structure being used for RegExp matches arrays that would
put the arrays into SlowPutArrayStorageShape mode. This was just left
from when matches arrays were custom, lazily initialized objects.

This change removes that Structure and switches the matches arrays to
using the default ContiguousShape Structure. This allows the FTL JIT
to compile the inner loop of the Octane/regexp benchmark.

Also made a version of initializeIndex() [inline] that takes the indexing
type in an argument, allowing createRegExpMatchesArray() to initialize
the entire array without branching on the indexing type for each entry.

~3% progression on Octane/regexp.

  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):

  • runtime/JSGlobalObject.h:

(JSC::JSGlobalObject::mapStructure):
(JSC::JSGlobalObject::regExpMatchesArrayStructure): Deleted.

  • runtime/JSObject.h:

(JSC::JSObject::initializeIndex):

  • runtime/RegExpMatchesArray.cpp:

(JSC::createRegExpMatchesArray):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r182747 r183438  
    365365        }
    366366    }
    367        
     367
    368368    void initializeIndex(VM& vm, unsigned i, JSValue v)
    369369    {
    370         switch (indexingType()) {
     370        initializeIndex(vm, i, v, indexingType());
     371    }
     372
     373    void initializeIndex(VM& vm, unsigned i, JSValue v, IndexingType indexingType)
     374    {
     375        switch (indexingType) {
    371376        case ALL_UNDECIDED_INDEXING_TYPES: {
    372377            setIndexQuicklyToUndecided(vm, i, v);
Note: See TracChangeset for help on using the changeset viewer.