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

Changeset 271246 in webkit


Ignore:
Timestamp:
Jan 7, 2021, 11:50:27 AM (6 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r271034. rdar://problem/72894016

DFG should make sure replacement watchpoint is fired before folding to PutByOffset
https://bugs.webkit.org/show_bug.cgi?id=220031
<rdar://72045350>

Reviewed by Saam Barati.

  • dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::presenceConditionIfConsistent): (JSC::DFG::ByteCodeParser::checkPresence): (JSC::DFG::ByteCodeParser::checkPresenceForReplace): (JSC::DFG::ByteCodeParser::load): (JSC::DFG::ByteCodeParser::store): (JSC::DFG::ByteCodeParser::presenceLike): Deleted. (JSC::DFG::ByteCodeParser::checkPresenceLike): Deleted.
  • dfg/DFGConstantFoldingPhase.cpp: (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset):
  • runtime/Structure.cpp: (JSC::Structure::dump const):

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

Location:
branches/safari-610-branch/Source/JavaScriptCore
Files:
4 edited

Legend:

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

    r271030 r271246  
     12021-01-07  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r271034. rdar://problem/72894016
     4
     5    DFG should make sure replacement watchpoint is fired before folding to PutByOffset
     6    https://bugs.webkit.org/show_bug.cgi?id=220031
     7    <rdar://72045350>
     8   
     9    Reviewed by Saam Barati.
     10   
     11    * dfg/DFGByteCodeParser.cpp:
     12    (JSC::DFG::ByteCodeParser::presenceConditionIfConsistent):
     13    (JSC::DFG::ByteCodeParser::checkPresence):
     14    (JSC::DFG::ByteCodeParser::checkPresenceForReplace):
     15    (JSC::DFG::ByteCodeParser::load):
     16    (JSC::DFG::ByteCodeParser::store):
     17    (JSC::DFG::ByteCodeParser::presenceLike): Deleted.
     18    (JSC::DFG::ByteCodeParser::checkPresenceLike): Deleted.
     19    * dfg/DFGConstantFoldingPhase.cpp:
     20    (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset):
     21    * runtime/Structure.cpp:
     22    (JSC::Structure::dump const):
     23   
     24    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271034 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     25
     26    2020-12-21  Keith Miller  <keith_miller@apple.com>
     27
     28            DFG should make sure replacement watchpoint is fired before folding to PutByOffset
     29            https://bugs.webkit.org/show_bug.cgi?id=220031
     30            <rdar://72045350>
     31
     32            Reviewed by Saam Barati.
     33
     34            * dfg/DFGByteCodeParser.cpp:
     35            (JSC::DFG::ByteCodeParser::presenceConditionIfConsistent):
     36            (JSC::DFG::ByteCodeParser::checkPresence):
     37            (JSC::DFG::ByteCodeParser::checkPresenceForReplace):
     38            (JSC::DFG::ByteCodeParser::load):
     39            (JSC::DFG::ByteCodeParser::store):
     40            (JSC::DFG::ByteCodeParser::presenceLike): Deleted.
     41            (JSC::DFG::ByteCodeParser::checkPresenceLike): Deleted.
     42            * dfg/DFGConstantFoldingPhase.cpp:
     43            (JSC::DFG::ConstantFoldingPhase::tryFoldAsPutByOffset):
     44            * runtime/Structure.cpp:
     45            (JSC::Structure::dump const):
     46
    1472020-12-16  Mark Lam  <mark.lam@apple.com>
    248
  • branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r265934 r271246  
    228228    // Create a presence ObjectPropertyCondition based on some known offset and structure set. Does not
    229229    // check the validity of the condition, but it may return a null one if it encounters a contradiction.
    230     ObjectPropertyCondition presenceLike(
     230    ObjectPropertyCondition presenceConditionIfConsistent(
    231231        JSObject* knownBase, UniquedStringImpl*, PropertyOffset, const StructureSet&);
    232232   
     
    234234    // way as in all of the structures in the set. It may emit code instead of just setting a watchpoint.
    235235    // Returns true if this all works out.
    236     bool checkPresenceLike(JSObject* knownBase, UniquedStringImpl*, PropertyOffset, const StructureSet&);
    237     void checkPresenceLike(Node* base, UniquedStringImpl*, PropertyOffset, const StructureSet&);
     236    bool checkPresence(JSObject* knownBase, UniquedStringImpl*, PropertyOffset, const StructureSet&);
     237    void checkPresenceForReplace(Node* base, UniquedStringImpl*, PropertyOffset, const StructureSet&);
    238238   
    239239    // Works with both GetByIdVariant and the setter form of PutByIdVariant.
     
    43944394}
    43954395
    4396 ObjectPropertyCondition ByteCodeParser::presenceLike(
     4396ObjectPropertyCondition ByteCodeParser::presenceConditionIfConsistent(
    43974397    JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set)
    43984398{
     
    44124412}
    44134413
    4414 bool ByteCodeParser::checkPresenceLike(
     4414bool ByteCodeParser::checkPresence(
    44154415    JSObject* knownBase, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set)
    44164416{
    4417     return check(presenceLike(knownBase, uid, offset, set));
     4417    return check(presenceConditionIfConsistent(knownBase, uid, offset, set));
    44184418}
    44194419
    4420 void ByteCodeParser::checkPresenceLike(
     4420void ByteCodeParser::checkPresenceForReplace(
    44214421    Node* base, UniquedStringImpl* uid, PropertyOffset offset, const StructureSet& set)
    44224422{
    44234423    if (JSObject* knownBase = base->dynamicCastConstant<JSObject*>(*m_vm)) {
    4424         if (checkPresenceLike(knownBase, uid, offset, set))
     4424        auto condition = presenceConditionIfConsistent(knownBase, uid, offset, set);
     4425        if (check(condition)) {
     4426            auto* watchpointSet = knownBase->structure(*m_vm)->propertyReplacementWatchpointSet(condition.offset());
     4427            // This means that we probably have a stale cache and we should gather more information.
     4428            if (!watchpointSet || watchpointSet->isStillValid())
     4429                addToGraph(ForceOSRExit);
    44254430            return;
     4431        }
    44264432    }
    44274433
     
    44764482
    44774483                ObjectPropertyCondition presenceCondition =
    4478                     presenceLike(knownBase, uid, variant.offset(), variant.structureSet());
     4484                    presenceConditionIfConsistent(knownBase, uid, variant.offset(), variant.structureSet());
    44794485                if (presenceCondition) {
    44804486                    ObjectPropertyCondition equivalenceCondition =
     
    45334539    RELEASE_ASSERT(variant.kind() == PutByIdVariant::Replace);
    45344540
    4535     checkPresenceLike(base, m_graph.identifiers()[identifier], variant.offset(), variant.structure());
     4541    checkPresenceForReplace(base, m_graph.identifiers()[identifier], variant.offset(), variant.structure());
    45364542    return handlePutByOffset(base, identifier, variant.offset(), value);
    45374543}
  • branches/safari-610-branch/Source/JavaScriptCore/dfg/DFGConstantFoldingPhase.cpp

    r265934 r271246  
    705705                        }
    706706
     707                        if (variant.kind() == PutByIdVariant::Replace) {
     708                            auto* watchpoints = structure->propertyReplacementWatchpointSet(condition.offset());
     709                            if (!watchpoints || watchpoints->isStillValid())
     710                                return;
     711                        }
     712
    707713                        m_insertionSet.insertNode(
    708714                            indexInBlock, SpecNone, CheckStructure, node->origin,
  • branches/safari-610-branch/Source/JavaScriptCore/runtime/Structure.cpp

    r265934 r271246  
    13591359        out.print(", Shady leaf");
    13601360   
     1361    if (transitionWatchpointSet().isBeingWatched())
     1362        out.print(" (Watched)");
     1363
    13611364    out.print("]");
    13621365}
Note: See TracChangeset for help on using the changeset viewer.