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

    r218977 r219636  
    9292            for (; i < vectorLength; ++i)
    9393                butterfly->contiguousDouble()[i] = PNaN;
    94         } else {
     94        } else if (LIKELY(!hasUndecided(indexingType))) {
    9595            for (; i < vectorLength; ++i)
    9696                butterfly->contiguous()[i].clear();
Note: See TracChangeset for help on using the changeset viewer.