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

Changeset 236223 in webkit


Ignore:
Timestamp:
Sep 19, 2018, 2:00:08 PM (8 years ago)
Author:
sbarati@apple.com
Message:

AI rule for MultiPutByOffset executes its effects in the wrong order
​https://bugs.webkit.org/show_bug.cgi?id=189757
<rdar://problem/43535257>

Reviewed by Michael Saboff.

JSTests:

  • stress/multi-put-by-offset-must-filter-value-before-filtering-base.js: Added.

(foo):
(Foo):
(g):

Source/JavaScriptCore:

The AI rule for MultiPutByOffset was executing effects in the wrong order.
It first executed the transition effects and the effects on the base, and
then executed the filtering effects on the value being stored. However, you
can end up with the wrong type when the base and the value being stored
are the same. E.g, in a program like o.f = o. These effects need to happen
in the opposite order, modeling what happens in the runtime executing of
MultiPutByOffset.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r236161 r236223  
     12018-09-19  Saam barati  <sbarati@apple.com>
     2
     3        AI rule for MultiPutByOffset executes its effects in the wrong order
     4        https://bugs.webkit.org/show_bug.cgi?id=189757
     5        <rdar://problem/43535257>
     6
     7        Reviewed by Michael Saboff.
     8
     9        * stress/multi-put-by-offset-must-filter-value-before-filtering-base.js: Added.
     10        (foo):
     11        (Foo):
     12        (g):
     13
    1142018-09-17  Mark Lam  <mark.lam@apple.com>
    215
  • trunk/Source/JavaScriptCore/ChangeLog

    r236161 r236223  
     12018-09-19  Saam barati  <sbarati@apple.com>
     2
     3        AI rule for MultiPutByOffset executes its effects in the wrong order
     4        https://bugs.webkit.org/show_bug.cgi?id=189757
     5        <rdar://problem/43535257>
     6
     7        Reviewed by Michael Saboff.
     8
     9        The AI rule for MultiPutByOffset was executing effects in the wrong order.
     10        It first executed the transition effects and the effects on the base, and
     11        then executed the filtering effects on the value being stored. However, you
     12        can end up with the wrong type when the base and the value being stored
     13        are the same. E.g, in a program like `o.f = o`. These effects need to happen
     14        in the opposite order, modeling what happens in the runtime executing of
     15        MultiPutByOffset.
     16
     17        * dfg/DFGAbstractInterpreterInlines.h:
     18        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
     19
    1202018-09-18  Mark Lam  <mark.lam@apple.com>
    221
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r235790 r236223  
    33003300        }
    33013301       
     3302        // We need to order AI executing these effects in the same order as they're executed
     3303        // at runtime. This is critical when you have JS code like `o.f = o;`. We first
     3304        // filter types on o, then transition o. Not the other way around. If we got
     3305        // this ordering wrong, we could end up with the wrong type representing o.
     3306        setForNode(node->child2(), resultingValue);
     3307        if (!!originalValue && !resultingValue)
     3308            m_state.setIsValid(false);
     3309
    33023310        observeTransitions(clobberLimit, transitions);
    33033311        if (forNode(node->child1()).changeStructure(m_graph, newSet) == Contradiction)
    3304             m_state.setIsValid(false);
    3305         setForNode(node->child2(), resultingValue);
    3306         if (!!originalValue && !resultingValue)
    33073312            m_state.setIsValid(false);
    33083313        break;
Note: See TracChangeset for help on using the changeset viewer.