Changeset 234075 in webkit


Ignore:
Timestamp:
Jul 20, 2018 4:48:16 PM (6 years ago)
Author:
msaboff@apple.com
Message:

DFG AbstractInterpreter: CheckArray filters array modes for DirectArguments/ScopedArguments using only NonArray
https://bugs.webkit.org/show_bug.cgi?id=187827
rdar://problem/42146858

Reviewed by Saam Barati.

JSTests:

New regression tests.

  • stress/direct-arguments-check-array.js: Added.

(setup.f2):
(setup):
(forOfArray):
(forOfArgs):
(callEveryOnArgs):

  • stress/scoped-arguments-check-array.js: Added.

(setup.foo):
(setup.f2):
(setup):
(forOfArray):
(forOfArgs):
(callEveryOnArgs):

Source/JavaScriptCore:

When filtering array modes for DirectArguments or ScopedArguments, we need to allow for the possibility
that they can either be NonArray or NonArrayWithArrayStorage (aka ArrayStorageShape).
We can't end up with other shapes, Int32, Double, etc because GenericArguments sets
InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero which will cause us to go down a
putByIndex() path that doesn't change the shape.

  • dfg/DFGArrayMode.h:

(JSC::DFG::ArrayMode::arrayModesThatPassFiltering const):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r234066 r234075  
     12018-07-20  Michael Saboff  <msaboff@apple.com>
     2
     3        DFG AbstractInterpreter: CheckArray filters array modes for DirectArguments/ScopedArguments using only NonArray
     4        https://bugs.webkit.org/show_bug.cgi?id=187827
     5        rdar://problem/42146858
     6
     7        Reviewed by Saam Barati.
     8
     9        New regression tests.
     10
     11        * stress/direct-arguments-check-array.js: Added.
     12        (setup.f2):
     13        (setup):
     14        (forOfArray):
     15        (forOfArgs):
     16        (callEveryOnArgs):
     17        * stress/scoped-arguments-check-array.js: Added.
     18        (setup.foo):
     19        (setup.f2):
     20        (setup):
     21        (forOfArray):
     22        (forOfArgs):
     23        (callEveryOnArgs):
     24
    1252018-07-20  Yusuke Suzuki  <utatane.tea@gmail.com>
    226
  • trunk/Source/JavaScriptCore/ChangeLog

    r234066 r234075  
     12018-07-20  Michael Saboff  <msaboff@apple.com>
     2
     3        DFG AbstractInterpreter: CheckArray filters array modes for DirectArguments/ScopedArguments using only NonArray
     4        https://bugs.webkit.org/show_bug.cgi?id=187827
     5        rdar://problem/42146858
     6
     7        Reviewed by Saam Barati.
     8
     9        When filtering array modes for DirectArguments or ScopedArguments, we need to allow for the possibility
     10        that they can either be NonArray or NonArrayWithArrayStorage (aka ArrayStorageShape).
     11        We can't end up with other shapes, Int32, Double, etc because GenericArguments sets
     12        InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero which will cause us to go down a
     13        putByIndex() path that doesn't change the shape.
     14
     15        * dfg/DFGArrayMode.h:
     16        (JSC::DFG::ArrayMode::arrayModesThatPassFiltering const):
     17
    1182018-07-20  Yusuke Suzuki  <utatane.tea@gmail.com>
    219
  • trunk/Source/JavaScriptCore/dfg/DFGArrayMode.h

    r232376 r234075  
    443443        case Array::SlowPutArrayStorage:
    444444            return arrayModesWithIndexingShapes(SlowPutArrayStorageShape, ArrayStorageShape);
     445        case Array::DirectArguments:
     446        case Array::ScopedArguments:
     447            return arrayModesWithIndexingShapes(ArrayStorageShape, NonArray);
    445448        default:
    446449            return asArrayModes(NonArray);
Note: See TracChangeset for help on using the changeset viewer.