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

Changeset 242568 in webkit


Ignore:
Timestamp:
Mar 6, 2019, 2:34:30 PM (7 years ago)
Author:
ysuzuki@apple.com
Message:

[JSC] AI should not propagate AbstractValue relying on constant folding phase
https://bugs.webkit.org/show_bug.cgi?id=195375

Reviewed by Saam Barati.

JSTests:

  • stress/make-rope-should-not-propagate-constant-folded-value-in-ai.js: Added.

(let.array):

Source/JavaScriptCore:

MakeRope rule in AI attempts to propagate the node, which will be produced after constant folding phase runs.
This is wrong since we do not guarantee that constant folding phase runs after AI runs (e.g. DFGSpeculativeJIT
and FTLLowerDFGToB3 run AI). This results in the bug that the value produced at runtime is different from the
proven constant value in AI. In the attached test, AI says the value is SpecStringIdent while the resulted value
at runtime is SpecStringVar, resulting in wrong MakeRope code. This patch removes the path propagating the node
relying on constant folding phase.

  • dfg/DFGAbstractInterpreterInlines.h:

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

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r242519 r242568  
     12019-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] AI should not propagate AbstractValue relying on constant folding phase
     4        https://bugs.webkit.org/show_bug.cgi?id=195375
     5
     6        Reviewed by Saam Barati.
     7
     8        * stress/make-rope-should-not-propagate-constant-folded-value-in-ai.js: Added.
     9        (let.array):
     10
    1112019-03-05  Saam barati  <sbarati@apple.com>
    212
  • trunk/Source/JavaScriptCore/ChangeLog

    r242519 r242568  
     12019-03-06  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] AI should not propagate AbstractValue relying on constant folding phase
     4        https://bugs.webkit.org/show_bug.cgi?id=195375
     5
     6        Reviewed by Saam Barati.
     7
     8        MakeRope rule in AI attempts to propagate the node, which will be produced after constant folding phase runs.
     9        This is wrong since we do not guarantee that constant folding phase runs after AI runs (e.g. DFGSpeculativeJIT
     10        and FTLLowerDFGToB3 run AI). This results in the bug that the value produced at runtime is different from the
     11        proven constant value in AI. In the attached test, AI says the value is SpecStringIdent while the resulted value
     12        at runtime is SpecStringVar, resulting in wrong MakeRope code. This patch removes the path propagating the node
     13        relying on constant folding phase.
     14
     15        * dfg/DFGAbstractInterpreterInlines.h:
     16        (JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
     17
    1182019-03-05  Saam barati  <sbarati@apple.com>
    219
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r241228 r242568  
    734734        }
    735735
    736         if (numberOfRemovedChildren) {
     736        if (numberOfRemovedChildren)
    737737            m_state.setFoundConstants(true);
    738             if (numberOfRemovedChildren == numberOfChildren) {
    739                 // Propagate the last child. This is the way taken in the constant folding phase.
    740                 setForNode(node, forNode(node->children.child(numberOfChildren - 1)));
    741                 break;
    742             }
    743             if ((numberOfRemovedChildren + 1) == numberOfChildren) {
    744                 ASSERT(nonEmptyIndex);
    745                 setForNode(node, forNode(node->children.child(nonEmptyIndex.value())));
    746                 break;
    747             }
    748         }
    749738        setForNode(node, m_vm.stringStructure.get());
    750739        break;
Note: See TracChangeset for help on using the changeset viewer.