⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 259264 in webkit


Ignore:
Timestamp:
Mar 30, 2020, 6:46:55 PM (6 years ago)
Author:
ysuzuki@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r259262 r259264  
     12020-03-30  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] DFGArrayMode::alreadyChecked should have NonArray check when ArrayMode is NonArray+SlowPutArrayStorage
     4        https://bugs.webkit.org/show_bug.cgi?id=209791
     5
     6        Reviewed by Saam Barati.
     7
     8        DFGArrayMode::alreadyChecked with NonArray+SlowPutArrayStorage should check NonArray condition.
     9
     10        * dfg/DFGArrayMode.cpp:
     11        (JSC::DFG::ArrayMode::alreadyChecked const):
     12        * dfg/DFGArrayMode.h:
     13        (JSC::DFG::ArrayMode::arrayModesWithIndexingShapes const):
     14
    1152020-03-30  Alexey Shvayka  <shvaikalesh@gmail.com>
    216
  • 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:
  • trunk/Source/JavaScriptCore/dfg/DFGArrayMode.h

    r249959 r259264  
    532532                return asArrayModesIgnoringTypedArrays(shape) | asArrayModesIgnoringTypedArrays(shape | IsArray) | asArrayModesIgnoringTypedArrays(shape | IsArray | CopyOnWrite);
    533533            return asArrayModesIgnoringTypedArrays(shape) | asArrayModesIgnoringTypedArrays(shape | IsArray);
    534         default:
    535             // This is only necessary for C++ compilers that don't understand enums.
    536             return 0;
    537         }
     534        }
     535        // This is only necessary for C++ compilers that don't understand enums.
     536        return 0;
    538537    }
    539538   
Note: See TracChangeset for help on using the changeset viewer.