Ignore:
Timestamp:
Dec 8, 2014, 2:12:25 PM (10 years ago)
Author:
[email protected]
Message:

CFA wrongly assumes that a speculation for SlowPutArrayStorageShape disallows ArrayStorageShape arrays.
<https://webkit.org/b/139327>

Reviewed by Michael Saboff.

Source/JavaScriptCore:

The code generator and runtime slow paths expects otherwise. This patch fixes
CFA to match the code generator's expectation.

  • dfg/DFGArrayMode.h:

(JSC::DFG::ArrayMode::arrayModesThatPassFiltering):
(JSC::DFG::ArrayMode::arrayModesWithIndexingShapes):

LayoutTests:

  • js/dfg-slow-put-array-storage-spec-should-allow-fast-array-storage-expected.txt: Added.
  • js/dfg-slow-put-array-storage-spec-should-allow-fast-array-storage.html: Added.
  • js/script-tests/dfg-slow-put-array-storage-spec-should-allow-fast-array-storage.js: Added.

(foo):
(test):

File:
1 edited

Legend:

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

    r165099 r176972  
    407407            return arrayModesWithIndexingShape(ArrayStorageShape);
    408408        case Array::SlowPutArrayStorage:
    409             return arrayModesWithIndexingShape(SlowPutArrayStorageShape);
     409            return arrayModesWithIndexingShapes(SlowPutArrayStorageShape, ArrayStorageShape);
    410410        default:
    411411            return asArrayModes(NonArray);
     
    463463    }
    464464   
     465    ArrayModes arrayModesWithIndexingShapes(IndexingType shape1, IndexingType shape2) const
     466    {
     467        ArrayModes arrayMode1 = arrayModesWithIndexingShape(shape1);
     468        ArrayModes arrayMode2 = arrayModesWithIndexingShape(shape2);
     469        return arrayMode1 | arrayMode2;
     470    }
     471
    465472    bool alreadyChecked(Graph&, Node*, AbstractValue&, IndexingType shape) const;
    466473   
Note: See TracChangeset for help on using the changeset viewer.