Ignore:
Timestamp:
Mar 30, 2020, 6:46:55 PM (5 years ago)
Author:
[email protected]
Message:

[JSC] DFGArrayMode::alreadyChecked should have NonArray check when ArrayMode is NonArray+SlowPutArrayStorage
https://bugs.webkit.org/show_bug.cgi?id=209791

Reviewed by Saam Barati.

DFGArrayMode::alreadyChecked with NonArray+SlowPutArrayStorage should check NonArray condition.

  • dfg/DFGArrayMode.cpp:

(JSC::DFG::ArrayMode::alreadyChecked const):

  • dfg/DFGArrayMode.h:

(JSC::DFG::ArrayMode::arrayModesWithIndexingShapes const):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGArrayMode.cpp

    r259175 r259264  
    512512    case Array::SlowPutArrayStorage:
    513513        switch (arrayClass()) {
    514         case Array::OriginalArray: {
     514        case Array::OriginalArray:
     515        case Array::OriginalCopyOnWriteArray: {
    515516            CRASH();
    516517            return false;
     
    531532            return true;
    532533        }
    533        
    534         default: {
     534
     535        // Array::OriginalNonArray can be shown when the value is a TypedArray with original structure.
     536        // But here, we already filtered TypedArrays. So, just handle it like a NonArray.
     537        case Array::NonArray:
     538        case Array::OriginalNonArray: {
     539            if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModesIgnoringTypedArrays(NonArrayWithArrayStorage) | asArrayModesIgnoringTypedArrays(NonArrayWithSlowPutArrayStorage)))
     540                return true;
     541            if (value.m_structure.isTop())
     542                return false;
     543            for (unsigned i = value.m_structure.size(); i--;) {
     544                RegisteredStructure structure = value.m_structure[i];
     545                if (!hasAnyArrayStorage(structure->indexingType()))
     546                    return false;
     547                if (structure->indexingType() & IsArray)
     548                    return false;
     549            }
     550            return true;
     551        }
     552
     553        case Array::PossiblyArray: {
    535554            if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModesIgnoringTypedArrays(NonArrayWithArrayStorage) | asArrayModesIgnoringTypedArrays(ArrayWithArrayStorage) | asArrayModesIgnoringTypedArrays(NonArrayWithSlowPutArrayStorage) | asArrayModesIgnoringTypedArrays(ArrayWithSlowPutArrayStorage)))
    536555                return true;
     
    543562            }
    544563            return true;
    545         } }
     564        }
     565        }
    546566       
    547567    case Array::DirectArguments:
Note: See TracChangeset for help on using the changeset viewer.