Ignore:
Timestamp:
Jul 18, 2017, 3:40:59 PM (8 years ago)
Author:
[email protected]
Message:

Butterfly storage need not be initialized for indexing type Undecided.
https://bugs.webkit.org/show_bug.cgi?id=174516

Reviewed by Saam Barati.

While it's not incorrect to initialize the butterfly storage when the
indexingType is Undecided, it is inefficient as we'll end up initializing
it again later when we convert the storage to a different indexingType.
Some of our code already skips initializing Undecided butterflies.
This patch makes it the consistent behavior everywhere.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::emitAllocateRawObject):

  • runtime/JSArray.cpp:

(JSC::JSArray::tryCreateUninitializedRestricted):

  • runtime/JSArray.h:

(JSC::JSArray::tryCreate):

  • runtime/JSObject.cpp:

(JSC::JSObject::ensureLengthSlow):

File:
1 edited

Legend:

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

    r218794 r219636  
    240240        if (hasDouble(indexingType))
    241241            clearArray(butterfly->contiguousDouble().data(), vectorLength);
    242         else
     242        else if (LIKELY(!hasUndecided(indexingType)))
    243243            clearArray(butterfly->contiguous().data(), vectorLength);
    244244    } else {
Note: See TracChangeset for help on using the changeset viewer.