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

Changeset 259598 in webkit


Ignore:
Timestamp:
Apr 6, 2020, 3:47:10 PM (6 years ago)
Author:
Alan Coon
Message:

Cherry-pick r259264. rdar://problem/61352437

[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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-609.2.1.2-branch/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-609.2.1.2-branch/Source/JavaScriptCore/ChangeLog

    r259502 r259598  
     12020-04-06  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r259264. rdar://problem/61352437
     4
     5    [JSC] DFGArrayMode::alreadyChecked should have NonArray check when ArrayMode is NonArray+SlowPutArrayStorage
     6    https://bugs.webkit.org/show_bug.cgi?id=209791
     7   
     8    Reviewed by Saam Barati.
     9   
     10    DFGArrayMode::alreadyChecked with NonArray+SlowPutArrayStorage should check NonArray condition.
     11   
     12    * dfg/DFGArrayMode.cpp:
     13    (JSC::DFG::ArrayMode::alreadyChecked const):
     14    * dfg/DFGArrayMode.h:
     15    (JSC::DFG::ArrayMode::arrayModesWithIndexingShapes const):
     16   
     17    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@259264 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     18
     19    2020-03-30  Yusuke Suzuki  <ysuzuki@apple.com>
     20
     21            [JSC] DFGArrayMode::alreadyChecked should have NonArray check when ArrayMode is NonArray+SlowPutArrayStorage
     22            https://bugs.webkit.org/show_bug.cgi?id=209791
     23
     24            Reviewed by Saam Barati.
     25
     26            DFGArrayMode::alreadyChecked with NonArray+SlowPutArrayStorage should check NonArray condition.
     27
     28            * dfg/DFGArrayMode.cpp:
     29            (JSC::DFG::ArrayMode::alreadyChecked const):
     30            * dfg/DFGArrayMode.h:
     31            (JSC::DFG::ArrayMode::arrayModesWithIndexingShapes const):
     32
    1332020-04-03  Alan Coon  <alancoon@apple.com>
    234
  • branches/safari-609.2.1.2-branch/Source/JavaScriptCore/dfg/DFGArrayMode.cpp

    r250086 r259598  
    511511    case Array::SlowPutArrayStorage:
    512512        switch (arrayClass()) {
    513         case Array::OriginalArray: {
     513        case Array::OriginalArray:
     514        case Array::OriginalCopyOnWriteArray: {
    514515            CRASH();
    515516            return false;
     
    530531            return true;
    531532        }
    532        
    533         default: {
     533
     534        // Array::OriginalNonArray can be shown when the value is a TypedArray with original structure.
     535        // But here, we already filtered TypedArrays. So, just handle it like a NonArray.
     536        case Array::NonArray:
     537        case Array::OriginalNonArray: {
     538            if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModesIgnoringTypedArrays(NonArrayWithArrayStorage) | asArrayModesIgnoringTypedArrays(NonArrayWithSlowPutArrayStorage)))
     539                return true;
     540            if (value.m_structure.isTop())
     541                return false;
     542            for (unsigned i = value.m_structure.size(); i--;) {
     543                RegisteredStructure structure = value.m_structure[i];
     544                if (!hasAnyArrayStorage(structure->indexingType()))
     545                    return false;
     546                if (structure->indexingType() & IsArray)
     547                    return false;
     548            }
     549            return true;
     550        }
     551
     552        case Array::PossiblyArray: {
    534553            if (arrayModesAlreadyChecked(value.m_arrayModes, asArrayModesIgnoringTypedArrays(NonArrayWithArrayStorage) | asArrayModesIgnoringTypedArrays(ArrayWithArrayStorage) | asArrayModesIgnoringTypedArrays(NonArrayWithSlowPutArrayStorage) | asArrayModesIgnoringTypedArrays(ArrayWithSlowPutArrayStorage)))
    535554                return true;
     
    542561            }
    543562            return true;
    544         } }
     563        }
     564        }
    545565       
    546566    case Array::DirectArguments:
  • branches/safari-609.2.1.2-branch/Source/JavaScriptCore/dfg/DFGArrayMode.h

    r249959 r259598  
    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.