Changeset 241753 in webkit


Ignore:
Timestamp:
Feb 18, 2019 6:32:10 PM (5 years ago)
Author:
mark.lam@apple.com
Message:

Fix DFG doesGC() for CompareEq/Less/LessEq/Greater/GreaterEq and CompareStrictEq nodes.
https://bugs.webkit.org/show_bug.cgi?id=194800
<rdar://problem/48183773>

Reviewed by Yusuke Suzuki.

Fix doesGC() for the following nodes:

CompareEq:
CompareLess:
CompareLessEq:
CompareGreater:
CompareGreaterEq:
CompareStrictEq:

Only return false (i.e. does not GC) for child node use kinds that have
been vetted to not do anything that can GC. For all other use kinds
(including StringUse and BigIntUse), we return true (i.e. does GC).

  • dfg/DFGDoesGC.cpp:

(JSC::DFG::doesGC):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r241751 r241753  
     12019-02-18  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix DFG doesGC() for CompareEq/Less/LessEq/Greater/GreaterEq and CompareStrictEq nodes.
     4        https://bugs.webkit.org/show_bug.cgi?id=194800
     5        <rdar://problem/48183773>
     6
     7        Reviewed by Yusuke Suzuki.
     8
     9        Fix doesGC() for the following nodes:
     10
     11            CompareEq:
     12            CompareLess:
     13            CompareLessEq:
     14            CompareGreater:
     15            CompareGreaterEq:
     16            CompareStrictEq:
     17                Only return false (i.e. does not GC) for child node use kinds that have
     18                been vetted to not do anything that can GC.  For all other use kinds
     19                (including StringUse and BigIntUse), we return true (i.e. does GC).
     20
     21        * dfg/DFGDoesGC.cpp:
     22        (JSC::DFG::doesGC):
     23
    1242019-02-16  Darin Adler  <darin@apple.com>
    225
  • trunk/Source/JavaScriptCore/dfg/DFGDoesGC.cpp

    r241314 r241753  
    134134    case AssertNotEmpty:
    135135    case CheckStringIdent:
    136     case CompareLess:
    137     case CompareLessEq:
    138     case CompareGreater:
    139     case CompareGreaterEq:
    140136    case CompareBelow:
    141137    case CompareBelowEq:
    142     case CompareEq:
    143     case CompareStrictEq:
    144138    case CompareEqPtr:
    145139    case ProfileType:
     
    409403        return true;
    410404
     405    case CompareEq:
     406    case CompareLess:
     407    case CompareLessEq:
     408    case CompareGreater:
     409    case CompareGreaterEq:
     410        if (node->isBinaryUseKind(Int32Use)
     411#if USE(JSVALUE64)
     412            || node->isBinaryUseKind(Int52RepUse)
     413#endif
     414            || node->isBinaryUseKind(DoubleRepUse)
     415            || node->isBinaryUseKind(StringIdentUse)
     416            )
     417            return false;
     418        if (node->op() == CompareEq) {
     419            if (node->isBinaryUseKind(BooleanUse)
     420                || node->isBinaryUseKind(SymbolUse)
     421                || node->isBinaryUseKind(ObjectUse)
     422                || node->isBinaryUseKind(ObjectUse, ObjectOrOtherUse) || node->isBinaryUseKind(ObjectOrOtherUse, ObjectUse))
     423                return false;
     424        }
     425        return true;
     426
     427    case CompareStrictEq:
     428        if (node->isBinaryUseKind(BooleanUse)
     429            || node->isBinaryUseKind(Int32Use)
     430#if USE(JSVALUE64)
     431            || node->isBinaryUseKind(Int52RepUse)
     432#endif
     433            || node->isBinaryUseKind(DoubleRepUse)
     434            || node->isBinaryUseKind(SymbolUse)
     435            || node->isBinaryUseKind(SymbolUse, UntypedUse)
     436            || node->isBinaryUseKind(UntypedUse, SymbolUse)
     437            || node->isBinaryUseKind(StringIdentUse)
     438            || node->isBinaryUseKind(ObjectUse, UntypedUse) || node->isBinaryUseKind(UntypedUse, ObjectUse)
     439            || node->isBinaryUseKind(ObjectUse)
     440            || node->isBinaryUseKind(MiscUse, UntypedUse) || node->isBinaryUseKind(UntypedUse, MiscUse)
     441            || node->isBinaryUseKind(StringIdentUse, NotStringVarUse) || node->isBinaryUseKind(NotStringVarUse, StringIdentUse))
     442            return false;
     443        return true;
     444
    411445    case GetIndexedPropertyStorage:
    412446    case GetByVal:
Note: See TracChangeset for help on using the changeset viewer.